From 71e9455a5d875e06da04ebd5a3c083eec1cd505f Mon Sep 17 00:00:00 2001 From: Rosario Scavo Date: Sun, 31 Dec 2023 15:49:05 +0100 Subject: [PATCH 1/9] fix(card_navigate): fix color icon variable --- .../ulm_templates/card_templates/cards/card_navigate.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_navigate.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_navigate.yaml index a553b9861..df122fcc1 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_navigate.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_navigate.yaml @@ -3,7 +3,6 @@ card_navigate: template: - "icon_only" - - "blue_no_state" tap_action: action: "navigate" navigation_path: "[[[ return variables.ulm_card_navigate_path; ]]]" @@ -15,7 +14,7 @@ card_navigate: icon: - color: > [[[ - let color = variables.ulm_card_navigate_colour; + let color = variables.ulm_card_navigate_color; return "rgba(" + color + ",0.7)" ]]] label: From 4294ad88e6f3a51987083579963097b88764aaa3 Mon Sep 17 00:00:00 2001 From: Cookie987 Date: Wed, 21 Feb 2024 16:02:23 +0800 Subject: [PATCH 2/9] Add zh-CN translation --- .../ui_lovelace_minimalist/const.py | 2 + .../lovelace/translations/zh-CN.yaml | 17 +++++ .../translations/zh-CN.json | 68 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 custom_components/ui_lovelace_minimalist/lovelace/translations/zh-CN.yaml create mode 100644 custom_components/ui_lovelace_minimalist/translations/zh-CN.json diff --git a/custom_components/ui_lovelace_minimalist/const.py b/custom_components/ui_lovelace_minimalist/const.py index ea47cda65..4418d1554 100644 --- a/custom_components/ui_lovelace_minimalist/const.py +++ b/custom_components/ui_lovelace_minimalist/const.py @@ -38,6 +38,7 @@ "Swedish": "sv", "Turkish": "tr", "Russian": "ru", + "中文(简体)": "zh-CN", } CONF_LANGUAGE = "language" @@ -61,6 +62,7 @@ "Swedish", "Turkish", "Russian", + "中文(简体)", ] CONF_SIDEPANEL_ENABLED = "sidepanel_enabled" CONF_SIDEPANEL_TITLE = "sidepanel_title" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/zh-CN.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/zh-CN.yaml new file mode 100644 index 000000000..19a033733 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/zh-CN.yaml @@ -0,0 +1,17 @@ +--- +ulm_language_variables: + variables: + ulm_currency: "$" + ulm_updates_available: "更新可用!" + ulm_no_updates_available: "无可用更新" + ulm_ophaling: "垃圾收集!" + ulm_geen_ophaling: "从未收集" + ulm_volgende_ophaling: "下一次收集" + ulm_morning: "早上好" + ulm_afternoon: "下午好" + ulm_evening: "晚上好" + ulm_hello: "你好" + ulm_volume: "音量" + ulm_popups_color: "颜色" + ulm_radar: "雷达" + ulm_popup_total: "总计" diff --git a/custom_components/ui_lovelace_minimalist/translations/zh-CN.json b/custom_components/ui_lovelace_minimalist/translations/zh-CN.json new file mode 100644 index 000000000..25fdc9f08 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/translations/zh-CN.json @@ -0,0 +1,68 @@ +{ + "title": "UI Lovelace Minimalist", + "config": { + "step": { + "user": { + "title": "UI Lovelace Minimalist 设置", + "description": "", + "data": { + "community_cards_enabled": "允许通过此集成配置社区卡片,此功能需要 GitHub 验证!" + } + }, + "device": { + "title": "等待设备验证" + }, + "reauth_confirm": { + "title": "需要重新验证", + "description": "您需要重新验证 GitHub。" + } + }, + "abort": { + "single_instance_allowed": "该集成已经配置过了,且只能配置一次。", + "not_setup": "UI Lovelace Minimalist 还未配置。", + "github": "无法验证 GitHub,请稍后再试。", + "reauth_successful": "重新验证成功。" + }, + "progress": { + "wait_for_device": "1. 访问 {url} \n2. 粘贴以下密钥以授权本集成: \n```\n{code}\n```\n" + } + }, + "options": { + "step": { + "user": { + "title": "UI Lovelace Minimalist 设置", + "description": "", + "data": { + "language": "语言", + "sidepanel_enabled": "在侧边栏创建一个仪表盘入口", + "sidepanel_icon": "侧边栏图标", + "sidepanel_title": "侧边栏标题", + "adaptive_ui_enabled": "在拆分视图中启用自适应仪表盘", + "adaptive_ui_title": "自适应面板标题", + "adaptive_ui_icon": "自适应面板图标", + "theme": "主题", + "include_other_cards": "包含它依赖的自定义卡片资源", + "community_cards_enabled": "允许通过此集成配置社区卡片,此功能需要 GitHub 验证!", + "community_cards": "选择你想启用的社区卡片。" + } + } + }, + "abort": { + "single_instance_allowed": "该集成已经配置过了,且只能配置一次。", + "not_setup": "UI Lovelace Minimalist 未完成配置。" + }, + "error": { + "github_cards": "从 GitHub 获取卡片时发生错误。", + "ack": "你需要填写所有参数。", + "gh_token": "未设置 GitHub 密钥。请重新安装本集成以完成设置。(不会丢失任何自定义配置)" + } + }, + "services": { + "reload": { + "description": "为 UI Lovelace Minimalist 重载仪表盘配置。" + }, + "installed": { + "description": "为 UI Lovelace Minimalist 更改全局配置中的已安装密钥." + } + } +} From dc94f61111548f3c3fa4a2b936baff3bee5670af Mon Sep 17 00:00:00 2001 From: LukeD Date: Sun, 14 Apr 2024 21:09:51 +0200 Subject: [PATCH 3/9] Update card_cover.yaml Corrected icons for 'awning' device class acording to HA scheme --- .../ulm_templates/card_templates/cards/card_cover.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_cover.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_cover.yaml index 0c970b902..fd3d50927 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_cover.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_cover.yaml @@ -401,7 +401,7 @@ card_cover: return "mdi:arrow-left"; } var device_class = entity.attributes?.device_class; - if (device_class == 'curtain' || device_class == 'gate') { + if (device_class == 'curtain' || device_class == 'gate' || device_class == 'awning') { return "mdi:arrow-collapse-horizontal"; } return "mdi:arrow-down"; @@ -516,7 +516,7 @@ card_cover: return "mdi:arrow-right"; } var device_class = entity.attributes?.device_class; - if (device_class == 'curtain' || device_class == 'gate') { + if (device_class == 'curtain' || device_class == 'gate' || device_class == 'awning') { return "mdi:arrow-expand-horizontal"; } return "mdi:arrow-up"; From f80aa917e4dfadfef484fae11f019f84df55876a Mon Sep 17 00:00:00 2001 From: Matt Martin Date: Wed, 12 Jun 2024 14:16:48 -0500 Subject: [PATCH 4/9] Typo in indentation of media_player card --- .../card_templates/cards/card_media_player.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml index 61db7a681..325c2eca3 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml @@ -663,12 +663,12 @@ card_media_player: thumbVerticalPadding: "0px" thumbWidth: "0px" card_mod: - style: | - ha-card { - border-radius: 14px; - background-color: transparent; - box-shadow: none; - } + style: | + ha-card { + border-radius: 14px; + background-color: transparent; + box-shadow: none; + } item4: card: type: "custom:button-card" From a8e1567dbd3e813adb4ea507b6e997606aea607e Mon Sep 17 00:00:00 2001 From: Wilbert <155230953+wilbiev@users.noreply.github.com> Date: Sat, 29 Jun 2024 14:45:43 +0200 Subject: [PATCH 5/9] Fix 'Detected blocking call' --- .../ui_lovelace_minimalist/base.py | 171 ++++++++++++------ 1 file changed, 113 insertions(+), 58 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/base.py b/custom_components/ui_lovelace_minimalist/base.py index a6ca2c977..83bf53750 100644 --- a/custom_components/ui_lovelace_minimalist/base.py +++ b/custom_components/ui_lovelace_minimalist/base.py @@ -1,7 +1,9 @@ """Base UI Lovelace Minimalist class.""" + from __future__ import annotations from dataclasses import asdict, dataclass, field +from functools import partial import logging import os import pathlib @@ -15,6 +17,7 @@ GitHubNotModifiedException, GitHubRatelimitException, ) + from homeassistant.components.frontend import add_extra_js_url, async_remove_panel from homeassistant.components.lovelace import _register_panel from homeassistant.components.lovelace.dashboard import LovelaceYAML @@ -85,7 +88,7 @@ def to_dict(self) -> dict: def to_json(self) -> str: """Return a json string.""" - return asdict(self) + return str(asdict(self)) def update_from_dict(self, data: dict) -> None: """Set attributes from dicts.""" @@ -159,7 +162,9 @@ def _write_file(): try: await self.hass.async_add_executor_job(_write_file) - except BaseException as error: # lgtm [py/catch-base-exception] pylint: disable=broad-except + except ( + BaseException + ) as error: # lgtm [py/catch-base-exception] pylint: disable=broad-except self.log.error(f"Could not write data to {file_path} - {error}") return False @@ -208,14 +213,26 @@ async def async_github_api_method( raise exception except GitHubException as exception: _exception = exception - except BaseException as exception: # lgtm [py/catch-base-exception] pylint: disable=broad-except - self.log.exception(exception) + except ( + BaseException + ) as exception: # lgtm [py/catch-base-exception] pylint: disable=broad-except _exception = exception if raise_exception and _exception is not None: raise Exception(_exception) return None + def list_dirs(self) -> list: + """Create directory list.""" + + self.log.debug("Create directory list") + + dir_list = [] + for entry in os.scandir(self.community_cards_dir): + if entry.is_dir(): + dir_list.append(entry.path) + return dir_list + async def fetch_cards(self) -> None: """Fetch list of cards.""" response = await self.async_github_api_method( @@ -240,11 +257,13 @@ async def configure_community_cards(self) -> None: not self.configuration.community_cards_enabled or self.configuration.community_cards == [] ): - shutil.rmtree(f"{self.community_cards_dir}/", ignore_errors=True) + self.hass.async_add_executor_job( + partial( + shutil.rmtree, f"{self.community_cards_dir}/", ignore_errors=True + ) + ) elif self.configuration.community_cards_enabled: - existing_cards = [ - f.path for f in os.scandir(self.community_cards_dir) if f.is_dir() - ] + existing_cards = await self.hass.async_add_executor_job(self.list_dirs) for e in existing_cards: card_dir = os.path.basename(e) # Delete unselected folders @@ -252,12 +271,16 @@ async def configure_community_cards(self) -> None: self.log.debug( f"Deleting community card folder {card_dir}, not selected anymore." ) - shutil.rmtree(e, ignore_errors=True) + self.hass.async_add_executor_job( + partial(shutil.rmtree, e, ignore_errors=True) + ) if card_dir not in self.configuration.all_community_cards: self.log.debug( f"Deleting community card folder {card_dir}, that is not existing anymore on Github." ) - shutil.rmtree(e, ignore_errors=True) + self.hass.async_add_executor_job( + partial(shutil.rmtree, e, ignore_errors=True) + ) for card in self.configuration.community_cards: if card not in self.configuration.all_community_cards: @@ -302,6 +325,7 @@ async def configure_community_cards(self) -> None: async def configure_plugins(self) -> bool: """Configure the Plugins ULM depends on.""" self.log.debug("Checking Dependencies.") + self.log.info("Setup ULM Plugins") try: if not os.path.exists( @@ -328,11 +352,10 @@ async def configure_plugins(self) -> bool: self.log.error( f'HACS Frontend repo "{p}" is not installed, See Integration Configuration.' ) - else: - if os.path.exists(self.hass.config.path(f"www/community/{p}")): - _LOGGER.error( - f'HACS Frontend repo "{p}" is already installed, Remove it or disable include custom cards' - ) + elif os.path.exists(self.hass.config.path(f"www/community/{p}")): + _LOGGER.error( + f'HACS Frontend repo "{p}" is already installed, Remove it or disable include custom cards' + ) if self.configuration.include_other_cards: for c in depenceny_resource_paths: @@ -356,6 +379,7 @@ async def configure_plugins(self) -> bool: async def configure_dashboard(self) -> bool: """Configure the ULM Dashboards.""" + self.log.info("Setup ULM Dashboard") dashboard_url = "ui-lovelace-minimalist" dashboard_config = { @@ -387,21 +411,19 @@ async def configure_dashboard(self) -> bool: _register_panel( self.hass, dashboard_url, "yaml", dashboard_config, True ) - else: - if dashboard_url in self.hass.data["lovelace"]["dashboards"]: - async_remove_panel(self.hass, "ui-lovelace-minimalist") + elif dashboard_url in self.hass.data["lovelace"]["dashboards"]: + async_remove_panel(self.hass, "ui-lovelace-minimalist") if self.configuration.adaptive_ui_enabled: - self.hass.data["lovelace"]["dashboards"][ - adv_dashboard_url - ] = LovelaceYAML(self.hass, adv_dashboard_url, adv_dashboard_config) + self.hass.data["lovelace"]["dashboards"][adv_dashboard_url] = ( + LovelaceYAML(self.hass, adv_dashboard_url, adv_dashboard_config) + ) _register_panel( self.hass, adv_dashboard_url, "yaml", adv_dashboard_config, True ) - else: - if adv_dashboard_url in self.hass.data["lovelace"]["dashboards"]: - async_remove_panel(self.hass, "adaptive-dash") + elif adv_dashboard_url in self.hass.data["lovelace"]["dashboards"]: + async_remove_panel(self.hass, "adaptive-dash") except Exception as exception: self.log.error(exception) @@ -415,12 +437,21 @@ async def configure_ulm(self) -> bool: self.log.info("Setup ULM Configuration") try: - # Cleanup - shutil.rmtree( - self.hass.config.path(f"{DOMAIN}/configs"), ignore_errors=True + self.hass.async_add_executor_job( + partial( + shutil.rmtree, + self.hass.config.path(f"{DOMAIN}/configs"), + ignore_errors=True, + ) + ) + self.hass.async_add_executor_job( + partial( + shutil.rmtree, + self.hass.config.path(f"{DOMAIN}/addons"), + ignore_errors=True, + ) ) - shutil.rmtree(self.hass.config.path(f"{DOMAIN}/addons"), ignore_errors=True) # Create config dir os.makedirs(self.hass.config.path(f"{DOMAIN}/dashboard"), exist_ok=True) os.makedirs(self.hass.config.path(f"{DOMAIN}/custom_cards"), exist_ok=True) @@ -435,7 +466,8 @@ async def configure_ulm(self) -> bool: language = LANGUAGES[self.configuration.language] # Copy default language file over to config dir - shutil.copy2( + self.hass.async_add_executor_job( + shutil.copy2, f"{self.integration_dir}/lovelace/translations/default.yaml", f"{self.templates_dir}/default.yaml", ) @@ -444,7 +476,8 @@ async def configure_ulm(self) -> bool: if not os.path.exists( self.hass.config.path(f"{DOMAIN}/dashboard/ui-lovelace.yaml") ): - shutil.copy2( + self.hass.async_add_executor_job( + shutil.copy2, f"{self.integration_dir}/lovelace/ui-lovelace.yaml", self.hass.config.path( f"{DOMAIN}/dashboard/ui-lovelace.yaml" @@ -455,7 +488,8 @@ async def configure_ulm(self) -> bool: if not os.path.exists( self.hass.config.path(f"{DOMAIN}/dashboard/adaptive-dash") ): - shutil.copytree( + self.hass.async_add_executor_job( + shutil.copytree, f"{self.integration_dir}/lovelace/adaptive-dash", self.hass.config.path(f"{DOMAIN}/dashboard/adaptive-dash"), ) @@ -463,42 +497,56 @@ async def configure_ulm(self) -> bool: if not os.path.exists( self.hass.config.path( f"{DOMAIN}/custom_actions/custom_actions.yaml" - ) + ), ): - shutil.copy2( + self.hass.async_add_executor_job( + shutil.copy2, f"{self.integration_dir}/lovelace/custom_actions.yaml", self.hass.config.path( f"{DOMAIN}/custom_actions/custom_actions.yaml" ), ) # Copy chosen language file over to config dir - shutil.copy2( + self.hass.async_add_executor_job( + shutil.copy2, f"{self.integration_dir}/lovelace/translations/{language}.yaml", f"{self.templates_dir}/language.yaml", ) # Copy over cards from integration - shutil.copytree( - f"{self.integration_dir}/lovelace/ulm_templates", - f"{self.templates_dir}", - dirs_exist_ok=True, + self.hass.async_add_executor_job( + partial( + shutil.copytree, + f"{self.integration_dir}/lovelace/ulm_templates", + f"{self.templates_dir}", + dirs_exist_ok=True, + ), ) # Copy over manually installed custom_cards from user - shutil.copytree( - self.hass.config.path(f"{DOMAIN}/custom_cards"), - f"{self.templates_dir}/custom_cards", - dirs_exist_ok=True, + self.hass.async_add_executor_job( + partial( + shutil.copytree, + self.hass.config.path(f"{DOMAIN}/custom_cards"), + f"{self.templates_dir}/custom_cards", + dirs_exist_ok=True, + ), ) # Copy over manually installed custom_actions from user - shutil.copytree( - self.hass.config.path(f"{DOMAIN}/custom_actions"), - f"{self.templates_dir}/custom_actions", - dirs_exist_ok=True, + self.hass.async_add_executor_job( + partial( + shutil.copytree, + self.hass.config.path(f"{DOMAIN}/custom_actions"), + f"{self.templates_dir}/custom_actions", + dirs_exist_ok=True, + ), ) # Copy over themes to defined themes folder - shutil.copytree( - f"{self.integration_dir}/lovelace/themefiles", - self.hass.config.path(f"{self.configuration.theme_path}/"), - dirs_exist_ok=True, + self.hass.async_add_executor_job( + partial( + shutil.copytree, + f"{self.integration_dir}/lovelace/themefiles", + self.hass.config.path(f"{self.configuration.theme_path}/"), + dirs_exist_ok=True, + ), ) self.hass.bus.async_fire("ui_lovelace_minimalist_reload") @@ -520,18 +568,25 @@ async def handle_reload(call): def reload_configuration(self): """Reload Configuration.""" + self.log.info("Reload ULM Configuration") if os.path.exists(self.hass.config.path(f"{DOMAIN}/custom_cards")): # Copy over manually installed custom_cards from user - shutil.copytree( - self.hass.config.path(f"{DOMAIN}/custom_cards"), - f"{self.templates_dir}/custom_cards", - dirs_exist_ok=True, + self.hass.async_add_executor_job( + partial( + shutil.copytree, + self.hass.config.path(f"{DOMAIN}/custom_cards"), + f"{self.templates_dir}/custom_cards", + dirs_exist_ok=True, + ), ) if os.path.exists(self.hass.config.path(f"{DOMAIN}/custom_actions")): # Copy over manually installed custom_actions from user - shutil.copytree( - self.hass.config.path(f"{DOMAIN}/custom_actions"), - f"{self.templates_dir}/custom_actions", - dirs_exist_ok=True, + self.hass.async_add_executor_job( + partial( + shutil.copytree, + self.hass.config.path(f"{DOMAIN}/custom_actions"), + f"{self.templates_dir}/custom_actions", + dirs_exist_ok=True, + ), ) self.hass.bus.async_fire("ui_lovelace_minimalist_reload") From d42fd051f3bda2a88fc9623c8d510e03f545736e Mon Sep 17 00:00:00 2001 From: Wilbert <155230953+wilbiev@users.noreply.github.com> Date: Sat, 29 Jun 2024 14:46:32 +0200 Subject: [PATCH 6/9] Fix hanging issue --- .../ui_lovelace_minimalist/__init__.py | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/__init__.py b/custom_components/ui_lovelace_minimalist/__init__.py index 043cb81f8..020d93bf9 100644 --- a/custom_components/ui_lovelace_minimalist/__init__.py +++ b/custom_components/ui_lovelace_minimalist/__init__.py @@ -1,13 +1,15 @@ """Custom Integration to setup UI Lovelace Minimalist.""" + from __future__ import annotations import logging from typing import Any from aiogithubapi import AIOGitHubAPIException, GitHubAPI -from homeassistant.components import frontend + +from homeassistant.components.frontend import async_remove_panel from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry -from homeassistant.core import Config, HomeAssistant +from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.loader import async_get_integration @@ -64,7 +66,6 @@ async def async_initialize_integration( ulm.integration = integration ulm.version = integration.version - ulm.session = clientsession ulm.hass = hass ulm.system.running = True ulm.githubapi = GitHubAPI( @@ -89,11 +90,10 @@ async def async_startup(): await ulm.fetch_cards() await ulm.configure_community_cards() - if ( - not await ulm.configure_ulm() - or not await ulm.configure_plugins() - or not await ulm.configure_dashboard() - ): + ResponseConfigure = await ulm.configure_ulm() + ResponsePlugins = await ulm.configure_plugins() + ResponseDashboard = await ulm.configure_dashboard() + if not ResponseConfigure or not ResponsePlugins or not ResponseDashboard: return False ulm.enable_ulm() @@ -112,7 +112,7 @@ async def async_startup(): return True -async def async_setup(hass: HomeAssistant, config: Config): +async def async_setup(hass: HomeAssistant, config: dict): """Set up this integration using UI.""" return await async_initialize_integration(hass=hass, config=config) @@ -120,7 +120,7 @@ async def async_setup(hass: HomeAssistant, config: Config): async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: """Set up this integration using UI.""" - config_entry.add_update_listener(async_reload_entry) + config_entry.add_update_listener(config_entry_update_listener) return await async_initialize_integration(hass=hass, config_entry=config_entry) @@ -131,7 +131,7 @@ async def async_remove_entry(hass: HomeAssistant, config_entry: ConfigEntry): # TODO cleanup: # - themes # - blueprints - frontend.async_remove_panel(hass, "ui-lovelace-minimalist") + async_remove_panel(hass, "ui-lovelace-minimalist") async def async_reload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> None: @@ -139,3 +139,19 @@ async def async_reload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> _LOGGER.debug("Reload the config entry") await async_setup_entry(hass, config_entry) + + +async def config_entry_update_listener( + hass: HomeAssistant, config_entry: ConfigEntry +) -> None: + """Update listener, called when the config entry options are changed.""" + _LOGGER.debug("Start config_entry_update async_reload") + + await hass.config_entries.async_reload(config_entry.entry_id) + + +async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry): + """Unload Integration.""" + _LOGGER.debug("Unload the config entry") + + return await async_initialize_integration(hass=hass, config_entry=config_entry) From 5aa6c6156300d528b71708db1fa159d29d3b4489 Mon Sep 17 00:00:00 2001 From: Wilbert <155230953+wilbiev@users.noreply.github.com> Date: Sat, 29 Jun 2024 16:38:51 +0200 Subject: [PATCH 7/9] Fix 'Detected blocking call' #2 --- custom_components/ui_lovelace_minimalist/base.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/base.py b/custom_components/ui_lovelace_minimalist/base.py index 83bf53750..4c45acec8 100644 --- a/custom_components/ui_lovelace_minimalist/base.py +++ b/custom_components/ui_lovelace_minimalist/base.py @@ -17,7 +17,6 @@ GitHubNotModifiedException, GitHubRatelimitException, ) - from homeassistant.components.frontend import add_extra_js_url, async_remove_panel from homeassistant.components.lovelace import _register_panel from homeassistant.components.lovelace.dashboard import LovelaceYAML @@ -415,9 +414,9 @@ async def configure_dashboard(self) -> bool: async_remove_panel(self.hass, "ui-lovelace-minimalist") if self.configuration.adaptive_ui_enabled: - self.hass.data["lovelace"]["dashboards"][adv_dashboard_url] = ( - LovelaceYAML(self.hass, adv_dashboard_url, adv_dashboard_config) - ) + self.hass.data["lovelace"]["dashboards"][ + adv_dashboard_url + ] = LovelaceYAML(self.hass, adv_dashboard_url, adv_dashboard_config) _register_panel( self.hass, adv_dashboard_url, "yaml", adv_dashboard_config, True From dd910c525395a71cda7478b9f8eb7dc808ccbaaf Mon Sep 17 00:00:00 2001 From: wilbiev Date: Sat, 29 Jun 2024 17:16:20 +0000 Subject: [PATCH 8/9] Update files to newer version --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 467dca43a..d9b4023f0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -73,10 +73,10 @@ repos: - id: "pyupgrade" args: ["--py39-plus"] - - repo: "https://github.com/pre-commit/mirrors-isort" - rev: "v5.10.1" + - repo: https://github.com/pycqa/isort + rev: 5.12.0 hooks: - - id: "isort" + - id: isort - repo: "https://github.com/psf/black" rev: "22.3.0" From ffd365ef03d0269b258d0d058815922d3eabbf25 Mon Sep 17 00:00:00 2001 From: wilbiev Date: Sat, 29 Jun 2024 18:13:13 +0000 Subject: [PATCH 9/9] Update files to newer version --- .../ui_lovelace_minimalist/__init__.py | 1 - .../cards/button-card/button-card.js | 39 +- .../light-entity-card/light-entity-card.js | 7868 +---------------- .../lovelace-auto-entities.js | 4 +- .../lovelace-card-mod/lovelace-card-mod.js | 6 +- .../lovelace-layout-card.js | 4 +- .../lovelace-state-switch.js | 4 +- .../cards/mini-graph-card/mini-graph-card.js | 2 +- .../mini-media-player/mini-media-player.js | 242 +- .../cards/my-cards/my-cards.js | 327 +- .../simple-weather-card.js | 8 +- .../weather-radar-card/weather-radar-card.js | 8 +- scripts/update-cards.py | 22 +- 13 files changed, 830 insertions(+), 7705 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/__init__.py b/custom_components/ui_lovelace_minimalist/__init__.py index 020d93bf9..8a41bc470 100644 --- a/custom_components/ui_lovelace_minimalist/__init__.py +++ b/custom_components/ui_lovelace_minimalist/__init__.py @@ -6,7 +6,6 @@ from typing import Any from aiogithubapi import AIOGitHubAPIException, GitHubAPI - from homeassistant.components.frontend import async_remove_panel from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.core import HomeAssistant diff --git a/custom_components/ui_lovelace_minimalist/cards/button-card/button-card.js b/custom_components/ui_lovelace_minimalist/cards/button-card/button-card.js index 668c3399e..50b17e471 100644 --- a/custom_components/ui_lovelace_minimalist/cards/button-card/button-card.js +++ b/custom_components/ui_lovelace_minimalist/cards/button-card/button-card.js @@ -1,4 +1,4 @@ -function t(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)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(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(e,t))}return t}toString(){return this.cssText}}const o=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,n))(e)})(t):t;var a;const l=window,c=l.trustedTypes,h=c?c.emptyScript:"",u=l.reactiveElementPolyfillSupport,d={toAttribute(t,e){switch(e){case Boolean:t=t?h: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}},f=(t,e)=>e!==t&&(e==e||t==t),m={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:f},p="finalized";class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}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=m){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)||m}static finalize(){if(this.hasOwnProperty(p))return!1;this[p]=!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(o(t))}else void 0!==t&&e.push(o(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}u(){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 n=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{i?t.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((i=>{const n=document.createElement("style"),r=e.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=i.cssText,t.appendChild(n)}))})(n,this.constructor.elementStyles),n}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=m){var n;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:d).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),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),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:d;this._$El=r,this[r]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||f)(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 _;g[p]=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:g}),(null!==(a=l.reactiveElementVersions)&&void 0!==a?a:l.reactiveElementVersions=[]).push("1.6.2");const v=window,b=v.trustedTypes,y=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,A="?"+$,k=`<${A}>`,x=document,S=()=>x.createComment(""),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,T="[ \t\n\f\r]",C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,j=/>/g,H=RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,R=/"/g,N=/^(?:script|style|textarea|title)$/i,P=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),z=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),L=new WeakMap,F=x.createTreeWalker(x,129,null,!1);function V(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==y?y.createHTML(e):e}const U=(t,e)=>{const i=t.length-1,n=[];let r,s=2===e?"":"",o=C;for(let a=0;a"===l[0]?(o=null!=r?r:C,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,i=l[1],o=void 0===l[3]?H:'"'===l[3]?R:D):o===R||o===D?o=H:o===M||o===j?o=C:(o=H,r=void 0);const u=o===H&&t[a+1].startsWith("/>")?" ":"";s+=o===C?e+k:c>=0?(n.push(i),e.slice(0,c)+w+e.slice(c)+$+u):e+$+(-2===c?(n.push(void 0),a):u)}return[V(t,s+(t[i]||"")+(2===e?"":"")),n]};class B{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,s=0;const o=t.length-1,a=this.parts,[l,c]=U(t,e);if(this.el=B.createElement(l,i),F.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=F.nextNode())&&a.length0){n.textContent=b?b.emptyScript:"";for(let i=0;iO(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==I&&E(this._$AH)?this._$AA.nextSibling.data=t:this.$(x.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:n}=t,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=B.createElement(V(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.v(i);else{const t=new q(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=L.get(t.strings);return void 0===e&&L.set(t.strings,e=new B(t)),e}T(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const r of t)n===e.length?e.push(i=new Z(this.k(S()),this.k(S()),this,this.options)):i=e[n],i._$AI(r),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=I}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const r=this.strings;let s=!1;if(void 0===r)t=W(this,t,e,0),s=!E(t)||t!==this._$AH&&t!==z,s&&(this._$AH=t);else{const n=t;let o,a;for(t=r[0],o=0;o{var n,r;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let o=s._$litPart$;if(void 0===o){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=o=new Z(e.insertBefore(S(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(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 z}}nt.finalized=!0,nt._$litElement$=!0,null===(et=globalThis.litElementHydrateSupport)||void 0===et||et.call(globalThis,{LitElement:nt});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:nt}),(null!==(it=globalThis.litElementVersions)&&void 0!==it?it:globalThis.litElementVersions=[]).push("3.3.2");const st=(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)}};function ot(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):st(t,e)}const at=({finisher:t,descriptor:e})=>(i,n)=>{var r;if(void 0===n){const n=null!==(r=i.originalKey)&&void 0!==r?r:i.key,s=null!=e?{kind:"method",placement:"prototype",key:n,descriptor:e(i.key)}:{...i,key:n};return null!=t&&(s.finisher=function(e){t(e,n)}),s}{const r=i.constructor;void 0!==e&&Object.defineProperty(i,n,e(n)),null==t||t(r,n)}};var lt;null===(lt=window.HTMLSlotElement)||void 0===lt||lt.prototype.assignedElements;class ct{constructor(t){this.startPress=e=>{t().then((t=>{t&&t.startPress(e)}))},this.endPress=()=>{t().then((t=>{t&&t.endPress()}))},this.startFocus=()=>{t().then((t=>{t&&t.startFocus()}))},this.endFocus=()=>{t().then((t=>{t&&t.endFocus()}))},this.startHover=()=>{t().then((t=>{t&&t.startHover()}))},this.endHover=()=>{t().then((t=>{t&&t.endHover()}))}}}const ht=1,ut=2,dt=t=>(...e)=>({_$litDirective$:t,values:e});class ft{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)}}const mt="important",pt=" !"+mt,gt=dt(class extends ft{constructor(t){var e;if(super(t),t.type!==ht||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const n=t[i];return null==n?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach((t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?i.removeProperty(t):i[t]="")}));for(const n in e){const t=e[n];if(null!=t){this.ut.add(n);const e="string"==typeof t&&t.endsWith(pt);n.includes("-")||e?i.setProperty(n,e?t.slice(0,-11):t,e?mt:""):i[n]=t}}return z}});class _t extends ft{constructor(t){if(super(t),this.et=I,t.type!==ut)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===I||null==t)return this.ft=void 0,this.et=t;if(t===z)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}_t.directiveName="unsafeHTML",_t.resultType=1;const vt=dt(_t),bt=dt(class extends ft{constructor(t){var e;if(super(t),t.type!==ht||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,n;if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.nt)||void 0===i?void 0:i.has(t))&&this.it.add(t);return this.render(e)}const r=t.element.classList;this.it.forEach((t=>{t in e||(r.remove(t),this.it.delete(t))}));for(const s in e){const t=!!e[s];t===this.it.has(s)||(null===(n=this.nt)||void 0===n?void 0:n.has(s))||(t?(r.add(s),this.it.add(s)):(r.remove(s),this.it.delete(s)))}return z}}),yt=(t,e,i,n)=>{n=n||{},i=null==i?{}:i;const 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},wt=(t,e)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let i,n;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(!wt(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!wt(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(t[i]!==e[i])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const r=Object.keys(t);if(n=r.length,n!==Object.keys(e).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(e,r[i]))return!1;for(i=n;0!=i--;){const n=r[i];if(!wt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e},$t="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;class At extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.cancelled=!1,this.isRepeating=!1,this.repeatCount=0,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"fixed",width:$t?"100px":"50px",height:$t?"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,(()=>{this.cancelled=!0,this.timer&&(this.stopAnimation(),clearTimeout(this.timer),this.timer=void 0,this.isRepeating&&this.repeatTimeout&&(clearInterval(this.repeatTimeout),this.isRepeating=!1))}),{passive:!0})}))}bind(t,e){t.actionHandler&&wt(e,t.actionHandler.options)||(t.actionHandler?(t.removeEventListener("touchstart",t.actionHandler.start),t.removeEventListener("touchend",t.actionHandler.end),t.removeEventListener("touchcancel",t.actionHandler.end),t.removeEventListener("mousedown",t.actionHandler.start),t.removeEventListener("click",t.actionHandler.end),t.removeEventListener("keyup",t.actionHandler.handleEnter)):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})),t.actionHandler={options:e},e.disabled||(t.actionHandler.start=i=>{let n,r;this.cancelled=!1,i.touches?(n=i.touches[0].clientX,r=i.touches[0].clientY):(n=i.clientX,r=i.clientY),e.hasHold&&(this.held=!1,this.timer=window.setTimeout((()=>{this.startAnimation(n,r),this.held=!0,e.repeat&&!this.isRepeating&&(this.repeatCount=0,this.isRepeating=!0,this.repeatTimeout=setInterval((()=>{yt(t,"action",{action:"hold"}),this.repeatCount++,this.repeatTimeout&&e.repeatLimit&&this.repeatCount>=e.repeatLimit&&(clearInterval(this.repeatTimeout),this.isRepeating=!1)}),e.repeat))}),this.holdTime))},t.actionHandler.end=t=>{if(["touchend","touchcancel"].includes(t.type)&&this.cancelled)return void(this.isRepeating&&this.repeatTimeout&&(clearInterval(this.repeatTimeout),this.isRepeating=!1));const i=t.target;t.cancelable&&t.preventDefault(),e.hasHold&&(clearTimeout(this.timer),this.isRepeating&&this.repeatTimeout&&clearInterval(this.repeatTimeout),this.isRepeating=!1,this.stopAnimation(),this.timer=void 0),e.hasHold&&this.held?e.repeat||yt(i,"action",{action:"hold"}):e.hasDoubleClick?"click"===t.type&&t.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,yt(i,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,yt(i,"action",{action:"double_tap"})):yt(i,"action",{action:"tap"})},t.actionHandler.handleEnter=t=>{13===t.keyCode&&t.currentTarget.actionHandler.end(t)},t.addEventListener("touchstart",t.actionHandler.start,{passive:!0}),t.addEventListener("touchend",t.actionHandler.end),t.addEventListener("touchcancel",t.actionHandler.end),t.addEventListener("mousedown",t.actionHandler.start,{passive:!0}),t.addEventListener("click",t.actionHandler.end),t.addEventListener("keyup",t.actionHandler.handleEnter)))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.startPress(),this.ripple.unbounded=!0}stopAnimation(){this.ripple.endPress(),this.ripple.disabled=!0,this.style.display="none"}}customElements.define("button-card-action-handler",At);const kt=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("button-card-action-handler"))return t.querySelector("button-card-action-handler");const e=document.createElement("button-card-action-handler");return t.appendChild(e),e})();i&&i.bind(t,e)},xt=dt(class extends ft{update(t,[e]){return kt(t.element,e),z}render(t){}});function St(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var i=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),i&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function Et(t){return Math.min(1,Math.max(0,t))}function Ot(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Tt(t){return t<=1?"".concat(100*Number(t),"%"):t}function Ct(t){return 1===t.length?"0"+t:String(t)}function Mt(t,e,i){t=St(t,255),e=St(e,255),i=St(i,255);var n=Math.max(t,e,i),r=Math.min(t,e,i),s=0,o=0,a=(n+r)/2;if(n===r)o=0,s=0;else{var l=n-r;switch(o=a>.5?l/(2-n-r):l/(n+r),n){case t:s=(e-i)/l+(e1&&(i-=1),i<1/6?t+6*i*(e-t):i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function Ht(t,e,i){t=St(t,255),e=St(e,255),i=St(i,255);var n=Math.max(t,e,i),r=Math.min(t,e,i),s=0,o=n,a=n-r,l=0===n?0:a/n;if(n===r)s=0;else{switch(n){case t:s=(e-i)/a+(e>16,g:(65280&t)>>8,b:255&t}}(e)),this.originalInput=e;var r=It(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(n=i.format)&&void 0!==n?n:r.format,this.gradientType=i.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},t.prototype.getLuminance=function(){var t=this.toRgb(),e=t.r/255,i=t.g/255,n=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(t){return this.a=Ot(t),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){return 0===this.toHsl().s},t.prototype.toHsv=function(){var t=Ht(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},t.prototype.toHsvString=function(){var t=Ht(this.r,this.g,this.b),e=Math.round(360*t.h),i=Math.round(100*t.s),n=Math.round(100*t.v);return 1===this.a?"hsv(".concat(e,", ").concat(i,"%, ").concat(n,"%)"):"hsva(".concat(e,", ").concat(i,"%, ").concat(n,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var t=Mt(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},t.prototype.toHslString=function(){var t=Mt(this.r,this.g,this.b),e=Math.round(360*t.h),i=Math.round(100*t.s),n=Math.round(100*t.l);return 1===this.a?"hsl(".concat(e,", ").concat(i,"%, ").concat(n,"%)"):"hsla(".concat(e,", ").concat(i,"%, ").concat(n,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(t){return void 0===t&&(t=!1),Dt(this.r,this.g,this.b,t)},t.prototype.toHexString=function(t){return void 0===t&&(t=!1),"#"+this.toHex(t)},t.prototype.toHex8=function(t){return void 0===t&&(t=!1),function(t,e,i,n,r){var s=[Ct(Math.round(t).toString(16)),Ct(Math.round(e).toString(16)),Ct(Math.round(i).toString(16)),Ct(Rt(n))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this.r,this.g,this.b,this.a,t)},t.prototype.toHex8String=function(t){return void 0===t&&(t=!1),"#"+this.toHex8(t)},t.prototype.toHexShortString=function(t){return void 0===t&&(t=!1),1===this.a?this.toHexString(t):this.toHex8String(t)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),i=Math.round(this.b);return 1===this.a?"rgb(".concat(t,", ").concat(e,", ").concat(i,")"):"rgba(".concat(t,", ").concat(e,", ").concat(i,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var t=function(t){return"".concat(Math.round(100*St(t,255)),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var t=function(t){return Math.round(100*St(t,255))};return 1===this.a?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+Dt(this.r,this.g,this.b,!1),e=0,i=Object.entries(zt);e=0;return e||!n||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex4"===t&&(i=this.toHex8String(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),"hsv"===t&&(i=this.toHsvString()),i||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.l+=e/100,i.l=Et(i.l),new t(i)},t.prototype.brighten=function(e){void 0===e&&(e=10);var i=this.toRgb();return i.r=Math.max(0,Math.min(255,i.r-Math.round(-e/100*255))),i.g=Math.max(0,Math.min(255,i.g-Math.round(-e/100*255))),i.b=Math.max(0,Math.min(255,i.b-Math.round(-e/100*255))),new t(i)},t.prototype.darken=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.l-=e/100,i.l=Et(i.l),new t(i)},t.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},t.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},t.prototype.desaturate=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.s-=e/100,i.s=Et(i.s),new t(i)},t.prototype.saturate=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.s+=e/100,i.s=Et(i.s),new t(i)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var i=this.toHsl(),n=(i.h+e)%360;return i.h=n<0?360+n:n,new t(i)},t.prototype.mix=function(e,i){void 0===i&&(i=50);var n=this.toRgb(),r=new t(e).toRgb(),s=i/100;return new t({r:(r.r-n.r)*s+n.r,g:(r.g-n.g)*s+n.g,b:(r.b-n.b)*s+n.b,a:(r.a-n.a)*s+n.a})},t.prototype.analogous=function(e,i){void 0===e&&(e=6),void 0===i&&(i=30);var n=this.toHsl(),r=360/i,s=[this];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,s.push(new t(n));return s},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){void 0===e&&(e=6);for(var i=this.toHsv(),n=i.h,r=i.s,s=i.v,o=[],a=1/e;e--;)o.push(new t({h:n,s:r,v:s})),s=(s+a)%1;return o},t.prototype.splitcomplement=function(){var e=this.toHsl(),i=e.h;return[this,new t({h:(i+72)%360,s:e.s,l:e.l}),new t({h:(i+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var i=this.toRgb(),n=new t(e).toRgb(),r=i.a+n.a*(1-i.a);return new t({r:(i.r*i.a+n.r*n.a*(1-i.a))/r,g:(i.g*i.a+n.g*n.a*(1-i.a))/r,b:(i.b*i.a+n.b*n.a*(1-i.a))/r,a:r})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var i=this.toHsl(),n=i.h,r=[this],s=360/e,o=1;oYt.includes(t,e));var Yt;const Kt=new Set(["fan","input_boolean","light","switch","group","automation","humidifier"]),Jt=["auto","auto-no-temperature"],Xt=["card","label-card"],Qt=["--ha-card-background","--card-background-color"],te="var(--primary-text-color)";function ee(t){return t.substr(0,t.indexOf("."))}function ie(t,e){const i=[];let n=e;return"var"===e.trim().substring(0,3)&&(e.split(",").forEach((t=>{const e=t.match(/var\(\s*([a-zA-Z0-9-]*)/);e&&i.push(e[1])})),i.some((e=>{const i=window.getComputedStyle(t).getPropertyValue(e);return!!i&&(n=i,!0)}))),n}function ne(...t){const e=t=>t&&"object"==typeof t;return t.reduce(((t,i)=>(Object.keys(i).forEach((n=>{const r=t[n],s=i[n];Array.isArray(r)&&Array.isArray(s)?t[n]=r.concat(...s):e(r)&&e(s)?t[n]=ne(r,s):t[n]=s})),t)),{})}function re(t,e){let i=[];return t&&t.forEach((t=>{let n=t;e&&e.forEach((e=>{e.id&&t.id&&e.id==t.id&&(n=ne(n,e))})),i.push(n)})),e&&(i=i.concat(e.filter((e=>!t||!t.find((t=>!(!t.id||!e.id)&&t.id==e.id)))))),i}function se(t,e){if(void 0===t)return!1;const i=ee(t.entity_id),n=void 0!==e?e:null==t?void 0:t.state;if(["button","event","input_button","scene"].includes(i))return n!==Zt;if(Gt(n))return!1;if("off"===n&&"alert"!==i)return!1;switch(i){case"alarm_control_panel":return"disarmed"!==n;case"alert":return"idle"!==n;case"cover":return"closed"!==n;case"device_tracker":case"person":return"not_home"!==n;case"lock":return"locked"!==n;case"media_player":return"standby"!==n;case"vacuum":return!["idle","docked","paused"].includes(n);case"plant":return"problem"===n;case"group":return["on","home","open","locked","problem"].includes(n);case"timer":return"active"===n;case"camera":return"streaming"===n}return!0}function oe(t){return Array.isArray(t)?t.reverse().reduce(((t,e)=>`var(${e}${t?`, ${t}`:""})`),void 0):`var(${t})`}function ae(t){const e=t.split(":").map(Number);return 3600*e[0]+60*e[1]+e[2]}const le=t=>t<10?`0${t}`:t;const ce=new Set(["call-service","divider","section","weblink","cast","select"]),he={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"},ue=((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,n)})` +function t(t,e,i,n){var r,s=arguments.length,a=s<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 o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)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(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(e,t))}return t}toString(){return this.cssText}}const a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,n))(e)})(t):t;var o;const l=window,c=l.trustedTypes,h=c?c.emptyScript:"",u=l.reactiveElementPolyfillSupport,d={toAttribute(t,e){switch(e){case Boolean:t=t?h: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}},f=(t,e)=>e!==t&&(e==e||t==t),m={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:f},p="finalized";class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}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=m){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)||m}static finalize(){if(this.hasOwnProperty(p))return!1;this[p]=!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(a(t))}else void 0!==t&&e.push(a(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}u(){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 n=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{i?t.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((i=>{const n=document.createElement("style"),r=e.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=i.cssText,t.appendChild(n)}))})(n,this.constructor.elementStyles),n}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=m){var n;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:d).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),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),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:d;this._$El=r,this[r]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||f)(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 _;g[p]=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:g}),(null!==(o=l.reactiveElementVersions)&&void 0!==o?o:l.reactiveElementVersions=[]).push("1.6.2");const v=window,b=v.trustedTypes,y=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,A="?"+$,x=`<${A}>`,k=document,S=()=>k.createComment(""),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,T="[ \t\n\f\r]",C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,j=/>/g,H=RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,R=/"/g,N=/^(?:script|style|textarea|title)$/i,P=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),z=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),L=new WeakMap,F=k.createTreeWalker(k,129,null,!1);function V(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==y?y.createHTML(e):e}const U=(t,e)=>{const i=t.length-1,n=[];let r,s=2===e?"":"",a=C;for(let o=0;o"===l[0]?(a=null!=r?r:C,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,i=l[1],a=void 0===l[3]?H:'"'===l[3]?R:D):a===R||a===D?a=H:a===M||a===j?a=C:(a=H,r=void 0);const u=a===H&&t[o+1].startsWith("/>")?" ":"";s+=a===C?e+x:c>=0?(n.push(i),e.slice(0,c)+w+e.slice(c)+$+u):e+$+(-2===c?(n.push(void 0),o):u)}return[V(t,s+(t[i]||"")+(2===e?"":"")),n]};class B{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,s=0;const a=t.length-1,o=this.parts,[l,c]=U(t,e);if(this.el=B.createElement(l,i),F.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=F.nextNode())&&o.length0){n.textContent=b?b.emptyScript:"";for(let i=0;iO(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==I&&E(this._$AH)?this._$AA.nextSibling.data=t:this.$(k.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:n}=t,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=B.createElement(V(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.v(i);else{const t=new q(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=L.get(t.strings);return void 0===e&&L.set(t.strings,e=new B(t)),e}T(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const r of t)n===e.length?e.push(i=new Z(this.k(S()),this.k(S()),this,this.options)):i=e[n],i._$AI(r),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=I}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const r=this.strings;let s=!1;if(void 0===r)t=W(this,t,e,0),s=!E(t)||t!==this._$AH&&t!==z,s&&(this._$AH=t);else{const n=t;let a,o;for(t=r[0],a=0;a{var n,r;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let a=s._$litPart$;if(void 0===a){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=a=new Z(e.insertBefore(S(),t),t,void 0,null!=i?i:{})}return a._$AI(t),a})(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 z}}nt.finalized=!0,nt._$litElement$=!0,null===(et=globalThis.litElementHydrateSupport)||void 0===et||et.call(globalThis,{LitElement:nt});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:nt}),(null!==(it=globalThis.litElementVersions)&&void 0!==it?it:globalThis.litElementVersions=[]).push("3.3.2");const st=(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)}};function at(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):st(t,e)}const ot=({finisher:t,descriptor:e})=>(i,n)=>{var r;if(void 0===n){const n=null!==(r=i.originalKey)&&void 0!==r?r:i.key,s=null!=e?{kind:"method",placement:"prototype",key:n,descriptor:e(i.key)}:{...i,key:n};return null!=t&&(s.finisher=function(e){t(e,n)}),s}{const r=i.constructor;void 0!==e&&Object.defineProperty(i,n,e(n)),null==t||t(r,n)}};var lt;null===(lt=window.HTMLSlotElement)||void 0===lt||lt.prototype.assignedElements;class ct{constructor(t){this.startPress=e=>{t().then((t=>{t&&t.startPress(e)}))},this.endPress=()=>{t().then((t=>{t&&t.endPress()}))},this.startFocus=()=>{t().then((t=>{t&&t.startFocus()}))},this.endFocus=()=>{t().then((t=>{t&&t.endFocus()}))},this.startHover=()=>{t().then((t=>{t&&t.startHover()}))},this.endHover=()=>{t().then((t=>{t&&t.endHover()}))}}}const ht=1,ut=2,dt=t=>(...e)=>({_$litDirective$:t,values:e});class ft{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)}}const mt="important",pt=" !"+mt,gt=dt(class extends ft{constructor(t){var e;if(super(t),t.type!==ht||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const n=t[i];return null==n?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach((t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?i.removeProperty(t):i[t]="")}));for(const n in e){const t=e[n];if(null!=t){this.ut.add(n);const e="string"==typeof t&&t.endsWith(pt);n.includes("-")||e?i.setProperty(n,e?t.slice(0,-11):t,e?mt:""):i[n]=t}}return z}});class _t extends ft{constructor(t){if(super(t),this.et=I,t.type!==ut)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===I||null==t)return this.ft=void 0,this.et=t;if(t===z)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}_t.directiveName="unsafeHTML",_t.resultType=1;const vt=dt(_t),bt=dt(class extends ft{constructor(t){var e;if(super(t),t.type!==ht||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,n;if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.nt)||void 0===i?void 0:i.has(t))&&this.it.add(t);return this.render(e)}const r=t.element.classList;this.it.forEach((t=>{t in e||(r.remove(t),this.it.delete(t))}));for(const s in e){const t=!!e[s];t===this.it.has(s)||(null===(n=this.nt)||void 0===n?void 0:n.has(s))||(t?(r.add(s),this.it.add(s)):(r.remove(s),this.it.delete(s)))}return z}}),yt=(t,e,i,n)=>{n=n||{},i=null==i?{}:i;const 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},wt=(t,e)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let i,n;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(!wt(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!wt(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(t[i]!==e[i])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const r=Object.keys(t);if(n=r.length,n!==Object.keys(e).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(e,r[i]))return!1;for(i=n;0!=i--;){const n=r[i];if(!wt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e},$t="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;class At extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.cancelled=!1,this.isRepeating=!1,this.repeatCount=0,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"fixed",width:$t?"100px":"50px",height:$t?"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,(()=>{this.cancelled=!0,this.timer&&(this.stopAnimation(),clearTimeout(this.timer),this.timer=void 0,this.isRepeating&&this.repeatTimeout&&(clearInterval(this.repeatTimeout),this.isRepeating=!1))}),{passive:!0})}))}bind(t,e){t.actionHandler&&wt(e,t.actionHandler.options)||(t.actionHandler?(t.removeEventListener("touchstart",t.actionHandler.start),t.removeEventListener("touchend",t.actionHandler.end),t.removeEventListener("touchcancel",t.actionHandler.end),t.removeEventListener("mousedown",t.actionHandler.start),t.removeEventListener("click",t.actionHandler.end),t.removeEventListener("keyup",t.actionHandler.handleEnter)):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})),t.actionHandler={options:e},e.disabled||(t.actionHandler.start=i=>{let n,r;this.cancelled=!1,i.touches?(n=i.touches[0].clientX,r=i.touches[0].clientY):(n=i.clientX,r=i.clientY),e.hasHold&&(this.held=!1,this.timer=window.setTimeout((()=>{this.startAnimation(n,r),this.held=!0,e.repeat&&!this.isRepeating&&(this.repeatCount=0,this.isRepeating=!0,this.repeatTimeout=setInterval((()=>{yt(t,"action",{action:"hold"}),this.repeatCount++,this.repeatTimeout&&e.repeatLimit&&this.repeatCount>=e.repeatLimit&&(clearInterval(this.repeatTimeout),this.isRepeating=!1)}),e.repeat))}),this.holdTime))},t.actionHandler.end=t=>{if(["touchend","touchcancel"].includes(t.type)&&this.cancelled)return void(this.isRepeating&&this.repeatTimeout&&(clearInterval(this.repeatTimeout),this.isRepeating=!1));const i=t.target;t.cancelable&&t.preventDefault(),e.hasHold&&(clearTimeout(this.timer),this.isRepeating&&this.repeatTimeout&&clearInterval(this.repeatTimeout),this.isRepeating=!1,this.stopAnimation(),this.timer=void 0),e.hasHold&&this.held?e.repeat||yt(i,"action",{action:"hold"}):e.hasDoubleClick?"click"===t.type&&t.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,yt(i,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,yt(i,"action",{action:"double_tap"})):yt(i,"action",{action:"tap"})},t.actionHandler.handleEnter=t=>{13===t.keyCode&&t.currentTarget.actionHandler.end(t)},t.addEventListener("touchstart",t.actionHandler.start,{passive:!0}),t.addEventListener("touchend",t.actionHandler.end),t.addEventListener("touchcancel",t.actionHandler.end),t.addEventListener("mousedown",t.actionHandler.start,{passive:!0}),t.addEventListener("click",t.actionHandler.end),t.addEventListener("keyup",t.actionHandler.handleEnter)))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.startPress(),this.ripple.unbounded=!0}stopAnimation(){this.ripple.endPress(),this.ripple.disabled=!0,this.style.display="none"}}customElements.define("button-card-action-handler",At);const xt=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("button-card-action-handler"))return t.querySelector("button-card-action-handler");const e=document.createElement("button-card-action-handler");return t.appendChild(e),e})();i&&i.bind(t,e)},kt=dt(class extends ft{update(t,[e]){return xt(t.element,e),z}render(t){}});function St(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var i=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),i&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function Et(t){return Math.min(1,Math.max(0,t))}function Ot(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Tt(t){return t<=1?"".concat(100*Number(t),"%"):t}function Ct(t){return 1===t.length?"0"+t:String(t)}function Mt(t,e,i){t=St(t,255),e=St(e,255),i=St(i,255);var n=Math.max(t,e,i),r=Math.min(t,e,i),s=0,a=0,o=(n+r)/2;if(n===r)a=0,s=0;else{var l=n-r;switch(a=o>.5?l/(2-n-r):l/(n+r),n){case t:s=(e-i)/l+(e1&&(i-=1),i<1/6?t+6*i*(e-t):i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function Ht(t,e,i){t=St(t,255),e=St(e,255),i=St(i,255);var n=Math.max(t,e,i),r=Math.min(t,e,i),s=0,a=n,o=n-r,l=0===n?0:o/n;if(n===r)s=0;else{switch(n){case t:s=(e-i)/o+(e>16,g:(65280&t)>>8,b:255&t}}(e)),this.originalInput=e;var r=It(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(n=i.format)&&void 0!==n?n:r.format,this.gradientType=i.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},t.prototype.getLuminance=function(){var t=this.toRgb(),e=t.r/255,i=t.g/255,n=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(t){return this.a=Ot(t),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){return 0===this.toHsl().s},t.prototype.toHsv=function(){var t=Ht(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},t.prototype.toHsvString=function(){var t=Ht(this.r,this.g,this.b),e=Math.round(360*t.h),i=Math.round(100*t.s),n=Math.round(100*t.v);return 1===this.a?"hsv(".concat(e,", ").concat(i,"%, ").concat(n,"%)"):"hsva(".concat(e,", ").concat(i,"%, ").concat(n,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var t=Mt(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},t.prototype.toHslString=function(){var t=Mt(this.r,this.g,this.b),e=Math.round(360*t.h),i=Math.round(100*t.s),n=Math.round(100*t.l);return 1===this.a?"hsl(".concat(e,", ").concat(i,"%, ").concat(n,"%)"):"hsla(".concat(e,", ").concat(i,"%, ").concat(n,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(t){return void 0===t&&(t=!1),Dt(this.r,this.g,this.b,t)},t.prototype.toHexString=function(t){return void 0===t&&(t=!1),"#"+this.toHex(t)},t.prototype.toHex8=function(t){return void 0===t&&(t=!1),function(t,e,i,n,r){var s=[Ct(Math.round(t).toString(16)),Ct(Math.round(e).toString(16)),Ct(Math.round(i).toString(16)),Ct(Rt(n))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this.r,this.g,this.b,this.a,t)},t.prototype.toHex8String=function(t){return void 0===t&&(t=!1),"#"+this.toHex8(t)},t.prototype.toHexShortString=function(t){return void 0===t&&(t=!1),1===this.a?this.toHexString(t):this.toHex8String(t)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),i=Math.round(this.b);return 1===this.a?"rgb(".concat(t,", ").concat(e,", ").concat(i,")"):"rgba(".concat(t,", ").concat(e,", ").concat(i,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var t=function(t){return"".concat(Math.round(100*St(t,255)),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var t=function(t){return Math.round(100*St(t,255))};return 1===this.a?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+Dt(this.r,this.g,this.b,!1),e=0,i=Object.entries(zt);e=0;return e||!n||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex4"===t&&(i=this.toHex8String(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),"hsv"===t&&(i=this.toHsvString()),i||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.l+=e/100,i.l=Et(i.l),new t(i)},t.prototype.brighten=function(e){void 0===e&&(e=10);var i=this.toRgb();return i.r=Math.max(0,Math.min(255,i.r-Math.round(-e/100*255))),i.g=Math.max(0,Math.min(255,i.g-Math.round(-e/100*255))),i.b=Math.max(0,Math.min(255,i.b-Math.round(-e/100*255))),new t(i)},t.prototype.darken=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.l-=e/100,i.l=Et(i.l),new t(i)},t.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},t.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},t.prototype.desaturate=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.s-=e/100,i.s=Et(i.s),new t(i)},t.prototype.saturate=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.s+=e/100,i.s=Et(i.s),new t(i)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var i=this.toHsl(),n=(i.h+e)%360;return i.h=n<0?360+n:n,new t(i)},t.prototype.mix=function(e,i){void 0===i&&(i=50);var n=this.toRgb(),r=new t(e).toRgb(),s=i/100;return new t({r:(r.r-n.r)*s+n.r,g:(r.g-n.g)*s+n.g,b:(r.b-n.b)*s+n.b,a:(r.a-n.a)*s+n.a})},t.prototype.analogous=function(e,i){void 0===e&&(e=6),void 0===i&&(i=30);var n=this.toHsl(),r=360/i,s=[this];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,s.push(new t(n));return s},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){void 0===e&&(e=6);for(var i=this.toHsv(),n=i.h,r=i.s,s=i.v,a=[],o=1/e;e--;)a.push(new t({h:n,s:r,v:s})),s=(s+o)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),i=e.h;return[this,new t({h:(i+72)%360,s:e.s,l:e.l}),new t({h:(i+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var i=this.toRgb(),n=new t(e).toRgb(),r=i.a+n.a*(1-i.a);return new t({r:(i.r*i.a+n.r*n.a*(1-i.a))/r,g:(i.g*i.a+n.g*n.a*(1-i.a))/r,b:(i.b*i.a+n.b*n.a*(1-i.a))/r,a:r})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var i=this.toHsl(),n=i.h,r=[this],s=360/e,a=1;aYt.includes(t,e));var Yt;const Kt=new Set(["fan","input_boolean","light","switch","group","automation","humidifier"]),Jt=["auto","auto-no-temperature"],Xt=["card","label-card"],Qt=["--ha-card-background","--card-background-color"],te="var(--primary-text-color)";function ee(t){return t.substr(0,t.indexOf("."))}function ie(t,e){const i=[];let n=e;return"var"===e.trim().substring(0,3)&&(e.split(",").forEach((t=>{const e=t.match(/var\(\s*([a-zA-Z0-9-]*)/);e&&i.push(e[1])})),i.some((e=>{const i=window.getComputedStyle(t).getPropertyValue(e);return!!i&&(n=i,!0)}))),n}function ne(...t){const e=t=>t&&"object"==typeof t;return t.reduce(((t,i)=>(Object.keys(i).forEach((n=>{const r=t[n],s=i[n];Array.isArray(r)&&Array.isArray(s)?t[n]=r.concat(...s):e(r)&&e(s)?t[n]=ne(r,s):t[n]=s})),t)),{})}function re(t,e){let i=[];return t&&t.forEach((t=>{let n=t;e&&e.forEach((e=>{e.id&&t.id&&e.id==t.id&&(n=ne(n,e))})),i.push(n)})),e&&(i=i.concat(e.filter((e=>!t||!t.find((t=>!(!t.id||!e.id)&&t.id==e.id)))))),i}function se(t,e){if(void 0===t)return!1;const i=ee(t.entity_id),n=void 0!==e?e:null==t?void 0:t.state;if(["button","event","input_button","scene"].includes(i))return n!==Zt;if(Gt(n))return!1;if("off"===n&&"alert"!==i)return!1;switch(i){case"alarm_control_panel":return"disarmed"!==n;case"alert":return"idle"!==n;case"cover":return"closed"!==n;case"device_tracker":case"person":return"not_home"!==n;case"lock":return"locked"!==n;case"media_player":return"standby"!==n;case"vacuum":return!["idle","docked","paused"].includes(n);case"plant":return"problem"===n;case"group":return["on","home","open","locked","problem"].includes(n);case"timer":return"active"===n;case"camera":return"streaming"===n}return!0}function ae(t){return Array.isArray(t)?t.reverse().reduce(((t,e)=>`var(${e}${t?`, ${t}`:""})`),void 0):`var(${t})`}function oe(t){const e=t.split(":").map(Number);return 3600*e[0]+60*e[1]+e[2]}const le=t=>t<10?`0${t}`:t;const ce=new Set(["call-service","divider","section","weblink","cast","select"]),he={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"},ue=((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,n)})` :host { position: relative; display: block; @@ -73,9 +73,6 @@ function t(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPro white-space: nowrap; overflow: hidden; } - #aspect-ratio { - position: relative; - } #overlay { align-items: flex-start; @@ -426,7 +423,7 @@ function t(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPro height: 100%; } } -`;var de,fe,me,pe,ge;!function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(de||(de={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(fe||(fe={})),function(t){t.local="local",t.server="server"}(me||(me={})),function(t){t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD"}(pe||(pe={})),function(t){t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday"}(ge||(ge={}));const _e=(t,e,i)=>{const n=e?(t=>{switch(t.number_format){case de.comma_decimal:return["en-US","en"];case de.decimal_comma:return["de","es","it"];case de.space_comma:return["fr","sv","cs"];case de.system:return;default:return t.language}})(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==de.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(n,be(t,i)).format(Number(t))}catch(r){return console.error(r),new Intl.NumberFormat(void 0,be(t,i)).format(Number(t))}return"string"==typeof t?t:`${((t,e=2)=>Math.round(t*10**e)/10**e)(t,null==i?void 0:i.maximumFractionDigits).toString()}${"currency"===(null==i?void 0:i.style)?` ${i.currency}`:""}`},ve=(t,e,i)=>{var n;let r=null==i?void 0:i.display_precision;return void 0!==e&&(r=e),null!=r?{maximumFractionDigits:r,minimumFractionDigits:r}:Number.isInteger(Number(null===(n=t.attributes)||void 0===n?void 0:n.step))&&Number.isInteger(Number(t.state))?{maximumFractionDigits:0}:null!=t.attributes.step?{maximumFractionDigits:Math.ceil(Math.log10(1/t.attributes.step))}:void 0},be=(t,e)=>{const i=Object.assign({maximumFractionDigits:2},e);if("string"!=typeof t)return i;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=e,i.maximumFractionDigits=e}return i};var ye,we,$e,Ae,ke;!function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(ye||(ye={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(we||(we={})),function(t){t.local="local",t.server="server"}($e||($e={})),function(t){t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD"}(Ae||(Ae={})),function(t){t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday"}(ke||(ke={}));const xe=(t,e=2)=>{let i=""+t;for(let n=1;nfunction(t){const e=Math.floor(t/1e3/3600),i=Math.floor(t/1e3%3600/60),n=Math.floor(t/1e3%3600%60),r=Math.floor(t%1e3);return e>0?`${e}:${xe(i)}:${xe(n)}`:i>0?`${i}:${xe(n)}`:n>0||r>0?`${n}${r>0?`.${xe(r,3)}`:""}`:null}(parseFloat(t)*Se[e])||"0";var Oe=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function Te(t,e){if(t.length!==e.length)return!1;for(var i=0;inew Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric",timeZone:"server"===t.time_zone?e:void 0}))),je=(t,e,i)=>He(e,i.time_zone).format(t),He=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",timeZone:"server"===t.time_zone?e:void 0}))),De=(t,e,i)=>{var n,r,s,o;const a=Re(e,i.time_zone);if(e.date_format===pe.language||e.date_format===pe.system)return a.format(t);const l=a.formatToParts(t),c=null===(n=l.find((t=>"literal"===t.type)))||void 0===n?void 0:n.value,h=null===(r=l.find((t=>"day"===t.type)))||void 0===r?void 0:r.value,u=null===(s=l.find((t=>"month"===t.type)))||void 0===s?void 0:s.value,d=null===(o=l.find((t=>"year"===t.type)))||void 0===o?void 0:o.value,f=l[l.length-1];let m="literal"===(null==f?void 0:f.type)?null==f?void 0:f.value:"";"bg"===e.language&&e.date_format===pe.YMD&&(m="");return{[pe.DMY]:`${h}${c}${u}${c}${d}${m}`,[pe.MDY]:`${u}${c}${h}${c}${d}${m}`,[pe.YMD]:`${d}${c}${u}${c}${h}${m}`}[e.date_format]},Re=Ce(((t,e)=>{const i=t.date_format===pe.system?void 0:t.language;return t.date_format===pe.language||(t.date_format,pe.system),new Intl.DateTimeFormat(i,{year:"numeric",month:"numeric",day:"numeric",timeZone:"server"===t.time_zone?e:void 0})})),Ne=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short",timeZone:"server"===t.time_zone?e:void 0}))),Pe=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:"server"===t.time_zone?e:void 0}))),ze=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",timeZone:"server"===t.time_zone?e:void 0}))),Ie=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:"server"===t.time_zone?e:void 0}))),Le=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",timeZone:"server"===t.time_zone?e:void 0}))),Fe=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:"server"===t.time_zone?e:void 0}))),Ve=Ce((t=>{if(t.time_format===fe.language||t.time_format===fe.system){const e=t.time_format===fe.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===fe.am_pm})),Ue=(t,e,i)=>Be(e,i.time_zone).format(t),Be=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{hour:"numeric",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),We=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),qe=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{weekday:"long",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Ze=Ce(((t,e)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:"server"===t.time_zone?e:void 0}))),Ge=(t,e,i)=>Ye(e,i.time_zone).format(t),Ye=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Ke=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"short",day:"numeric",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Je=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{month:"short",day:"numeric",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Xe=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Qe=(t,e)=>0!=(t.supported_features&e),ti=t=>(t=>Qe(t,4)&&"number"==typeof t.in_progress)(t)||!!t.in_progress,ei=(t,e,i,n,r,s,o)=>{const a=r[e.entity_id];return ii(t,i,n,a,e.entity_id,e.attributes,s,void 0!==o?o:e.state)},ii=(t,e,i,n,r,s,o,a)=>{var l;if("unknown"===a||"unavailable"===a)return t(`state.default.${a}`);if(function(t){return!!t.unit_of_measurement||!!t.state_class}(s)){if("duration"===s.device_class&&s.unit_of_measurement&&Se[s.unit_of_measurement])try{return Ee(a,s.unit_of_measurement)}catch(h){}if("monetary"===s.device_class)try{return _e(a,e,Object.assign({style:"currency",currency:(null==o?void 0:o.units)||s.unit_of_measurement,minimumFractionDigits:2},ve({state:a,attributes:s},null==o?void 0:o.numeric_precision,n)))}catch(h){}const t=(null==o?void 0:o.show_units)?(null==o?void 0:o.units)?null==o?void 0:o.units:s.unit_of_measurement:void 0,i=t?"%"===t?(t=>{switch(t.language){case"cz":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}})(e)+"%":` ${t}`:"";return`${_e(a,e,ve({state:a,attributes:s},null==o?void 0:o.numeric_precision,n))}${i}`}const c=ee(r);if("datetime"===c){const t=new Date(a);return Ge(t,e,i)}if(["date","input_datetime","time"].includes(c))try{const t=a.split(" ");if(2===t.length)return Ge(new Date(t.join("T")),Object.assign(Object.assign({},e),{time_zone:$e.local}),i);if(1===t.length){if(a.includes("-"))return je(new Date(`${a}T00:00`),Object.assign(Object.assign({},e),{time_zone:$e.local}),i);if(a.includes(":")){const t=new Date;return Ue(new Date(`${t.toISOString().split("T")[0]}T${a}`),Object.assign(Object.assign({},e),{time_zone:$e.local}),i)}}return a}catch(u){return a}if("counter"===c||"number"===c||"input_number"===c)return _e(a,e,ve({state:a,attributes:s},null==o?void 0:o.numeric_precision,n));if(["button","event","input_button","scene","stt","tts"].includes(c)||"sensor"===c&&"timestamp"===s.device_class)try{return Ge(new Date(a),e,i)}catch(h){return a}return"update"===c?"on"===a?ti(s)?Qe(s,4)&&"number"==typeof s.in_progress?t("ui.card.update.installing_with_progress",{progress:s.in_progress}):t("ui.card.update.installing"):s.latest_version:s.skipped_version===s.latest_version?null!==(l=s.latest_version)&&void 0!==l?l:t("state.default.unavailable"):t("ui.card.update.up_to_date"):(null==n?void 0:n.translation_key)&&t(`component.${n.platform}.entity.${c}.${n.translation_key}.state.${a}`)||s.device_class&&t(`component.${c}.entity_component.${s.device_class}.state.${a}`)||t(`component.${c}.entity_component._.state.${a}`)||a};var ni=Function.prototype.toString,ri=Object.create,si=Object.defineProperty,oi=Object.getOwnPropertyDescriptor,ai=Object.getOwnPropertyNames,li=Object.getOwnPropertySymbols,ci=Object.getPrototypeOf,hi=Object.prototype,ui=hi.hasOwnProperty,di=hi.propertyIsEnumerable,fi="function"==typeof li,mi="function"==typeof WeakMap,pi=function(){if(mi)return function(){return new WeakMap};var t=function(){function t(){this._keys=[],this._values=[]}return t.prototype.has=function(t){return!!~this._keys.indexOf(t)},t.prototype.get=function(t){return this._values[this._keys.indexOf(t)]},t.prototype.set=function(t,e){this._keys.push(t),this._values.push(e)},t}();return function(){return new t}}(),gi=function(t,e){var i=t.__proto__||ci(t);if(!i)return ri(null);var n=i.constructor;if(n===e.Object)return i===e.Object.prototype?{}:ri(i);if(~ni.call(n).indexOf("[native code]"))try{return new n}catch(hi){}return ri(i)},_i=function(t,e,i,n){var r=gi(t,e);for(var s in n.set(t,r),t)ui.call(t,s)&&(r[s]=i(t[s],n));if(fi)for(var o=li(t),a=0,l=o.length,c=void 0;a{if((void 0!==e?e:null==t?void 0:t.state)===Zt)return"var(--state-unavailable-color)";const n=Si(t,e,i);return n?oe(n):void 0},xi=(t,e,i,n)=>{const r=void 0!==i?i:e.state,s=se(e,i),o=[],a=function(t,e="_"){const i="àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;",n=`aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz${e}${e}${e}${e}${e}${e}`,r=new RegExp(i.split("").join("|"),"g");return t.toString().toLowerCase().replace(/\s+/g,e).replace(r,(t=>n.charAt(i.indexOf(t)))).replace(/&/g,`${e}and${e}`).replace(/[^\w-]+/g,"").replace(/-/g,e).replace(new RegExp(`(${e})\\1+`,"g"),"$1").replace(new RegExp(`^${e}+`),"").replace(new RegExp(`${e}+$`),"")}(r,"_"),l=s?"active":"inactive";if(n&&Xt.includes(n)&&"inactive"==l)return Qt;const c=e.attributes.device_class;return c&&o.push(`--state-${t}-${c}-${a}-color`),o.push(`--state-${t}-${a}-color`,`--state-${t}-${l}-color`,`--state-${l}-color`),o},Si=(t,e,i)=>{const n=void 0!==e?e:null==t?void 0:t.state,r=ee(t.entity_id),s=t.attributes.device_class;if("sensor"===r&&"battery"===s){const t=(t=>{const e=Number(t);if(!isNaN(e))return e>=70?"--state-sensor-battery-high-color":e>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"})(n);if(t)return[t]}if("group"===r){const n=(t=>{const e=t.attributes.entity_id||[],i=[...new Set(e.map((t=>ee(t))))];return 1===i.length?i[0]:void 0})(t);if(n&&Ai.has(n))return xi(n,t,e,i)}return Ai.has(r)?xi(r,t,e,i):i&&Xt.includes(i)?Qt:void 0};let Ei=window.cardHelpers;const Oi=new Promise((async t=>{Ei&&t(),window.loadCardHelpers&&(Ei=await window.loadCardHelpers(),window.cardHelpers=Ei,t())}));console.info("%c BUTTON-CARD \n%c Version 4.1.0-dev.2 ","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"button-card",name:"Button-Card",preview:!1,description:"A massively customizable custom button card"});let Ti=class extends nt{constructor(){super(...arguments),this._cards={},this._cardsConfig={},this._entities=[],this._initialSetupComplete=!1,this._rippleHandlers=new ct((()=>this._ripple))}get _doIHaveEverything(){return!!this._hass&&!!this._config&&this.isConnected}set hass(t){this._hass=t,Object.keys(this._cards).forEach((t=>{this._cards[t].hass=this._hass})),this._initialSetupComplete||this._finishSetup()}disconnectedCallback(){super.disconnectedCallback(),this._clearInterval()}connectedCallback(){super.connectedCallback(),this._initialSetupComplete?this._startTimerCountdown():this._finishSetup()}_evaluateVariablesSkipError(t){var e;if(this._evaledVariables={},null===(e=this._config)||void 0===e?void 0:e.variables){Object.keys(this._config.variables).sort().forEach((e=>{try{this._evaledVariables[e]=this._objectEvalTemplate(t,this._config.variables[e])}catch(_t){}}))}}_finishSetup(){if(!this._initialSetupComplete&&this._doIHaveEverything){if(this._evaluateVariablesSkipError(),this._config.entity){const t=this._getTemplateOrValue(void 0,this._config.entity);this._config.entity=t,this._stateObj=this._hass.states[t]}this._evaluateVariablesSkipError(this._stateObj),this._config.entity&&Kt.has(ee(this._config.entity))?this._config=Object.assign({tap_action:{action:"toggle"}},this._config):this._config.entity?this._config=Object.assign({tap_action:{action:"more-info"}},this._config):this._config=Object.assign({tap_action:{action:"none"}},this._config);const t=JSON.stringify(this._config);if(this._entities=[],Array.isArray(this._config.triggers_update))this._config.triggers_update.forEach((t=>{try{const e=this._getTemplateOrValue(this._stateObj,t);null==e||this._entities.includes(e)||this._entities.push(e)}catch(_t){}}));else if("string"==typeof this._config.triggers_update){const t=this._getTemplateOrValue(this._stateObj,this._config.triggers_update);t&&"all"!==t?this._entities.push(t):this._config.triggers_update=t}if("all"!==this._config.triggers_update){const e=new RegExp(/states\[\s*('|\\")([a-zA-Z0-9_]+\.[a-zA-Z0-9_]+)\1\s*\]/,"gm"),i=new RegExp(/states\[\s*('|\\")([a-zA-Z0-9_]+\.[a-zA-Z0-9_]+)\1\s*\]/,"m"),n=t.match(e);null==n||n.forEach((t=>{const e=t.match(i);e&&!this._entities.includes(e[2])&&this._entities.push(e[2])}))}this._config.entity&&!this._entities.includes(this._config.entity)&&this._entities.push(this._config.entity),this._expandTriggerGroups();const e=new RegExp("\\[\\[\\[.*\\]\\]\\]","m");this._hasTemplate=!("all"!==this._config.triggers_update||!t.match(e)),this._startTimerCountdown(),this._initialSetupComplete=!0}}_startTimerCountdown(){if(this._config&&this._config.entity&&"timer"===ee(this._config.entity)){const t=this._hass.states[this._config.entity];this._startInterval(t)}}_createCard(t){if(Ei)return Ei.createCardElement(t);{const e=((t,e=!1)=>{const i=(t,e)=>n("hui-error-card",{type:"error",error:t,config:e}),n=(t,e)=>{const n=window.document.createElement(t);try{if(!n.setConfig)return;n.setConfig(e)}catch(r){return console.error(t,r),i(r.message,e)}return n};if(!t||"object"!=typeof t||!e&&!t.type)return i("No type defined",t);let r=t.type;if(r&&r.startsWith("custom:"))r=r.substr(7);else if(e)if(ce.has(r))r=`hui-${r}-row`;else{if(!t.entity)return i("Invalid config given.",t);const e=t.entity.split(".",1)[0];r=`hui-${he[e]||"text"}-entity-row`}else r=`hui-${r}-card`;if(customElements.get(r))return n(r,t);const s=i(`Custom element doesn't exist: ${t.type}.`,t);s.style.display="None";const o=setTimeout((()=>{s.style.display=""}),2e3);return customElements.whenDefined(t.type).then((()=>{clearTimeout(o),yt(s,"ll-rebuild",{},s)})),s})(t);return Oi.then((()=>{yt(e,"ll-rebuild",{})})),e}}static get styles(){return ue}render(){var t;if(!this._config||!this._hass)return P``;this._stateObj=this._config.entity?this._hass.states[this._config.entity]:void 0;try{if(this._evaledVariables={},null===(t=this._config)||void 0===t?void 0:t.variables){Object.keys(this._config.variables).sort().forEach((t=>{this._evaledVariables[t]=this._objectEvalTemplate(this._stateObj,this._config.variables[t])}))}return this._cardHtml()}catch(_t){_t.stack?console.error(_t.stack):console.error(_t);const e=document.createElement("hui-error-card");return e.setConfig({type:"error",error:_t.toString(),origConfig:this._config}),P` ${e} `}}shouldUpdate(t){return!(!this._hasTemplate&&!t.has("_timeRemaining")&&!function(t,e){if(e.has("_config"))return!0;const i=e.get("_hass");if(i)return t._entities.some((function(e){return(null==i?void 0:i.states[e])!==t._hass.states[e]}));return!1}(this,t))&&(this._expandTriggerGroups(),!0)}updated(t){if(super.updated(t),this._config&&this._config.entity&&"timer"===ee(this._config.entity)&&t.has("_hass")){const e=this._hass.states[this._config.entity],i=t.get("_hass");(i?i.states[this._config.entity]:void 0)!==e?this._startInterval(e):e||this._clearInterval()}}_clearInterval(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}_startInterval(t){this._clearInterval(),this._calculateRemaining(t),"active"===t.state&&(this._interval=window.setInterval((()=>this._calculateRemaining(t)),1e3))}_calculateRemaining(t){t.attributes.remaining&&(this._timeRemaining=(t=>{if(!t.attributes.remaining)return;let e=ae(t.attributes.remaining);if("active"===t.state){const i=(new Date).getTime(),n=new Date(t.last_changed).getTime();e=Math.max(e-(i-n)/1e3,0)}return e})(t))}_computeTimeDisplay(t){if(t)return function(t){const e=Math.floor(t/3600),i=Math.floor(t%3600/60),n=Math.floor(t%3600%60);return e>0?`${e}:${le(i)}:${le(n)}`:i>0?`${i}:${le(n)}`:n>0?""+n:null}(this._timeRemaining||ae(t.attributes.duration))}_getMatchingConfigState(t){if(!this._config.state)return;const e=this._config.state.find((t=>"template"===t.operator));if(!t&&!e)return;let i;const n=this._config.state.find((e=>{if(!e.operator)return t&&this._getTemplateOrValue(t,e.value)==t.state;switch(e.operator){case"==":return t&&t.state==this._getTemplateOrValue(t,e.value);case"<=":return t&&t.state<=this._getTemplateOrValue(t,e.value);case"<":return t&&t.state=":return t&&t.state>=this._getTemplateOrValue(t,e.value);case">":return t&&t.state>this._getTemplateOrValue(t,e.value);case"!=":return t&&t.state!=this._getTemplateOrValue(t,e.value);case"regex":return!(!t||!t.state.match(this._getTemplateOrValue(t,e.value)));case"template":return this._getTemplateOrValue(t,e.value);case"default":return i=e,!1;default:return!1}}));return!n&&i?i:n}_localize(t,e,i,n=!0,r){var s;return ei(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,{numeric_precision:"card"===i?null===(s=this._config)||void 0===s?void 0:s.numeric_precision:i,show_units:n,units:r},e)}_relativeTime(t,e=!1){return t?P` +`;var de,fe,me,pe,ge;!function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(de||(de={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(fe||(fe={})),function(t){t.local="local",t.server="server"}(me||(me={})),function(t){t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD"}(pe||(pe={})),function(t){t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday"}(ge||(ge={}));const _e=(t,e,i)=>{const n=e?(t=>{switch(t.number_format){case de.comma_decimal:return["en-US","en"];case de.decimal_comma:return["de","es","it"];case de.space_comma:return["fr","sv","cs"];case de.system:return;default:return t.language}})(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==de.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(n,be(t,i)).format(Number(t))}catch(r){return console.error(r),new Intl.NumberFormat(void 0,be(t,i)).format(Number(t))}return"string"==typeof t?t:`${((t,e=2)=>Math.round(t*10**e)/10**e)(t,null==i?void 0:i.maximumFractionDigits).toString()}${"currency"===(null==i?void 0:i.style)?` ${i.currency}`:""}`},ve=(t,e,i)=>{var n;let r=null==i?void 0:i.display_precision;return void 0!==e&&(r=e),null!=r?{maximumFractionDigits:r,minimumFractionDigits:r}:Number.isInteger(Number(null===(n=t.attributes)||void 0===n?void 0:n.step))&&Number.isInteger(Number(t.state))?{maximumFractionDigits:0}:null!=t.attributes.step?{maximumFractionDigits:Math.ceil(Math.log10(1/t.attributes.step))}:void 0},be=(t,e)=>{const i=Object.assign({maximumFractionDigits:2},e);if("string"!=typeof t)return i;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=e,i.maximumFractionDigits=e}return i};var ye,we,$e,Ae,xe;!function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(ye||(ye={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(we||(we={})),function(t){t.local="local",t.server="server"}($e||($e={})),function(t){t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD"}(Ae||(Ae={})),function(t){t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday"}(xe||(xe={}));const ke=(t,e=2)=>{let i=""+t;for(let n=1;nfunction(t){const e=Math.floor(t/1e3/3600),i=Math.floor(t/1e3%3600/60),n=Math.floor(t/1e3%3600%60),r=Math.floor(t%1e3);return e>0?`${e}:${ke(i)}:${ke(n)}`:i>0?`${i}:${ke(n)}`:n>0||r>0?`${n}${r>0?`.${ke(r,3)}`:""}`:null}(parseFloat(t)*Se[e])||"0";var Oe=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function Te(t,e){if(t.length!==e.length)return!1;for(var i=0;inew Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric",timeZone:"server"===t.time_zone?e:void 0}))),je=(t,e,i)=>He(e,i.time_zone).format(t),He=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",timeZone:"server"===t.time_zone?e:void 0}))),De=(t,e,i)=>{var n,r,s,a;const o=Re(e,i.time_zone);if(e.date_format===pe.language||e.date_format===pe.system)return o.format(t);const l=o.formatToParts(t),c=null===(n=l.find((t=>"literal"===t.type)))||void 0===n?void 0:n.value,h=null===(r=l.find((t=>"day"===t.type)))||void 0===r?void 0:r.value,u=null===(s=l.find((t=>"month"===t.type)))||void 0===s?void 0:s.value,d=null===(a=l.find((t=>"year"===t.type)))||void 0===a?void 0:a.value,f=l[l.length-1];let m="literal"===(null==f?void 0:f.type)?null==f?void 0:f.value:"";"bg"===e.language&&e.date_format===pe.YMD&&(m="");return{[pe.DMY]:`${h}${c}${u}${c}${d}${m}`,[pe.MDY]:`${u}${c}${h}${c}${d}${m}`,[pe.YMD]:`${d}${c}${u}${c}${h}${m}`}[e.date_format]},Re=Ce(((t,e)=>{const i=t.date_format===pe.system?void 0:t.language;return t.date_format===pe.language||(t.date_format,pe.system),new Intl.DateTimeFormat(i,{year:"numeric",month:"numeric",day:"numeric",timeZone:"server"===t.time_zone?e:void 0})})),Ne=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short",timeZone:"server"===t.time_zone?e:void 0}))),Pe=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:"server"===t.time_zone?e:void 0}))),ze=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",timeZone:"server"===t.time_zone?e:void 0}))),Ie=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:"server"===t.time_zone?e:void 0}))),Le=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",timeZone:"server"===t.time_zone?e:void 0}))),Fe=Ce(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:"server"===t.time_zone?e:void 0}))),Ve=Ce((t=>{if(t.time_format===fe.language||t.time_format===fe.system){const e=t.time_format===fe.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===fe.am_pm})),Ue=(t,e,i)=>Be(e,i.time_zone).format(t),Be=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{hour:"numeric",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),We=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),qe=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{weekday:"long",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Ze=Ce(((t,e)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:"server"===t.time_zone?e:void 0}))),Ge=(t,e,i)=>Ye(e,i.time_zone).format(t),Ye=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Ke=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"short",day:"numeric",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Je=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{month:"short",day:"numeric",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Xe=Ce(((t,e)=>new Intl.DateTimeFormat("en"!==t.language||Ve(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:Ve(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:Ve(t),timeZone:"server"===t.time_zone?e:void 0}))),Qe=(t,e)=>0!=(t.supported_features&e),ti=t=>(t=>Qe(t,4)&&"number"==typeof t.in_progress)(t)||!!t.in_progress,ei=(t,e,i,n,r,s,a)=>{const o=r[e.entity_id];return ii(t,i,n,o,e.entity_id,e.attributes,s,void 0!==a?a:e.state)},ii=(t,e,i,n,r,s,a,o)=>{var l;if("unknown"===o||"unavailable"===o)return t(`state.default.${o}`);if(function(t){return!!t.unit_of_measurement||!!t.state_class}(s)){if("duration"===s.device_class&&s.unit_of_measurement&&Se[s.unit_of_measurement])try{return Ee(o,s.unit_of_measurement)}catch(h){}if("monetary"===s.device_class)try{return _e(o,e,Object.assign({style:"currency",currency:(null==a?void 0:a.units)||s.unit_of_measurement,minimumFractionDigits:2},ve({state:o,attributes:s},null==a?void 0:a.numeric_precision,n)))}catch(h){}const t=(null==a?void 0:a.show_units)?(null==a?void 0:a.units)?null==a?void 0:a.units:s.unit_of_measurement:void 0,i=t?"%"===t?(t=>{switch(t.language){case"cz":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}})(e)+"%":` ${t}`:"";return`${_e(o,e,ve({state:o,attributes:s},null==a?void 0:a.numeric_precision,n))}${i}`}const c=ee(r);if("datetime"===c){const t=new Date(o);return Ge(t,e,i)}if(["date","input_datetime","time"].includes(c))try{const t=o.split(" ");if(2===t.length)return Ge(new Date(t.join("T")),Object.assign(Object.assign({},e),{time_zone:$e.local}),i);if(1===t.length){if(o.includes("-"))return je(new Date(`${o}T00:00`),Object.assign(Object.assign({},e),{time_zone:$e.local}),i);if(o.includes(":")){const t=new Date;return Ue(new Date(`${t.toISOString().split("T")[0]}T${o}`),Object.assign(Object.assign({},e),{time_zone:$e.local}),i)}}return o}catch(u){return o}if("counter"===c||"number"===c||"input_number"===c)return _e(o,e,ve({state:o,attributes:s},null==a?void 0:a.numeric_precision,n));if(["button","event","input_button","scene","stt","tts"].includes(c)||"sensor"===c&&"timestamp"===s.device_class)try{return Ge(new Date(o),e,i)}catch(h){return o}return"update"===c?"on"===o?ti(s)?Qe(s,4)&&"number"==typeof s.in_progress?t("ui.card.update.installing_with_progress",{progress:s.in_progress}):t("ui.card.update.installing"):s.latest_version:s.skipped_version===s.latest_version?null!==(l=s.latest_version)&&void 0!==l?l:t("state.default.unavailable"):t("ui.card.update.up_to_date"):(null==n?void 0:n.translation_key)&&t(`component.${n.platform}.entity.${c}.${n.translation_key}.state.${o}`)||s.device_class&&t(`component.${c}.entity_component.${s.device_class}.state.${o}`)||t(`component.${c}.entity_component._.state.${o}`)||o};var ni=Function.prototype.toString,ri=Object.create,si=Object.defineProperty,ai=Object.getOwnPropertyDescriptor,oi=Object.getOwnPropertyNames,li=Object.getOwnPropertySymbols,ci=Object.getPrototypeOf,hi=Object.prototype,ui=hi.hasOwnProperty,di=hi.propertyIsEnumerable,fi="function"==typeof li,mi="function"==typeof WeakMap,pi=function(){if(mi)return function(){return new WeakMap};var t=function(){function t(){this._keys=[],this._values=[]}return t.prototype.has=function(t){return!!~this._keys.indexOf(t)},t.prototype.get=function(t){return this._values[this._keys.indexOf(t)]},t.prototype.set=function(t,e){this._keys.push(t),this._values.push(e)},t}();return function(){return new t}}(),gi=function(t,e){var i=t.__proto__||ci(t);if(!i)return ri(null);var n=i.constructor;if(n===e.Object)return i===e.Object.prototype?{}:ri(i);if(~ni.call(n).indexOf("[native code]"))try{return new n}catch(hi){}return ri(i)},_i=function(t,e,i,n){var r=gi(t,e);for(var s in n.set(t,r),t)ui.call(t,s)&&(r[s]=i(t[s],n));if(fi)for(var a=li(t),o=0,l=a.length,c=void 0;o{if((void 0!==e?e:null==t?void 0:t.state)===Zt)return"var(--state-unavailable-color)";const n=Si(t,e,i);return n?ae(n):void 0},ki=(t,e,i,n)=>{const r=void 0!==i?i:e.state,s=se(e,i),a=[],o=function(t,e="_"){const i="àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;",n=`aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz${e}${e}${e}${e}${e}${e}`,r=new RegExp(i.split("").join("|"),"g");return t.toString().toLowerCase().replace(/\s+/g,e).replace(r,(t=>n.charAt(i.indexOf(t)))).replace(/&/g,`${e}and${e}`).replace(/[^\w-]+/g,"").replace(/-/g,e).replace(new RegExp(`(${e})\\1+`,"g"),"$1").replace(new RegExp(`^${e}+`),"").replace(new RegExp(`${e}+$`),"")}(r,"_"),l=s?"active":"inactive";if(n&&Xt.includes(n)&&"inactive"==l)return Qt;const c=e.attributes.device_class;return c&&a.push(`--state-${t}-${c}-${o}-color`),a.push(`--state-${t}-${o}-color`,`--state-${t}-${l}-color`,`--state-${l}-color`),a},Si=(t,e,i)=>{const n=void 0!==e?e:null==t?void 0:t.state,r=ee(t.entity_id),s=t.attributes.device_class;if("sensor"===r&&"battery"===s){const t=(t=>{const e=Number(t);if(!isNaN(e))return e>=70?"--state-sensor-battery-high-color":e>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"})(n);if(t)return[t]}if("group"===r){const n=(t=>{const e=t.attributes.entity_id||[],i=[...new Set(e.map((t=>ee(t))))];return 1===i.length?i[0]:void 0})(t);if(n&&Ai.has(n))return ki(n,t,e,i)}return Ai.has(r)?ki(r,t,e,i):i&&Xt.includes(i)?Qt:void 0};let Ei=window.cardHelpers;const Oi=new Promise((async t=>{Ei&&t(),window.loadCardHelpers&&(Ei=await window.loadCardHelpers(),window.cardHelpers=Ei,t())}));console.info("%c BUTTON-CARD \n%c Version 4.1.2 ","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"button-card",name:"Button-Card",preview:!1,description:"A massively customizable custom button card"});let Ti=class extends nt{constructor(){super(...arguments),this._cards={},this._cardsConfig={},this._entities=[],this._initialSetupComplete=!1,this._rippleHandlers=new ct((()=>this._ripple))}get _doIHaveEverything(){return!!this._hass&&!!this._config&&this.isConnected}set hass(t){this._hass=t,Object.keys(this._cards).forEach((t=>{this._cards[t].hass=this._hass})),this._initialSetupComplete||this._finishSetup()}disconnectedCallback(){super.disconnectedCallback(),this._clearInterval()}connectedCallback(){super.connectedCallback(),this._initialSetupComplete?this._startTimerCountdown():this._finishSetup()}_evaluateVariablesSkipError(t){var e;if(this._evaledVariables={},null===(e=this._config)||void 0===e?void 0:e.variables){Object.keys(this._config.variables).sort().forEach((e=>{try{this._evaledVariables[e]=this._objectEvalTemplate(t,this._config.variables[e])}catch(_t){}}))}}_finishSetup(){if(!this._initialSetupComplete&&this._doIHaveEverything){if(this._evaluateVariablesSkipError(),this._config.entity){const t=this._getTemplateOrValue(void 0,this._config.entity);this._config.entity=t,this._stateObj=this._hass.states[t]}this._evaluateVariablesSkipError(this._stateObj),this._config.entity&&Kt.has(ee(this._config.entity))?this._config=Object.assign({tap_action:{action:"toggle"}},this._config):this._config.entity?this._config=Object.assign({tap_action:{action:"more-info"}},this._config):this._config=Object.assign({tap_action:{action:"none"}},this._config);const t=JSON.stringify(this._config);if(this._entities=[],Array.isArray(this._config.triggers_update))this._config.triggers_update.forEach((t=>{try{const e=this._getTemplateOrValue(this._stateObj,t);null==e||this._entities.includes(e)||this._entities.push(e)}catch(_t){}}));else if("string"==typeof this._config.triggers_update){const t=this._getTemplateOrValue(this._stateObj,this._config.triggers_update);t&&"all"!==t?this._entities.push(t):this._config.triggers_update=t}if("all"!==this._config.triggers_update){const e=new RegExp(/states\[\s*('|\\")([a-zA-Z0-9_]+\.[a-zA-Z0-9_]+)\1\s*\]/,"gm"),i=new RegExp(/states\[\s*('|\\")([a-zA-Z0-9_]+\.[a-zA-Z0-9_]+)\1\s*\]/,"m"),n=t.match(e);null==n||n.forEach((t=>{const e=t.match(i);e&&!this._entities.includes(e[2])&&this._entities.push(e[2])}))}this._config.entity&&!this._entities.includes(this._config.entity)&&this._entities.push(this._config.entity),this._expandTriggerGroups();const e=new RegExp("\\[\\[\\[.*\\]\\]\\]","m");this._hasTemplate=!("all"!==this._config.triggers_update||!t.match(e)),this._startTimerCountdown(),this._initialSetupComplete=!0}}_startTimerCountdown(){if(this._config&&this._config.entity&&"timer"===ee(this._config.entity)){const t=this._hass.states[this._config.entity];this._startInterval(t)}}_createCard(t){if(Ei)return Ei.createCardElement(t);{const e=((t,e=!1)=>{const i=(t,e)=>n("hui-error-card",{type:"error",error:t,config:e}),n=(t,e)=>{const n=window.document.createElement(t);try{if(!n.setConfig)return;n.setConfig(e)}catch(r){return console.error(t,r),i(r.message,e)}return n};if(!t||"object"!=typeof t||!e&&!t.type)return i("No type defined",t);let r=t.type;if(r&&r.startsWith("custom:"))r=r.substr(7);else if(e)if(ce.has(r))r=`hui-${r}-row`;else{if(!t.entity)return i("Invalid config given.",t);const e=t.entity.split(".",1)[0];r=`hui-${he[e]||"text"}-entity-row`}else r=`hui-${r}-card`;if(customElements.get(r))return n(r,t);const s=i(`Custom element doesn't exist: ${t.type}.`,t);s.style.display="None";const a=setTimeout((()=>{s.style.display=""}),2e3);return customElements.whenDefined(t.type).then((()=>{clearTimeout(a),yt(s,"ll-rebuild",{},s)})),s})(t);return Oi.then((()=>{yt(e,"ll-rebuild",{})})),e}}static get styles(){return ue}render(){var t;if(!this._config||!this._hass)return P``;this._stateObj=this._config.entity?this._hass.states[this._config.entity]:void 0;try{if(this._evaledVariables={},null===(t=this._config)||void 0===t?void 0:t.variables){Object.keys(this._config.variables).sort().forEach((t=>{this._evaledVariables[t]=this._objectEvalTemplate(this._stateObj,this._config.variables[t])}))}return this._cardHtml()}catch(_t){_t.stack?console.error(_t.stack):console.error(_t);const e=document.createElement("hui-error-card");return e.setConfig({type:"error",error:_t.toString(),origConfig:this._config}),P` ${e} `}}shouldUpdate(t){return!(!this._hasTemplate&&!t.has("_timeRemaining")&&!function(t,e){if(e.has("_config"))return!0;const i=e.get("_hass");if(i)return t._entities.some((function(e){return(null==i?void 0:i.states[e])!==t._hass.states[e]}));return!1}(this,t))&&(this._expandTriggerGroups(),!0)}updated(t){if(super.updated(t),this._config&&this._config.entity&&"timer"===ee(this._config.entity)&&t.has("_hass")){const e=this._hass.states[this._config.entity],i=t.get("_hass");(i?i.states[this._config.entity]:void 0)!==e?this._startInterval(e):e||this._clearInterval()}}_clearInterval(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}_startInterval(t){this._clearInterval(),this._calculateRemaining(t),"active"===t.state&&(this._interval=window.setInterval((()=>this._calculateRemaining(t)),1e3))}_calculateRemaining(t){t.attributes.remaining&&(this._timeRemaining=(t=>{if(!t.attributes.remaining)return;let e=oe(t.attributes.remaining);if("active"===t.state){const i=(new Date).getTime(),n=new Date(t.last_changed).getTime();e=Math.max(e-(i-n)/1e3,0)}return e})(t))}_computeTimeDisplay(t){if(t)return function(t){const e=Math.floor(t/3600),i=Math.floor(t%3600/60),n=Math.floor(t%3600%60);return e>0?`${e}:${le(i)}:${le(n)}`:i>0?`${i}:${le(n)}`:n>0?""+n:null}(this._timeRemaining||oe(t.attributes.duration))}_getMatchingConfigState(t){if(!this._config.state)return;const e=this._config.state.find((t=>"template"===t.operator));if(!t&&!e)return;let i;const n=this._config.state.find((e=>{if(!e.operator)return t&&this._getTemplateOrValue(t,e.value)==t.state;switch(e.operator){case"==":return t&&t.state==this._getTemplateOrValue(t,e.value);case"<=":return t&&t.state<=this._getTemplateOrValue(t,e.value);case"<":return t&&t.state=":return t&&t.state>=this._getTemplateOrValue(t,e.value);case">":return t&&t.state>this._getTemplateOrValue(t,e.value);case"!=":return t&&t.state!=this._getTemplateOrValue(t,e.value);case"regex":return!(!t||!t.state.match(this._getTemplateOrValue(t,e.value)));case"template":return this._getTemplateOrValue(t,e.value);case"default":return i=e,!1;default:return!1}}));return!n&&i?i:n}_localize(t,e,i,n=!0,r){var s;return ei(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,{numeric_precision:"card"===i?null===(s=this._config)||void 0===s?void 0:s.numeric_precision:i,show_units:n,units:r},e)}_relativeTime(t,e=!1){return t?P` - `:""}_getTemplateHelpers(){return{localize:this._localize.bind(this),formatDateTime:t=>Ge(new Date(t),this._hass.locale,this._hass.config),formatShortDateTimeWithYear:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Ke(i,n.time_zone).format(e);var e,i,n},formatShortDateTime:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Je(i,n.time_zone).format(e);var e,i,n},formatDateTimeWithSeconds:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Xe(i,n.time_zone).format(e);var e,i,n},formatDateTimeNumeric:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,`${De(e,i,n)}, ${Ue(e,i,n)}`;var e,i,n},relativeTime:this._relativeTime.bind(this),formatTime:t=>Ue(new Date(t),this._hass.locale,this._hass.config),formatTimeWithSeconds:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,We(i,n.time_zone).format(e);var e,i,n},formatTimeWeekday:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,qe(i,n.time_zone).format(e);var e,i,n},formatTime24h:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Ze(i,n.time_zone).format(e);var e,i,n},formatDateWeekdayDay:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Me(i,n.time_zone).format(e);var e,i,n},formatDate:t=>je(new Date(t),this._hass.locale,this._hass.config),formatDateNumeric:t=>De(new Date(t),this._hass.locale,this._hass.config),formatDateShort:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Ne(i,n.time_zone).format(e);var e,i,n},formatDateMonthYear:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Pe(i,n.time_zone).format(e);var e,i,n},formatDateMonth:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,ze(i,n.time_zone).format(e);var e,i,n},formatDateYear:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Ie(i,n.time_zone).format(e);var e,i,n},formatDateWeekday:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Le(i,n.time_zone).format(e);var e,i,n},formatDateWeekdayShort:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Fe(i,n.time_zone).format(e);var e,i,n}}}_evalTemplate(t,e){try{return new Function("states","entity","user","hass","variables","html","helpers",`'use strict'; ${e}`).call(this,this._hass.states,t,this._hass.user,this._hass,this._evaledVariables,P,this._getTemplateHelpers())}catch(_t){const i=e.length<=100?e.trim():`${e.trim().substring(0,98)}...`;throw _t.message=`${_t.name}: ${_t.message} in '${i}'`,_t.name="ButtonCardJSTemplateError",_t}}_objectEvalTemplate(t,e){const i=$i(e);return this._getTemplateOrValue(t,i)}_getTemplateOrValue(t,e){if(["number","boolean"].includes(typeof e))return e;if(!e)return e;if("object"==typeof e)return Object.keys(e).forEach((i=>{e[i]=this._getTemplateOrValue(t,e[i])})),e;const i=e.trim();return"[[["===i.substring(0,3)&&"]]]"===i.slice(-3)?this._evalTemplate(t,i.slice(3,-3)):e}_getColorForLightEntity(t,e,i){let n=te;return Xt.includes(n)&&(n=oe(Qt)),t&&(se(t)?(n=t.attributes.rgb_color?`rgb(${t.attributes.rgb_color.join(",")})`:e&&t.attributes.color_temp&&t.attributes.min_mireds&&t.attributes.max_mireds?function(t,e,i){const n=new Wt("rgb(255, 160, 0)"),r=new Wt("rgb(166, 209, 255)"),s=new Wt("white"),o=(t-e)/(i-e)*100;return o<50?qt(r).mix(s,2*o).toRgbString():qt(s).mix(n,2*(o-50)).toRgbString()}(t.attributes.color_temp,t.attributes.min_mireds,t.attributes.max_mireds):ki(t,t.state,i)||te,t.attributes.brightness&&(n=function(t,e,i){const n=new Wt(ie(t,e));if(n.isValid){const t=n.mix("black",100-i).toString();if(t)return t}return e}(this,n,(t.attributes.brightness+245)/5))):n=ki(t,t.state,i)||te),n}_buildCssColorAttribute(t,e){var i,n;let r,s="";return(null==e?void 0:e.color)?s=e.color:this._config.color&&(s=this._config.color),Jt.includes(s)&&(!t||t&&"light"===ee(t.entity_id))&&(s=""),r=Jt.includes(s)?this._getColorForLightEntity(t,"auto-no-temperature"!==s,null===(i=this._config)||void 0===i?void 0:i.color_type):s||(t&&ki(t,t.state,null===(n=this._config)||void 0===n?void 0:n.color_type)||te),r}_buildIcon(t,e){if(!this._config.show_icon)return;let i;if(null==e?void 0:e.icon)i=e.icon;else{if(!this._config.icon)return;i=this._config.icon}return this._getTemplateOrValue(t,i)}_buildEntityPicture(t,e){if(!this._config.show_entity_picture||!t&&!e&&!this._config.entity_picture)return;let i;return(null==e?void 0:e.entity_picture)?i=e.entity_picture:this._config.entity_picture?i=this._config.entity_picture:t&&(i=t.attributes&&t.attributes.entity_picture?t.attributes.entity_picture:void 0),this._getTemplateOrValue(t,i)}_buildStyleGeneric(t,e,i){var n,r;let s={};if((null===(n=this._config.styles)||void 0===n?void 0:n[i])&&(s=Object.assign(s,...this._config.styles[i])),null===(r=null==e?void 0:e.styles)||void 0===r?void 0:r[i]){let t={};t=Object.assign(t,...e.styles[i]),s=Object.assign(Object.assign({},s),t)}return Object.keys(s).forEach((e=>{s[e]=this._getTemplateOrValue(t,s[e])})),s}_buildCustomStyleGeneric(t,e,i){var n,r,s,o;let a={};if((null===(r=null===(n=this._config.styles)||void 0===n?void 0:n.custom_fields)||void 0===r?void 0:r[i])&&(a=Object.assign(a,...this._config.styles.custom_fields[i])),null===(o=null===(s=null==e?void 0:e.styles)||void 0===s?void 0:s.custom_fields)||void 0===o?void 0:o[i]){let t={};t=Object.assign(t,...e.styles.custom_fields[i]),a=Object.assign(Object.assign({},a),t)}return Object.keys(a).forEach((e=>{a[e]=this._getTemplateOrValue(t,a[e])})),a}_buildName(t,e){if(!1===this._config.show_name)return;let i;var n;return(null==e?void 0:e.name)?i=e.name:this._config.name?i=this._config.name:t&&(i=t.attributes&&t.attributes.friendly_name?t.attributes.friendly_name:(n=t.entity_id).substr(n.indexOf(".")+1)),this._getTemplateOrValue(t,i)}_buildStateString(t){let e;return this._config.show_state&&t&&t.state&&("timer"===ee(t.entity_id)?"idle"===t.state||0===this._timeRemaining?e=ei(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config):(e=this._computeTimeDisplay(t),"paused"===t.state&&(e+=` (${ei(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config)})`)):e=ei(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config)),e}_buildLastChanged(t,e){return this._config.show_last_changed&&t?P` + `:""}_getTemplateHelpers(){return{localize:this._localize.bind(this),formatDateTime:t=>Ge(new Date(t),this._hass.locale,this._hass.config),formatShortDateTimeWithYear:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Ke(i,n.time_zone).format(e);var e,i,n},formatShortDateTime:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Je(i,n.time_zone).format(e);var e,i,n},formatDateTimeWithSeconds:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Xe(i,n.time_zone).format(e);var e,i,n},formatDateTimeNumeric:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,`${De(e,i,n)}, ${Ue(e,i,n)}`;var e,i,n},relativeTime:this._relativeTime.bind(this),formatTime:t=>Ue(new Date(t),this._hass.locale,this._hass.config),formatTimeWithSeconds:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,We(i,n.time_zone).format(e);var e,i,n},formatTimeWeekday:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,qe(i,n.time_zone).format(e);var e,i,n},formatTime24h:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Ze(i,n.time_zone).format(e);var e,i,n},formatDateWeekdayDay:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Me(i,n.time_zone).format(e);var e,i,n},formatDate:t=>je(new Date(t),this._hass.locale,this._hass.config),formatDateNumeric:t=>De(new Date(t),this._hass.locale,this._hass.config),formatDateShort:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Ne(i,n.time_zone).format(e);var e,i,n},formatDateMonthYear:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Pe(i,n.time_zone).format(e);var e,i,n},formatDateMonth:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,ze(i,n.time_zone).format(e);var e,i,n},formatDateYear:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Ie(i,n.time_zone).format(e);var e,i,n},formatDateWeekday:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Le(i,n.time_zone).format(e);var e,i,n},formatDateWeekdayShort:t=>{return e=new Date(t),i=this._hass.locale,n=this._hass.config,Fe(i,n.time_zone).format(e);var e,i,n}}}_evalTemplate(t,e){try{return new Function("states","entity","user","hass","variables","html","helpers",`'use strict'; ${e}`).call(this,this._hass.states,t,this._hass.user,this._hass,this._evaledVariables,P,this._getTemplateHelpers())}catch(_t){const i=e.length<=100?e.trim():`${e.trim().substring(0,98)}...`;throw _t.message=`${_t.name}: ${_t.message} in '${i}'`,_t.name="ButtonCardJSTemplateError",_t}}_objectEvalTemplate(t,e){const i=$i(e);return this._getTemplateOrValue(t,i)}_getTemplateOrValue(t,e){if(["number","boolean"].includes(typeof e))return e;if(!e)return e;if("object"==typeof e)return Object.keys(e).forEach((i=>{e[i]=this._getTemplateOrValue(t,e[i])})),e;const i=e.trim();return"[[["===i.substring(0,3)&&"]]]"===i.slice(-3)?this._evalTemplate(t,i.slice(3,-3)):e}_getColorForLightEntity(t,e,i){let n=te;return Xt.includes(n)&&(n=ae(Qt)),t&&(se(t)?(n=t.attributes.rgb_color?`rgb(${t.attributes.rgb_color.join(",")})`:e&&t.attributes.color_temp&&t.attributes.min_mireds&&t.attributes.max_mireds?function(t,e,i){const n=new Wt("rgb(255, 160, 0)"),r=new Wt("rgb(166, 209, 255)"),s=new Wt("white"),a=(t-e)/(i-e)*100;return a<50?qt(r).mix(s,2*a).toRgbString():qt(s).mix(n,2*(a-50)).toRgbString()}(t.attributes.color_temp,t.attributes.min_mireds,t.attributes.max_mireds):xi(t,t.state,i)||te,t.attributes.brightness&&(n=function(t,e,i){const n=new Wt(ie(t,e));if(n.isValid){const t=n.mix("black",100-i).toString();if(t)return t}return e}(this,n,(t.attributes.brightness+245)/5))):n=xi(t,t.state,i)||te),n}_buildCssColorAttribute(t,e){var i,n;let r,s="";return(null==e?void 0:e.color)?s=e.color:this._config.color&&(s=this._config.color),Jt.includes(s)&&(!t||t&&"light"!==ee(t.entity_id))&&(s=""),r=Jt.includes(s)?this._getColorForLightEntity(t,"auto-no-temperature"!==s,null===(i=this._config)||void 0===i?void 0:i.color_type):s||(t&&xi(t,t.state,null===(n=this._config)||void 0===n?void 0:n.color_type)||te),r}_buildIcon(t,e){if(!this._config.show_icon)return;let i;if(null==e?void 0:e.icon)i=e.icon;else{if(!this._config.icon)return;i=this._config.icon}return this._getTemplateOrValue(t,i)}_buildEntityPicture(t,e){if(!this._config.show_entity_picture||!t&&!e&&!this._config.entity_picture)return;let i;return(null==e?void 0:e.entity_picture)?i=e.entity_picture:this._config.entity_picture?i=this._config.entity_picture:t&&(i=t.attributes&&t.attributes.entity_picture?t.attributes.entity_picture:void 0),this._getTemplateOrValue(t,i)}_buildStyleGeneric(t,e,i){var n,r;let s={};if((null===(n=this._config.styles)||void 0===n?void 0:n[i])&&(s=Object.assign(s,...this._config.styles[i])),null===(r=null==e?void 0:e.styles)||void 0===r?void 0:r[i]){let t={};t=Object.assign(t,...e.styles[i]),s=Object.assign(Object.assign({},s),t)}return Object.keys(s).forEach((e=>{s[e]=this._getTemplateOrValue(t,s[e])})),s}_buildCustomStyleGeneric(t,e,i){var n,r,s,a;let o={};if((null===(r=null===(n=this._config.styles)||void 0===n?void 0:n.custom_fields)||void 0===r?void 0:r[i])&&(o=Object.assign(o,...this._config.styles.custom_fields[i])),null===(a=null===(s=null==e?void 0:e.styles)||void 0===s?void 0:s.custom_fields)||void 0===a?void 0:a[i]){let t={};t=Object.assign(t,...e.styles.custom_fields[i]),o=Object.assign(Object.assign({},o),t)}return Object.keys(o).forEach((e=>{o[e]=this._getTemplateOrValue(t,o[e])})),o}_buildName(t,e){if(!1===this._config.show_name)return;let i;var n;return(null==e?void 0:e.name)?i=e.name:this._config.name?i=this._config.name:t&&(i=t.attributes&&t.attributes.friendly_name?t.attributes.friendly_name:(n=t.entity_id).substr(n.indexOf(".")+1)),this._getTemplateOrValue(t,i)}_buildStateString(t){let e;return this._config.show_state&&t&&t.state&&("timer"===ee(t.entity_id)?"idle"===t.state||0===this._timeRemaining?e=ei(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config):(e=this._computeTimeDisplay(t),"paused"===t.state&&(e+=` (${ei(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config)})`)):e=ei(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config)),e}_buildLastChanged(t,e){return this._config.show_last_changed&&t?P` {const i=this._config.custom_fields[e];i.card?i.do_not_eval?r[e]=$i(i.card):r[e]=this._objectEvalTemplate(t,i.card):n[e]=this._getTemplateOrValue(t,i)})),(null==e?void 0:e.custom_fields)&&Object.keys(e.custom_fields).forEach((i=>{const s=e.custom_fields[i];s.card?s.do_not_eval?r[i]=$i(s.card):r[i]=this._objectEvalTemplate(t,s.card):n[i]=this._getTemplateOrValue(t,s)})),Object.keys(n).forEach((r=>{if(null!=n[r]){const s=Object.assign(Object.assign({},this._buildCustomStyleGeneric(t,e,r)),{"grid-area":r});i=P` ${i}
${this._unsafeHTMLorNot(n[r])}
- `}})),Object.keys(r).forEach((n=>{if(null!=r[n]){const s=Object.assign(Object.assign({},this._buildCustomStyleGeneric(t,e,n)),{"grid-area":n});let o;wt(this._cardsConfig[n],r[n])?o=this._cards[n]:(o=this._createCard(r[n]),this._cards[n]=o,this._cardsConfig[n]=$i(r[n])),o.hass=this._hass,i=P` + `}})),Object.keys(r).forEach((n=>{if(null!=r[n]){const s=Object.assign(Object.assign({},this._buildCustomStyleGeneric(t,e,n)),{"grid-area":n});let a;wt(this._cardsConfig[n],r[n])?a=this._cards[n]:(a=this._createCard(r[n]),this._cards[n]=a,this._cardsConfig[n]=$i(r[n])),a.hass=this._hass,i=P` ${i}
- ${o} + ${a}
- `}})),i}_isClickable(t,e){let i=!0;const n=this._getTemplateOrValue(t,this._config.tap_action.action),r=this._getTemplateOrValue(t,this._config.hold_action.action),s=this._getTemplateOrValue(t,this._config.double_tap_action.action);let o=!1;return this._config.custom_fields&&(o=Object.keys(this._config.custom_fields).some((t=>!!this._config.custom_fields[t].card))),!o&&e&&e.custom_fields?Object.keys(e.custom_fields).some((t=>!!e.custom_fields[t].card)):(i=!("none"==n&&"none"==r&&"none"==s&&!o),i)}_rotate(t){return!!(null==t?void 0:t.spin)}_blankCardColoredHtml(t){const e=Object.assign({background:"none","box-shadow":"none","border-style":"none"},t);return P` + `}})),i}_hasChildCards(t){return!!t&&Object.keys(t).some((e=>!!t[e].card))}_isClickable(t,e){const i=this._getTemplateOrValue(t,this._config.tap_action.action),n=this._getTemplateOrValue(t,this._config.hold_action.action),r=this._getTemplateOrValue(t,this._config.double_tap_action.action),s=this._hasChildCards(this._config.custom_fields)||!(!e||!this._hasChildCards(e.custom_fields));return"none"!=i||"none"!=n||"none"!=r||s}_rotate(t){return!!(null==t?void 0:t.spin)}_blankCardColoredHtml(t){const e=Object.assign({background:"none","box-shadow":"none","border-style":"none"},t);return P`
- `}_cardHtml(){var t,e,i,n;const r=this._getMatchingConfigState(this._stateObj);let s="var(--state-inactive-color)";(null==r?void 0:r.color)&&!Jt.includes(r.color)?s=r.color:(null===(t=this._config)||void 0===t?void 0:t.color)&&!Jt.includes(this._config.color)?this._stateObj?se(this._stateObj)&&(s=(null===(e=this._config)||void 0===e?void 0:e.color)||s):s=this._config.color:s=this._buildCssColorAttribute(this._stateObj,r);let o=s,a={},l={};const c={},h=this._buildStyleGeneric(this._stateObj,r,"lock"),u=this._buildStyleGeneric(this._stateObj,r,"card"),d=this._buildStyleGeneric(this._stateObj,r,"tooltip"),f={"button-card-main":!0,disabled:!this._isClickable(this._stateObj,r)};switch((null===(i=this._config)||void 0===i?void 0:i.tooltip)&&this.classList.add("tooltip"),u.width&&(this.style.setProperty("flex","0 0 auto"),this.style.setProperty("max-width","fit-content")),this._config.color_type){case"blank-card":return this._blankCardColoredHtml(u);case"card":case"label-card":{const t=function(t,e){const i=new Wt(ie(t,e)).getLuminance(),n=new Wt({r:225,g:225,b:225}),r=n.getLuminance(),s=new Wt({r:28,g:28,b:28}),o=s.getLuminance();return 0===i||(Math.max(i,r)+.05)/Math.min(i,r+.05)>(Math.max(i,o)+.05)/Math.min(i,o+.05)?n.toRgbString():s.toRgbString()}(this,s);a.color=t,l.color=t,a["background-color"]=s,a=Object.assign(Object.assign({},a),u),o="inherit";break}default:a=u}this._config.aspect_ratio?(c["--aspect-ratio"]=this._config.aspect_ratio,a.position="absolute"):c.display="inline",this.style.setProperty("--button-card-light-color",this._getColorForLightEntity(this._stateObj,!0)),this.style.setProperty("--button-card-light-color-no-temperature",this._getColorForLightEntity(this._stateObj,!1)),l=Object.assign(Object.assign({},l),h);const m=this._config.extra_styles?P` + `}_cardHtml(){var t,e,i,n;const r=this._getMatchingConfigState(this._stateObj);let s="var(--state-inactive-color)";(null==r?void 0:r.color)&&!Jt.includes(r.color)?s=r.color:(null===(t=this._config)||void 0===t?void 0:t.color)&&!Jt.includes(this._config.color)?this._stateObj?se(this._stateObj)&&(s=(null===(e=this._config)||void 0===e?void 0:e.color)||s):s=this._config.color:s=this._buildCssColorAttribute(this._stateObj,r);let a=s,o={},l={};const c={},h=this._buildStyleGeneric(this._stateObj,r,"lock"),u=this._buildStyleGeneric(this._stateObj,r,"card"),d=this._buildStyleGeneric(this._stateObj,r,"tooltip"),f={"button-card-main":!0,disabled:!this._isClickable(this._stateObj,r)};switch((null===(i=this._config)||void 0===i?void 0:i.tooltip)&&this.classList.add("tooltip"),u.width&&(this.style.setProperty("flex","0 0 auto"),this.style.setProperty("max-width","fit-content")),this._config.color_type){case"blank-card":return this._blankCardColoredHtml(u);case"card":case"label-card":{const t=function(t,e){const i=new Wt(ie(t,e)).getLuminance(),n=new Wt({r:225,g:225,b:225}),r=n.getLuminance(),s=new Wt({r:28,g:28,b:28}),a=s.getLuminance();return 0===i||(Math.max(i,r)+.05)/Math.min(i,r+.05)>(Math.max(i,a)+.05)/Math.min(i,a+.05)?n.toRgbString():s.toRgbString()}(this,s);o.color=t,l.color=t,o["background-color"]=s,o=Object.assign(Object.assign({},o),u),a="inherit";break}default:o=u}this._config.aspect_ratio?(c["--aspect-ratio"]=this._config.aspect_ratio,o.position="absolute"):c.display="inline",this.style.setProperty("--button-card-light-color",this._getColorForLightEntity(this._stateObj,!0)),this.style.setProperty("--button-card-light-color-no-temperature",this._getColorForLightEntity(this._stateObj,!1)),l=Object.assign(Object.assign({},l),h);const m=this._config.extra_styles?P` @@ -474,7 +471,7 @@ function t(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPro - ${this._buttonContent(this._stateObj,r,o)} + ${this._buttonContent(this._stateObj,r,a)} ${this._getLock(l)} @@ -501,14 +498,14 @@ function t(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPro id="overlay" style=${gt(t)} @action=${this._handleUnlockType} - .actionHandler=${xt({hasDoubleClick:"double_tap"===this._config.lock.unlock,hasHold:"hold"===this._config.lock.unlock})} + .actionHandler=${kt({hasDoubleClick:"double_tap"===this._config.lock.unlock,hasHold:"hold"===this._config.lock.unlock})} .config="${this._config}" > - `:P``}_buttonContent(t,e,i){const n=this._buildName(t,e),r=(null==e?void 0:e.state_display)||this._config.state_display||void 0,s=this._config.show_state&&r?this._getTemplateOrValue(t,r):void 0,o=s||this._buildStateString(t),a=function(t,e){if(!t&&!e)return;let i;return i=e?t?`${t}: ${e}`:e:t,i}(n,o);switch(this._config.layout){case"icon_name_state":case"name_state":return this._gridHtml(t,e,this._config.layout,i,a,void 0);default:return this._gridHtml(t,e,this._config.layout,i,n,o)}}_unsafeHTMLorNot(t){return t.strings||t.values?t:vt(`${t}`)}_gridHtml(t,e,i,n,r,s){const o=this._getIconHtml(t,e,n),a=[i],l=this._buildLabel(t,e),c=this._buildStyleGeneric(t,e,"name"),h=this._buildStyleGeneric(t,e,"state"),u=this._buildStyleGeneric(t,e,"label"),d=this._buildLastChanged(t,u),f=this._buildStyleGeneric(t,e,"grid");return o||a.push("no-icon"),r||a.push("no-name"),s||a.push("no-state"),l||d||a.push("no-label"),P` -
- ${o||""} + `:P``}_buttonContent(t,e,i){const n=this._buildName(t,e),r=(null==e?void 0:e.state_display)||this._config.state_display||void 0,s=this._config.show_state&&r?this._getTemplateOrValue(t,r):void 0,a=s||this._buildStateString(t),o=function(t,e){if(!t&&!e)return;let i;return i=e?t?`${t}: ${e}`:e:t,i}(n,a);switch(this._config.layout){case"icon_name_state":case"name_state":return this._gridHtml(t,e,this._config.layout,i,o,void 0);default:return this._gridHtml(t,e,this._config.layout,i,n,a)}}_unsafeHTMLorNot(t){return t.strings||t.values?t:vt(`${t}`)}_gridHtml(t,e,i,n,r,s){const a=this._getIconHtml(t,e,n),o=[i],l=this._buildLabel(t,e),c=this._buildStyleGeneric(t,e,"name"),h=this._buildStyleGeneric(t,e,"state"),u=this._buildStyleGeneric(t,e,"label"),d=this._buildLastChanged(t,u),f=this._buildStyleGeneric(t,e,"grid");return a||o.push("no-icon"),r||o.push("no-name"),s||o.push("no-state"),l||d||o.push("no-label"),P` +
+ ${a||""} ${r?P`
${this._unsafeHTMLorNot(r)} @@ -526,11 +523,13 @@ function t(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPro `:""} ${d||""} ${this._buildCustomFields(t,e)}
- `}_getIconHtml(t,e,i){const n=this._buildIcon(t,e),r=this._buildEntityPicture(t,e),s=this._buildStyleGeneric(t,e,"entity_picture"),o=this._buildStyleGeneric(t,e,"icon"),a=this._buildStyleGeneric(t,e,"img_cell"),l=this._buildStyleGeneric(t,e,"card"),c=Object.assign({color:i,width:this._config.size,"--ha-icon-display":l.height?"inline":void 0,position:this._config.aspect_ratio||l.height?"absolute":"relative"},o),h=Object.assign(Object.assign({},c),s),u=this._buildLiveStream(h),d=this._config.show_icon&&(n||t);if(d||r){let i;return t&&(i=ee(t.entity_id)),P` -
+ `}_getIconHtml(t,e,i){const n=this._buildIcon(t,e),r=this._buildEntityPicture(t,e),s=this._buildStyleGeneric(t,e,"entity_picture"),a=this._buildStyleGeneric(t,e,"icon"),o=this._buildStyleGeneric(t,e,"img_cell"),l=this._buildStyleGeneric(t,e,"card"),c=Object.assign({color:i,width:this._config.size,"--ha-icon-display":l.height?"inline":void 0,position:this._config.aspect_ratio||l.height?"absolute":"relative"},a),h=Object.assign(Object.assign({},c),s),u=this._buildLiveStream(h),d=this._config.show_icon&&(n||t);if(d||r){let i;return t&&(i=ee(t.entity_id)),P` +
${!d||r||u?"":P` null!=t?t:I)(null==t?void 0:t.state)} style=${gt(c)} @@ -557,4 +556,4 @@ function t(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPro cameraView="live" style=${gt(t)} > - `:void 0}_configFromLLTemplates(t,e){const i=e.template;if(!i)return e;let n,r={};const s=i&&Array.isArray(i)?i:[i];return null==s||s.forEach((e=>{var i;if(!(null===(i=t.config.button_card_templates)||void 0===i?void 0:i[e]))throw new Error(`Button-card template '${e}' is missing!`);const s=this._configFromLLTemplates(t,t.config.button_card_templates[e]);r=ne(r,s),n=re(n,s.state)})),r=ne(r,e),r.state=re(n,e.state),r}setConfig(t){if(!t)throw new Error("Invalid configuration");this._initialSetupComplete&&(this._initialSetupComplete=!1),this._cards={},this._cardsConfig={};const e=function(){let t=document.querySelector("home-assistant");if(t=t&&t.shadowRoot,t=t&&t.querySelector("home-assistant-main"),t=t&&t.shadowRoot,t=t&&t.querySelector("app-drawer-layout partial-panel-resolver, ha-drawer partial-panel-resolver"),t=t&&t.shadowRoot||t,t=t&&t.querySelector("ha-panel-lovelace"),t=t&&t.shadowRoot,t=t&&t.querySelector("hui-root"),t){const e=t.lovelace;return e.current_view=t.___curView,e}return null}()||function(){let t=document.querySelector("hc-main");if(t=t&&t.shadowRoot,t=t&&t.querySelector("hc-lovelace"),t=t&&t.shadowRoot,t=t&&(t.querySelector("hui-view")||t.querySelector("hui-panel-view")),t){const e=t.lovelace;return e.current_view=t.___curView,e}return null}();let i=$i(t);i=this._configFromLLTemplates(e,i),this._config=Object.assign(Object.assign({type:"custom:button-card",group_expand:!1,hold_action:{action:"none"},double_tap_action:{action:"none"},layout:"vertical",size:"40%",color_type:"icon",show_name:!0,show_state:!1,show_icon:!0,show_units:!0,show_label:!1,show_entity_picture:!1,show_live_stream:!1,card_size:3},i),{lock:Object.assign({enabled:!1,duration:5,unlock:"tap"},i.lock)}),this._initialSetupComplete||this._finishSetup()}_loopGroup(t){t&&t.forEach((t=>{var e,i;(null===(e=this._hass)||void 0===e?void 0:e.states[t])&&((null===(i=this._hass.states[t].attributes)||void 0===i?void 0:i.entity_id)?this._loopGroup(this._hass.states[t].attributes.entity_id):this._entities.includes(t)||this._entities.push(t))}))}_expandTriggerGroups(){var t;this._hass&&(null===(t=this._config)||void 0===t?void 0:t.group_expand)&&this._entities&&this._entities.forEach((t=>{var e,i,n,r,s;(null===(n=null===(i=null===(e=this._hass)||void 0===e?void 0:e.states[t])||void 0===i?void 0:i.attributes)||void 0===n?void 0:n.entity_id)&&this._loopGroup(null===(s=null===(r=this._hass)||void 0===r?void 0:r.states[t].attributes)||void 0===s?void 0:s.entity_id)}))}getCardSize(){var t;return(null===(t=this._config)||void 0===t?void 0:t.card_size)||3}_evalActions(t,e){var i,n,r,s,o;const a=$i(t),l=t=>t?(Object.keys(t).forEach((e=>{"object"==typeof t[e]?t[e]=l(t[e]):t[e]=this._getTemplateOrValue(this._stateObj,t[e])})),t):t;return"entity"===(null===(n=null===(i=a[e])||void 0===i?void 0:i.service_data)||void 0===n?void 0:n.entity_id)&&(a[e].service_data.entity_id=t.entity),"entity"===(null===(s=null===(r=a[e])||void 0===r?void 0:r.data)||void 0===s?void 0:s.entity_id)&&(a[e].data.entity_id=t.entity),a[e]=l(a[e]),!a[e].confirmation&&a.confirmation&&(a[e].confirmation=l(a.confirmation)),(null===(o=a[e])||void 0===o?void 0:o.entity)&&(a.entity=a[e].entity),a}handleRippleActivate(t){this._ripple.then((e=>e&&"function"==typeof e.startPress&&this._rippleHandlers.startPress(t)))}handleRippleDeactivate(){this._ripple.then((t=>t&&"function"==typeof t.endPress&&this._rippleHandlers.endPress()))}handleRippleFocus(){this._ripple.then((t=>t&&"function"==typeof t.startFocus&&this._rippleHandlers.startFocus()))}handleRippleBlur(){this._ripple.then((t=>t&&"function"==typeof t.endFocus&&this._rippleHandlers.endFocus()))}_handleAction(t){var e;if(null===(e=t.detail)||void 0===e?void 0:e.action)switch(t.detail.action){case"tap":case"hold":case"double_tap":const e=this._config;if(!e)return;const i=t.detail.action,n=this._evalActions(e,`${i}_action`);(async(t,e,i,n)=>{yt(t,"hass-action",{config:i,action:n})})(this,this._hass,n,i)}}_handleUnlockType(t){const e=this._config;e&&e.lock.unlock===t.detail.action&&this._handleLock()}_handleLock(){var t;const e=this.shadowRoot.getElementById("lock");if(!e)return;if(this._config.lock.exemptions){if(!(null===(t=this._hass.user)||void 0===t?void 0:t.name)||!this._hass.user.id)return;let i=!1;if(this._config.lock.exemptions.forEach((t=>{var e,n;(!i&&t.user===(null===(e=this._hass.user)||void 0===e?void 0:e.id)||t.username===(null===(n=this._hass.user)||void 0===n?void 0:n.name))&&(i=!0)})),!i)return e.classList.add("invalid"),void window.setTimeout((()=>{e&&e.classList.remove("invalid")}),3e3)}const i=this.shadowRoot.getElementById("overlay");if(i.style.setProperty("pointer-events","none"),e){const t=document.createAttribute("icon");t.value="mdi:lock-open-outline",e.attributes.setNamedItem(t),e.classList.add("hidden")}window.setTimeout((()=>{if(i.style.setProperty("pointer-events",""),e){e.classList.remove("hidden");const t=document.createAttribute("icon");t.value="mdi:lock-outline",e.attributes.setNamedItem(t)}}),1e3*this._config.lock.duration)}_stopPropagation(t){t.stopPropagation()}};t([ot()],Ti.prototype,"_hass",void 0),t([ot()],Ti.prototype,"_config",void 0),t([ot()],Ti.prototype,"_timeRemaining",void 0),t([function(t){return at({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})})}("mwc-ripple")],Ti.prototype,"_ripple",void 0),t([function(t){return at({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}({passive:!0})],Ti.prototype,"handleRippleActivate",null),Ti=t([(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))("button-card")],Ti); + `:void 0}_configFromLLTemplates(t,e){const i=e.template;if(!i)return e;let n,r={};const s=i&&Array.isArray(i)?i:[i];return null==s||s.forEach((e=>{var i;if(!(null===(i=t.config.button_card_templates)||void 0===i?void 0:i[e]))throw new Error(`Button-card template '${e}' is missing!`);const s=this._configFromLLTemplates(t,t.config.button_card_templates[e]);r=ne(r,s),n=re(n,s.state)})),r=ne(r,e),r.state=re(n,e.state),r}setConfig(t){if(!t)throw new Error("Invalid configuration");this._initialSetupComplete&&(this._initialSetupComplete=!1),this._cards={},this._cardsConfig={};const e=function(){let t=document.querySelector("home-assistant");if(t=t&&t.shadowRoot,t=t&&t.querySelector("home-assistant-main"),t=t&&t.shadowRoot,t=t&&t.querySelector("app-drawer-layout partial-panel-resolver, ha-drawer partial-panel-resolver"),t=t&&t.shadowRoot||t,t=t&&t.querySelector("ha-panel-lovelace"),t=t&&t.shadowRoot,t=t&&t.querySelector("hui-root"),t){const e=t.lovelace;return e.current_view=t.___curView,e}return null}()||function(){let t=document.querySelector("hc-main");if(t=t&&t.shadowRoot,t=t&&t.querySelector("hc-lovelace"),t=t&&t.shadowRoot,t=t&&(t.querySelector("hui-view")||t.querySelector("hui-panel-view")),t){const e=t.lovelace;return e.current_view=t.___curView,e}return null}();let i=$i(t);i=this._configFromLLTemplates(e,i),this._config=Object.assign(Object.assign({type:"custom:button-card",group_expand:!1,hold_action:{action:"none"},double_tap_action:{action:"none"},layout:"vertical",size:"40%",color_type:"icon",show_name:!0,show_state:!1,show_icon:!0,show_units:!0,show_label:!1,show_entity_picture:!1,show_live_stream:!1,card_size:3},i),{lock:Object.assign({enabled:!1,duration:5,unlock:"tap"},i.lock)}),this._initialSetupComplete||this._finishSetup()}_loopGroup(t){t&&t.forEach((t=>{var e,i;(null===(e=this._hass)||void 0===e?void 0:e.states[t])&&((null===(i=this._hass.states[t].attributes)||void 0===i?void 0:i.entity_id)?this._loopGroup(this._hass.states[t].attributes.entity_id):this._entities.includes(t)||this._entities.push(t))}))}_expandTriggerGroups(){var t;this._hass&&(null===(t=this._config)||void 0===t?void 0:t.group_expand)&&this._entities&&this._entities.forEach((t=>{var e,i,n,r,s;(null===(n=null===(i=null===(e=this._hass)||void 0===e?void 0:e.states[t])||void 0===i?void 0:i.attributes)||void 0===n?void 0:n.entity_id)&&this._loopGroup(null===(s=null===(r=this._hass)||void 0===r?void 0:r.states[t].attributes)||void 0===s?void 0:s.entity_id)}))}getCardSize(){var t;return(null===(t=this._config)||void 0===t?void 0:t.card_size)||3}_evalActions(t,e){var i,n,r,s,a;const o=$i(t),l=t=>t?(Object.keys(t).forEach((e=>{"object"==typeof t[e]?t[e]=l(t[e]):t[e]=this._getTemplateOrValue(this._stateObj,t[e])})),t):t;return"entity"===(null===(n=null===(i=o[e])||void 0===i?void 0:i.service_data)||void 0===n?void 0:n.entity_id)&&(o[e].service_data.entity_id=t.entity),"entity"===(null===(s=null===(r=o[e])||void 0===r?void 0:r.data)||void 0===s?void 0:s.entity_id)&&(o[e].data.entity_id=t.entity),o[e]=l(o[e]),!o[e].confirmation&&o.confirmation&&(o[e].confirmation=l(o.confirmation)),(null===(a=o[e])||void 0===a?void 0:a.entity)&&(o.entity=o[e].entity),o}handleRippleActivate(t){this._ripple.then((e=>e&&"function"==typeof e.startPress&&this._rippleHandlers.startPress(t)))}handleRippleDeactivate(){this._ripple.then((t=>t&&"function"==typeof t.endPress&&this._rippleHandlers.endPress()))}handleRippleFocus(){this._ripple.then((t=>t&&"function"==typeof t.startFocus&&this._rippleHandlers.startFocus()))}handleRippleBlur(){this._ripple.then((t=>t&&"function"==typeof t.endFocus&&this._rippleHandlers.endFocus()))}_handleAction(t){var e;if(null===(e=t.detail)||void 0===e?void 0:e.action)switch(t.detail.action){case"tap":case"hold":case"double_tap":const e=this._config;if(!e)return;const i=t.detail.action,n=this._evalActions(e,`${i}_action`);(async(t,e,i,n)=>{yt(t,"hass-action",{config:i,action:n})})(this,this._hass,n,i)}}_handleUnlockType(t){const e=this._config;e&&e.lock.unlock===t.detail.action&&this._handleLock()}_handleLock(){var t;const e=this.shadowRoot.getElementById("lock");if(!e)return;if(this._config.lock.exemptions){if(!(null===(t=this._hass.user)||void 0===t?void 0:t.name)||!this._hass.user.id)return;let i=!1;if(this._config.lock.exemptions.forEach((t=>{var e,n;(!i&&t.user===(null===(e=this._hass.user)||void 0===e?void 0:e.id)||t.username===(null===(n=this._hass.user)||void 0===n?void 0:n.name))&&(i=!0)})),!i)return e.classList.add("invalid"),void window.setTimeout((()=>{e&&e.classList.remove("invalid")}),3e3)}const i=this.shadowRoot.getElementById("overlay");if(i.style.setProperty("pointer-events","none"),e){const t=document.createAttribute("icon");t.value="mdi:lock-open-outline",e.attributes.setNamedItem(t),e.classList.add("hidden")}window.setTimeout((()=>{if(i.style.setProperty("pointer-events",""),e){e.classList.remove("hidden");const t=document.createAttribute("icon");t.value="mdi:lock-outline",e.attributes.setNamedItem(t)}}),1e3*this._config.lock.duration)}_stopPropagation(t){t.stopPropagation()}};t([at()],Ti.prototype,"_hass",void 0),t([at()],Ti.prototype,"_config",void 0),t([at()],Ti.prototype,"_timeRemaining",void 0),t([function(t){return ot({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})})}("mwc-ripple")],Ti.prototype,"_ripple",void 0),t([function(t){return ot({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}({passive:!0})],Ti.prototype,"handleRippleActivate",null),Ti=t([(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))("button-card")],Ti); diff --git a/custom_components/ui_lovelace_minimalist/cards/light-entity-card/light-entity-card.js b/custom_components/ui_lovelace_minimalist/cards/light-entity-card/light-entity-card.js index 9ba1fdb37..c58389c90 100644 --- a/custom_components/ui_lovelace_minimalist/cards/light-entity-card/light-entity-card.js +++ b/custom_components/ui_lovelace_minimalist/cards/light-entity-card/light-entity-card.js @@ -1,7407 +1,481 @@ -(function () { - "use strict"; - function j(a, b) { - return ( - b || (b = a.slice(0)), - Object.freeze( - Object.defineProperties(a, { raw: { value: Object.freeze(b) } }) - ) - ); +!function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/local/",i(i.s=1)}([function(t){t.exports=JSON.parse('{"name":"light-entity-card","version":"6.1.3","description":"A light-entity card for Home Assistant Lovelace UI","keywords":["home-assistant","homeassistant","hass","automation","lovelace","custom-cards","light-entity"],"repository":"git@github.com:ljmerza/light-entity-card.git","author":"Leonardo Merza ","license":"MIT","dependencies":{"@babel/polyfill":"^7.4.4","@jaames/iro":"^5.5.2","@lit-labs/scoped-registry-mixin":"^1.0.0","@material/mwc-icon":"^0.25.3","@material/mwc-list":"^0.25.3","@material/mwc-menu":"^0.25.3","@material/mwc-notched-outline":"^0.25.3","@material/mwc-select":"^0.25.3","core-js":"^2.6.5","lit":"^2.1.2","lit-element":"^2.2.1"},"devDependencies":{"@babel/cli":"^7.5.5","@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","babel-loader":"^8.0.6","eslint":"^6.1.0","webpack":"^4.38.0","webpack-cli":"^3.3.6","webpack-merge":"^4.2.1"},"scripts":{"lint":"eslint --fix ./src","start":"webpack --watch --config webpack/config.dev.js","build":"webpack --config webpack/config.prod.js"}}')},function(t,e,i){"use strict";i.r(e); +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const n=window,r=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;class a{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=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}}const 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 a(i,t,o)},c=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,o))(e)})(t):t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;var h;const u=window,d=u.trustedTypes,f=d?d.emptyScript:"",p=u.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}},v=(t,e)=>e!==t&&(e==e||t==t),_={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:v};class y extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}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("finalized"))return!1;this.finalized=!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(c(t))}else void 0!==t&&e.push(c(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}u(){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((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)})})(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||v)(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){}}function b(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}function m(t,e){return(m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=k(t);if(e){var r=k(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return $(this,i)}}function $(t,e){if(e&&("object"===j(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function k(t){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function x(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=E(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function S(t){return function(t){if(Array.isArray(t))return C(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||E(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var n,r,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(n=i.next()).done)&&(o.push(n.value),!e||o.length!==e);s=!0);}catch(t){a=!0,r=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw r}}return o}(t,e)||E(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(t,e){if(t){if("string"==typeof t)return C(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?C(t,e):void 0}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i"),D=document,W=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return D.createComment(t)},B=function(t){return null===t||"object"!=j(t)&&"function"!=typeof t},F=Array.isArray,z=function(t){return F(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator])},V=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,K=/>/g,G=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),J=/'/g,Z=/"/g,X=/^(?:script|style|textarea|title)$/i,Y=function(t){return function(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r":"",s=V,a=0;a"===h[0]?(s=null!=i?i:V,u=-1):void 0===h[1]?u=-2:(u=s.lastIndex-h[2].length,c=h[1],s=void 0===h[3]?G:'"'===h[3]?Z:J):s===Z||s===J?s=G:s===q||s===K?s=V:(s=G,i=void 0);var f=s===G&&t[a+1].startsWith("/>")?" ":"";o+=s===V?l+L:u>=0?(r.push(c),l.slice(0,u)+"$lit$"+l.slice(u)+N+f):l+N+(-2===u?(r.push(void 0),a):f)}var p=o+(t[n]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==H?H.createHTML(p):p,r]},ot=function(){function t(e,i){var n,r=e.strings,o=e._$litType$;O(this,t),this.parts=[];var s=0,a=0,l=r.length-1,c=this.parts,h=A(rt(r,o),2),u=h[0],d=h[1];if(this.el=t.createElement(u,i),nt.currentNode=this.el.content,2===o){var f=this.el.content,p=f.firstChild;p.remove(),f.append.apply(f,S(p.childNodes))}for(;null!==(n=nt.nextNode())&&c.length0){n.textContent=M?M.emptyScript:"";for(var T=0;T2&&void 0!==arguments[2]?arguments[2]:t,a=arguments.length>3?arguments[3]:void 0;if(e===tt)return e;var l=void 0!==a?null===(i=s._$Co)||void 0===i?void 0:i[a]:s._$Cl,c=B(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==c&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===c?l=void 0:(l=new c(t))._$AT(t,s,a),void 0!==a?(null!==(r=(o=s)._$Co)&&void 0!==r?r:o._$Co=[])[a]=l:s._$Cl=l),void 0!==l&&(e=st(t,l._$AS(t,e.values),l,a)),e}var at=function(){function t(e,i){O(this,t),this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=i}return T(t,[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"v",value:function(t){var e,i=this._$AD,n=i.el.content,r=i.parts,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:D).importNode(n,!0);nt.currentNode=o;for(var s=nt.nextNode(),a=0,l=0,c=r[0];void 0!==c;){if(a===c.index){var h=void 0;2===c.type?h=new lt(s,s.nextSibling,this,t):1===c.type?h=new c.ctor(s,c.name,c.strings,this,t):6===c.type&&(h=new pt(s,this,t)),this.u.push(h),c=r[++l]}a!==(null==c?void 0:c.index)&&(s=nt.nextNode(),a++)}return o}},{key:"p",value:function(t){var e,i=0,n=x(this.u);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,i),i+=r.strings.length-2):r._$AI(t[i])),i++}}catch(t){n.e(t)}finally{n.f()}}}]),t}(),lt=function(){function t(e,i,n,r){var o;O(this,t),this.type=2,this._$AH=et,this._$AN=void 0,this._$AA=e,this._$AB=i,this._$AM=n,this.options=r,this._$Cm=null===(o=null==r?void 0:r.isConnected)||void 0===o||o}return T(t,[{key:"_$AU",get:function(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}},{key:"parentNode",get:function(){var t=this._$AA.parentNode,e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;t=st(this,t,e),B(t)?t===et||null==t||""===t?(this._$AH!==et&&this._$AR(),this._$AH=et):t!==this._$AH&&t!==tt&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):z(t)?this.k(t):this.g(t)}},{key:"O",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._$AB;return this._$AA.parentNode.insertBefore(t,e)}},{key:"T",value:function(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}},{key:"g",value:function(t){this._$AH!==et&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(D.createTextNode(t)),this._$AH=t}},{key:"$",value:function(t){var e,i=t.values,n=t._$litType$,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=ot.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.p(i);else{var o=new at(r,this),s=o.v(this.options);o.p(i),this.T(s),this._$AH=o}}},{key:"_$AC",value:function(t){var e=it.get(t.strings);return void 0===e&&it.set(t.strings,e=new ot(t)),e}},{key:"k",value:function(e){F(this._$AH)||(this._$AH=[],this._$AR());var i,n,r=this._$AH,o=0,s=x(e);try{for(s.s();!(n=s.n()).done;){var a=n.value;o===r.length?r.push(i=new t(this.O(W()),this.O(W()),this,this.options)):i=r[o],i._$AI(a),o++}}catch(t){s.e(t)}finally{s.f()}o0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,i=arguments.length>1?arguments[1]:void 0;for(null===(t=this._$AP)||void 0===t||t.call(this,!1,!0,i);e&&e!==this._$AB;){var n=e.nextSibling;e.remove(),e=n}}},{key:"setConnected",value:function(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}]),t}(),ct=function(){function t(e,i,n,r,o){O(this,t),this.type=1,this._$AH=et,this._$AN=void 0,this.element=e,this.name=i,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=et}return T(t,[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=this.strings,o=!1;if(void 0===r)t=st(this,t,e,0),(o=!B(t)||t!==this._$AH&&t!==tt)&&(this._$AH=t);else{var s,a,l=t;for(t=r[0],s=0;s1&&void 0!==arguments[1]?arguments[1]:this;if((t=null!==(e=st(this,t,i,0))&&void 0!==e?e:et)!==tt){var n=this._$AH,r=t===et&&n!==et||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==et&&(n===et||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}}},{key:"handleEvent",value:function(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}]),i}(ct),pt=function(){function t(e,i,n){O(this,t),this.element=e,this.type=6,this._$AN=void 0,this._$AM=i,this.options=n}return T(t,[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){st(this,t)}}]),t}(),gt=I.litHtmlPolyfillSupport;null==gt||gt(ot,lt),(null!==(R=I.litHtmlVersions)&&void 0!==R?R:I.litHtmlVersions=[]).push("2.6.1");var vt,_t;function yt(t){return(yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mt(t,e){for(var i=0;i3)for(i=[i],n=3;n-1,n=parseFloat(t);return i?e/100*n:n}function $e(t){return parseInt(t,16)}function ke(t){return t.toString(16).padStart(2,"0")}var xe=function(){function t(t,e){this.$={h:0,s:0,v:0,a:1},t&&this.set(t),this.onChange=e,this.initialValue=oe({},this.$)}var e,i,n,r=t.prototype;return r.set=function(e){if("string"==typeof e)/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(e)?this.hexString=e:/^rgba?/.test(e)?this.rgbString=e:/^hsla?/.test(e)&&(this.hslString=e);else{if("object"!=typeof e)throw new Error("Invalid color value");e instanceof t?this.hsva=e.hsva:"r"in e&&"g"in e&&"b"in e?this.rgb=e:"h"in e&&"s"in e&&"v"in e?this.hsv=e:"h"in e&&"s"in e&&"l"in e?this.hsl=e:"kelvin"in e&&(this.kelvin=e.kelvin)}},r.setChannel=function(t,e,i){var n;this[t]=oe({},this[t],((n={})[e]=i,n))},r.reset=function(){this.hsva=this.initialValue},r.clone=function(){return new t(this)},r.unbind=function(){this.onChange=void 0},t.hsvToRgb=function(t){var e=t.h/60,i=t.s/100,n=t.v/100,r=be(e),o=e-r,s=n*(1-i),a=n*(1-o*i),l=n*(1-(1-o)*i),c=r%6,h=[l,n,n,a,s,s][c],u=[s,s,l,n,n,a][c];return{r:me(255*[n,a,s,s,l,n][c],0,255),g:me(255*h,0,255),b:me(255*u,0,255)}},t.rgbToHsv=function(t){var e=t.r/255,i=t.g/255,n=t.b/255,r=Math.max(e,i,n),o=Math.min(e,i,n),s=r-o,a=0,l=r,c=0===r?0:s/r;switch(r){case o:a=0;break;case e:a=(i-n)/s+(i.4;){i=.5*(s+o);var a=t.kelvinToRgb(i);a.b/a.r>=r/n?s=i:o=i}return i},e=t,(i=[{key:"hsv",get:function(){var t=this.$;return{h:t.h,s:t.s,v:t.v}},set:function(t){var e=this.$;if(t=oe({},e,t),this.onChange){var i={h:!1,v:!1,s:!1,a:!1};for(var n in e)i[n]=t[n]!=e[n];this.$=t,(i.h||i.s||i.v||i.a)&&this.onChange(this,i)}else this.$=t}},{key:"hsva",get:function(){return oe({},this.$)},set:function(t){this.hsv=t}},{key:"hue",get:function(){return this.$.h},set:function(t){this.hsv={h:t}}},{key:"saturation",get:function(){return this.$.s},set:function(t){this.hsv={s:t}}},{key:"value",get:function(){return this.$.v},set:function(t){this.hsv={v:t}}},{key:"alpha",get:function(){return this.$.a},set:function(t){this.hsv=oe({},this.hsv,{a:t})}},{key:"kelvin",get:function(){return t.rgbToKelvin(this.rgb)},set:function(e){this.rgb=t.kelvinToRgb(e)}},{key:"red",get:function(){return this.rgb.r},set:function(t){this.rgb=oe({},this.rgb,{r:t})}},{key:"green",get:function(){return this.rgb.g},set:function(t){this.rgb=oe({},this.rgb,{g:t})}},{key:"blue",get:function(){return this.rgb.b},set:function(t){this.rgb=oe({},this.rgb,{b:t})}},{key:"rgb",get:function(){var e=t.hsvToRgb(this.$),i=e.r,n=e.g,r=e.b;return{r:ye(i),g:ye(n),b:ye(r)}},set:function(e){this.hsv=oe({},t.rgbToHsv(e),{a:void 0===e.a?1:e.a})}},{key:"rgba",get:function(){return oe({},this.rgb,{a:this.alpha})},set:function(t){this.rgb=t}},{key:"hsl",get:function(){var e=t.hsvToHsl(this.$),i=e.h,n=e.s,r=e.l;return{h:ye(i),s:ye(n),l:ye(r)}},set:function(e){this.hsv=oe({},t.hslToHsv(e),{a:void 0===e.a?1:e.a})}},{key:"hsla",get:function(){return oe({},this.hsl,{a:this.alpha})},set:function(t){this.hsl=t}},{key:"rgbString",get:function(){var t=this.rgb;return"rgb("+t.r+", "+t.g+", "+t.b+")"},set:function(t){var e,i,n,r,o=1;if((e=ce.exec(t))?(i=we(e[1],255),n=we(e[2],255),r=we(e[3],255)):(e=he.exec(t))&&(i=we(e[1],255),n=we(e[2],255),r=we(e[3],255),o=we(e[4],1)),!e)throw new Error("Invalid rgb string");this.rgb={r:i,g:n,b:r,a:o}}},{key:"rgbaString",get:function(){var t=this.rgba;return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},set:function(t){this.rgbString=t}},{key:"hexString",get:function(){var t=this.rgb;return"#"+ke(t.r)+ke(t.g)+ke(t.b)},set:function(t){var e,i,n,r,o=255;if((e=fe.exec(t))?(i=17*$e(e[1]),n=17*$e(e[2]),r=17*$e(e[3])):(e=pe.exec(t))?(i=17*$e(e[1]),n=17*$e(e[2]),r=17*$e(e[3]),o=17*$e(e[4])):(e=ge.exec(t))?(i=$e(e[1]),n=$e(e[2]),r=$e(e[3])):(e=ve.exec(t))&&(i=$e(e[1]),n=$e(e[2]),r=$e(e[3]),o=$e(e[4])),!e)throw new Error("Invalid hex string");this.rgb={r:i,g:n,b:r,a:o/255}}},{key:"hex8String",get:function(){var t=this.rgba;return"#"+ke(t.r)+ke(t.g)+ke(t.b)+ke(be(255*t.a))},set:function(t){this.hexString=t}},{key:"hslString",get:function(){var t=this.hsl;return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},set:function(t){var e,i,n,r,o=1;if((e=ue.exec(t))?(i=we(e[1],360),n=we(e[2],100),r=we(e[3],100)):(e=de.exec(t))&&(i=we(e[1],360),n=we(e[2],100),r=we(e[3],100),o=we(e[4],1)),!e)throw new Error("Invalid hsl string");this.hsl={h:i,s:n,l:r,a:o}}},{key:"hslaString",get:function(){var t=this.hsla;return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},set:function(t){this.hslString=t}}])&&re(e.prototype,i),n&&re(e,n),t}();function Se(t){var e,i=t.width,n=t.sliderSize,r=t.borderWidth,o=t.handleRadius,s=t.padding,a=t.sliderShape,l="horizontal"===t.layoutDirection;return n=null!=(e=n)?e:2*s+2*o,"circle"===a?{handleStart:t.padding+t.handleRadius,handleRange:i-2*s-2*o,width:i,height:i,cx:i/2,cy:i/2,radius:i/2-r/2}:{handleStart:n/2,handleRange:i-n,radius:n/2,x:0,y:0,width:l?n:i,height:l?i:n}}function Ae(t,e){var i=Se(t),n=i.width,r=i.height,o=i.handleRange,s=i.handleStart,a="horizontal"===t.layoutDirection,l=a?n/2:r/2,c=s+function(t,e){var i=e.hsva,n=e.rgb;switch(t.sliderType){case"red":return n.r/2.55;case"green":return n.g/2.55;case"blue":return n.b/2.55;case"alpha":return 100*i.a;case"kelvin":var r=t.minTemperature,o=t.maxTemperature-r,s=(e.kelvin-r)/o*100;return Math.max(0,Math.min(s,100));case"hue":return i.h/=3.6;case"saturation":return i.s;case"value":default:return i.v}}(t,e)/100*o;return a&&(c=-1*c+o+2*s),{x:a?l:c,y:a?c:l}}var Ee,Ce=2*Math.PI,Oe=function(t,e){return Math.sqrt(t*t+e*e)};function Pe(t){return t.width/2-t.padding-t.handleRadius-t.borderWidth}function Te(t){var e=t.width/2;return{width:t.width,radius:e-t.borderWidth,cx:e,cy:e}}function je(t,e,i){var n=t.wheelAngle,r=t.wheelDirection;return i&&"clockwise"===r?e=n+e:"clockwise"===r?e=360-n+e:i&&"anticlockwise"===r?e=n+180-e:"anticlockwise"===r&&(e=n-e),function(t,e){return(t%e+e)%e}(e,360)}function Re(t,e,i){var n=Te(t),r=n.cx,o=n.cy,s=Pe(t);e=r-e,i=o-i;var a=je(t,Math.atan2(-i,-e)*(360/Ce)),l=Math.min(Oe(e,i),s);return{h:Math.round(a),s:Math.round(100/s*l)}}function Ie(t){var e=t.width,i=t.boxHeight;return{width:e,height:null!=i?i:e,radius:t.padding+t.handleRadius}}function Me(t,e,i){var n=Ie(t),r=n.width,o=n.height,s=n.radius,a=(e-s)/(r-2*s)*100,l=(i-s)/(o-2*s)*100;return{s:Math.max(0,Math.min(a,100)),v:Math.max(0,Math.min(100-l,100))}}function He(t){Ee||(Ee=document.getElementsByTagName("base"));var e=window.navigator.userAgent,i=/^((?!chrome|android).)*safari/i.test(e),n=/iPhone|iPod|iPad/i.test(e),r=window.location;return(i||n)&&Ee.length>0?r.protocol+"//"+r.host+r.pathname+r.search+t:t}function Ne(t,e,i,n){for(var r=0;r0&&(o[n?"marginLeft":"marginTop"]=r),Dt(Bt,null,t.children(this.uid,i,o))},e.prototype.handleEvent=function(t){var e=this,i=this.props.onInput,n=this.base.getBoundingClientRect();t.preventDefault();var r=t.touches?t.changedTouches[0]:t,o=r.clientX-n.left,s=r.clientY-n.top;switch(t.type){case"mousedown":case"touchstart":!1!==i(o,s,0)&&We.forEach((function(t){document.addEventListener(t,e,{passive:!1})}));break;case"mousemove":case"touchmove":i(o,s,1);break;case"mouseup":case"touchend":i(o,s,2),We.forEach((function(t){document.removeEventListener(t,e,{passive:!1})}))}},e}(Ft);function Fe(t){var e=t.r,i=t.url,n=e,r=e;return Dt("svg",{className:"IroHandle IroHandle--"+t.index+" "+(t.isActive?"IroHandle--isActive":""),style:{"-webkit-tap-highlight-color":"rgba(0, 0, 0, 0);",transform:"translate("+De(t.x)+", "+De(t.y)+")",willChange:"transform",top:De(-e),left:De(-e),width:De(2*e),height:De(2*e),position:"absolute",overflow:"visible"}},i&&Dt("use",Object.assign({xlinkHref:He(i)},t.props)),!i&&Dt("circle",{cx:n,cy:r,r:e,fill:"none","stroke-width":2,stroke:"#000"}),!i&&Dt("circle",{cx:n,cy:r,r:e-2,fill:t.fill,"stroke-width":2,stroke:"#fff"}))}function ze(t){var e=t.activeIndex,i=void 0!==e&&e0?e.colors:[e.color]).forEach((function(t){return i.addColor(t)})),this.setActiveColor(0),this.state=Object.assign({},e,{color:this.color,colors:this.colors,layout:e.layout})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addColor=function(t,e){void 0===e&&(e=this.colors.length);var i=new xe(t,this.onColorChange.bind(this));this.colors.splice(e,0,i),this.colors.forEach((function(t,e){return t.index=e})),this.state&&this.setState({colors:this.colors}),this.deferredEmit("color:init",i)},e.prototype.removeColor=function(t){var e=this.colors.splice(t,1)[0];e.unbind(),this.colors.forEach((function(t,e){return t.index=e})),this.state&&this.setState({colors:this.colors}),e.index===this.color.index&&this.setActiveColor(0),this.emit("color:remove",e)},e.prototype.setActiveColor=function(t){this.color=this.colors[t],this.state&&this.setState({color:this.color}),this.emit("color:setActive",this.color)},e.prototype.setColors=function(t,e){var i=this;void 0===e&&(e=0),this.colors.forEach((function(t){return t.unbind()})),this.colors=[],t.forEach((function(t){return i.addColor(t)})),this.setActiveColor(e),this.emit("color:setAll",this.colors)},e.prototype.on=function(t,e){var i=this,n=this.events;(Array.isArray(t)?t:[t]).forEach((function(t){(n[t]||(n[t]=[])).push(e),i.deferredEvents[t]&&(i.deferredEvents[t].forEach((function(t){e.apply(null,t)})),i.deferredEvents[t]=[])}))},e.prototype.off=function(t,e){var i=this;(Array.isArray(t)?t:[t]).forEach((function(t){var n=i.events[t];n&&n.splice(n.indexOf(e),1)}))},e.prototype.emit=function(t){for(var e=this,i=[],n=arguments.length-1;n-- >0;)i[n]=arguments[n+1];var r=this.activeEvents,o=!!r.hasOwnProperty(t)&&r[t];if(!o){r[t]=!0;var s=this.events[t]||[];s.forEach((function(t){return t.apply(e,i)})),r[t]=!1}},e.prototype.deferredEmit=function(t){for(var e,i=[],n=arguments.length-1;n-- >0;)i[n]=arguments[n+1];var r=this.deferredEvents;(e=this).emit.apply(e,[t].concat(i)),(r[t]||(r[t]=[])).push(i)},e.prototype.setOptions=function(t){this.setState(t)},e.prototype.resize=function(t){this.setOptions({width:t})},e.prototype.reset=function(){this.colors.forEach((function(t){return t.reset()})),this.setState({colors:this.colors})},e.prototype.onMount=function(t){this.el=t,this.deferredEmit("mount",this)},e.prototype.onColorChange=function(t,e){this.setState({color:this.color}),this.inputActive&&(this.inputActive=!1,this.emit("input:change",t,e)),this.emit("color:change",t,e)},e.prototype.emitInputEvent=function(t,e){0===t?this.emit("input:start",this.color,e):1===t?this.emit("input:move",this.color,e):2===t&&this.emit("input:end",this.color,e)},e.prototype.render=function(t,e){var i=this,n=e.layout;return Array.isArray(n)||(n=[{component:qe},{component:ze}],e.transparency&&n.push({component:ze,options:{sliderType:"alpha"}})),Dt("div",{class:"IroColorPicker",id:e.id,style:{display:e.display}},n.map((function(t,n){var r=t.component,o=t.options;return Dt(r,Object.assign({},e,o,{ref:void 0,onInput:i.emitInputEvent.bind(i),parent:i,index:n}))})))},e}(Ft);Ke.defaultProps=Object.assign({},{width:300,height:300,color:"#fff",colors:[],padding:6,layoutDirection:"vertical",borderColor:"#fff",borderWidth:0,handleRadius:8,activeHandleRadius:null,handleSvg:null,handleProps:{x:0,y:0},wheelLightness:!0,wheelAngle:0,wheelDirection:"anticlockwise",sliderSize:null,sliderMargin:12,boxHeight:null},{colors:[],display:"block",id:null,layout:"default",margin:null});var Ge,Je,Ze,Xe=((Je=function(t,e){var i,n=document.createElement("div");function r(){var e=t instanceof Element?t:document.querySelector(t);e.appendChild(i.base),i.onMount(e)}return function(t,e,i){var n,r,o;Pt.__p&&Pt.__p(t,e),r=(n=i===It)?null:i&&i.__k||e.__k,t=Dt(Bt,null,[t]),o=[],Qt(e,n?e.__k=t:(i||e).__k=t,r||Mt,Mt,void 0!==e.ownerSVGElement,i&&!n?[i]:r?null:Ht.slice.call(e.childNodes),o,!1,i||Mt,n),te(o,t)}(Dt(Ge,Object.assign({},{ref:function(t){return i=t}},e)),n),"loading"!==document.readyState?r():document.addEventListener("DOMContentLoaded",r),i}).prototype=(Ge=Ke).prototype,Object.assign(Je,Ge),Je.__component=Ge,Je);!function(t){t.version="5.5.2",t.Color=xe,t.ColorPicker=Xe,function(t){t.h=Dt,t.ComponentBase=Be,t.Handle=Fe,t.Slider=ze,t.Wheel=qe,t.Box=Ve}(t.ui||(t.ui={}))}(Ze||(Ze={}));var Ye=Ze; +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const Qe=window,ti=Qe.ShadowRoot&&(void 0===Qe.ShadyCSS||Qe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;Symbol(),new WeakMap; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function ei(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:e,elementDefinitions:i,shadowRootOptions:n}=t;i&&!e&&(t.registry=new CustomElementRegistry,Object.entries(i).forEach(([e,i])=>t.registry.define(e,i)));const r=this.renderOptions.creationScope=this.attachShadow({...n,customElements:t.registry});return((t,e)=>{ti?t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(e=>{const i=document.createElement("style"),n=Qe.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,t.appendChild(i)})})(r,this.constructor.elementStyles),r}}}var ii=l` + .IroSlider { + display: none !important; } - function k(a, b) { - var c = Object.keys(a); - if (Object.getOwnPropertySymbols) { - var d = Object.getOwnPropertySymbols(a); - b && - (d = d.filter(function (b) { - return Object.getOwnPropertyDescriptor(a, b).enumerable; - })), - c.push.apply(c, d); - } - return c; + + .light-entity-card { + padding: 16px; + } + + .light-entity-child-card { + box-shadow: none !important; + padding: 0 !important; + } + + .light-entity-card.group { + padding-bottom: 5; + padding-top: 0; + } + + .ha-slider-full-width ha-slider { + width: 100%; + } + + .percent-slider { + color: var(--primary-text-color); + display: flex; + justify-content: center; + align-items: center; + } + + .light-entity-card__header { + display: flex; + justify-content: space-between; + @apply --paper-font-headline; + line-height: 40px; + color: var(--primary-text-color); + } + + .group .light-entity-card__header { + } + + .light-entity-card-sliders > div { + margin-top: 10px; + } + + .group .light-entity-card-sliders > div { + margin-top: 0px; + } + + .light-entity-card__toggle { + display: flex; + cursor: pointer; + } + + .light-entity-card__color-picker { + display: flex; + justify-content: space-around; + margin-top: 10px; + } + + .light-entity-card-color_temp { + background-image: var(--ha-slider-background); + } + + .light-entity-card-effectlist { + padding-top: 10px; + padding-bottom: 10px; } - function l(a) { - for (var b, c = 1; c < arguments.length; c++) - (b = null == arguments[c] ? {} : arguments[c]), - c % 2 - ? k(Object(b), !0).forEach(function (c) { - m(a, c, b[c]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b)) - : k(Object(b)).forEach(function (c) { - Object.defineProperty( - a, - c, - Object.getOwnPropertyDescriptor(b, c) - ); - }); - return a; + + .group .light-entity-card-effectlist { + padding-bottom: 20px; } - function m(a, b, c) { - return ( - b in a - ? Object.defineProperty(a, b, { - value: c, - enumerable: !0, - configurable: !0, - writable: !0, - }) - : (a[b] = c), - a - ); + + .light-entity-card-center { + display: flex; + justify-content: center; + cursor: pointer; } - function n(a, b, c, d, e, f, g) { - try { - var h = a[f](g), - i = h.value; - } catch (a) { - return void c(a); - } - h.done ? b(i) : Promise.resolve(i).then(d, e); + + .hidden { + display: none; } - function o(a) { - return function () { - var b = this, - c = arguments; - return new Promise(function (d, e) { - function f(a) { - n(h, d, e, f, g, "next", a); - } - function g(a) { - n(h, d, e, f, g, "throw", a); - } - var h = a.apply(b, c); - f(void 0); - }); - }; + + .icon-container { + display: flex; + justify-content: center; + align-items: center; + } +`,ni={shorten_cards:!1,consolidate_entities:!1,child_card:!1,hide_header:!1,show_header_icon:!1,header:"",color_wheel:!0,persist_features:!1,brightness:!0,color_temp:!0,white_value:!0,color_picker:!0,speed:!0,intensity:!0,force_features:!1,show_slider_percent:!1,full_width_sliders:!1,brightness_icon:"weather-sunny",white_icon:"file-word-box",temperature_icon:"thermometer",speed_icon:"speedometer",intensity_icon:"transit-connection-horizontal"};var ri=l` + .entities { + padding-top: 10px; + padding-bottom: 10px; + display: flex; + } + + .entities ha-formfield { + display: block; + margin-bottom: 10px; + margin-left: 10px; + } + + .checkbox-options { + display: flex; + } + + mwc-select { + width: 100%; + } + + .checkbox-options ha-formfield, + .entities mwc-switch, + .entities ha-form-string { + padding-right: 2%; + width: 48%; } - var p, - q, - r, - s, - t, - u, - v, - w, - x, - y, - z, - A, - B, - C, - D, - E, - F, - G, - H, - I, - J, - K, - O, - P, - Q, - R, - U, - V, - W, - X, - Y, - Z, - aa, - ba, - ca, - da, - ea, - fa, - ga, - ha, - ia, - ja, - ka, - la, - ma, - na, - oa, - pa, - qa, - ra, - sa, - ta, - ua, - va, - wa, - xa, - ya, - za, - Aa, - Ba, - Ca, - Da, - Ea, - Fa, - Ga, - Ha, - Ia, - Ja; - (function (a, b) { - "object" == typeof exports && "undefined" != typeof module - ? b() - : "function" == typeof define && define.amd - ? define(b) - : b(); - })(this, function () { - function Ka(a, b) { - var c, - f, - g, - j, - k = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : a, - m = 3 < arguments.length ? arguments[3] : void 0; - if (b === $) return b; - var e = - void 0 === m - ? k._$Cu - : null === (c = k._$Cl) || void 0 === c - ? void 0 - : c[m], - p = Ab(b) ? void 0 : b._$litDirective$; - return ( - (null == e ? void 0 : e.constructor) !== p && - (null === (f = null == e ? void 0 : e._$AO) || - void 0 === f || - f.call(e, !1), - void 0 === p ? (e = void 0) : ((e = new p(a)), e._$AT(a, k, m)), - void 0 === m - ? (k._$Cu = e) - : ((null !== (g = (j = k)._$Cl) && void 0 !== g - ? g - : (j._$Cl = []))[m] = e)), - void 0 !== e && (b = Ka(a, e._$AS(a, b.values), e, m)), - b - ); - } - function La(a) { - return class extends a { - createRenderRoot() { - var a = this.constructor, - { registry: b, elementDefinitions: c, shadowRootOptions: d } = a; - c && - !b && - ((a.registry = new CustomElementRegistry()), - Object.entries(c).forEach((b) => { - var [c, d] = b; - return a.registry.define(c, d); - })); - var e = (this.renderOptions.creationScope = this.attachShadow( - l(l({}, d), {}, { customElements: a.registry }) - )); - return nb(e, this.constructor.elementStyles), e; - } - }; - } - function Ma(a, c) { - function b() { - this.constructor = a; - } - if ("function" != typeof c && null !== c) - throw new TypeError( - "Class extends value " + (c + "") + " is not a constructor or null" - ); - Xb(a, c), - (a.prototype = - null === c - ? Object.create(c) - : ((b.prototype = c.prototype), new b())); - } - function Na(a, b, e, f) { - var g, - h = arguments.length, - c = - 3 > h - ? b - : null === f - ? (f = Object.getOwnPropertyDescriptor(b, e)) - : f; - if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) - c = Reflect.decorate(a, b, e, f); - else - for (var j = a.length - 1; 0 <= j; j--) - (g = a[j]) && - (c = (3 > h ? g(c) : 3 < h ? g(b, e, c) : g(b, e)) || c); - return 3 < h && c && Object.defineProperty(b, e, c), c; - } - function Oa(a) { - var b = "function" == typeof Symbol && Symbol.iterator, - c = b && a[b], - d = 0; - if (c) return c.call(a); - if (a && "number" == typeof a.length) - return { - next: function () { - return ( - a && d >= a.length && (a = void 0), - { value: a && a[d++], done: !a } - ); - }, - }; - throw new TypeError( - b ? "Object is not iterable." : "Symbol.iterator is not defined." - ); - } - function Pa(a) { - return (b, c) => - void 0 === c - ? bc(a, b) - : ((a, b, c) => { - b.constructor.createProperty(c, a); - })(a, b, c); - } - function Qa(a) { - return Pa(l(l({}, a), {}, { state: !0 })); - } - function Ra(a, b) { - return cc({ - descriptor: (c) => { - var d = { - get() { - var b, c; - return null !== - (c = - null === (b = this.renderRoot) || void 0 === b - ? void 0 - : b.querySelector(a)) && void 0 !== c - ? c - : null; - }, - enumerable: !0, - configurable: !0, - }; - if (b) { - var e = "symbol" == typeof c ? Symbol() : "__" + c; - d.get = function () { - var b, c; - return ( - void 0 === this[e] && - (this[e] = - null !== - (c = - null === (b = this.renderRoot) || void 0 === b - ? void 0 - : b.querySelector(a)) && void 0 !== c - ? c - : null), - this[e] - ); - }; - } - return d; - }, - }); - } - function Sa(a) { - var { slot: b, selector: c } = null == a ? {} : a; - return cc({ - descriptor: () => ({ - get() { - var d, - e = "slot" + (b ? "[name=".concat(b, "]") : ":not([name])"), - f = - null === (d = this.renderRoot) || void 0 === d - ? void 0 - : d.querySelector(e), - g = null == f ? [] : dc(f, a); - return c ? g.filter((a) => a.matches(c)) : g; - }, - enumerable: !0, - configurable: !0, - }), - }); - } - function Ta(a, b, c) { - var d, - f = a; - return ( - "object" == typeof a ? ((f = a.slot), (d = a)) : (d = { flatten: b }), - c - ? Sa({ slot: f, flatten: b, selector: c }) - : cc({ - descriptor: () => ({ - get() { - var a, - b, - c = "slot" + (f ? "[name=".concat(f, "]") : ":not([name])"), - g = - null === (a = this.renderRoot) || void 0 === a - ? void 0 - : a.querySelector(c); - return null !== - (b = null == g ? void 0 : g.assignedNodes(d)) && - void 0 !== b - ? b - : []; - }, - enumerable: !0, - configurable: !0, - }), - }) - ); - } - function Ua(a, b) { - var c = a.matches || a.webkitMatchesSelector || a.msMatchesSelector; - return c.call(a, b); - } - function Va(a) { - return { - addClass: (b) => { - a.classList.add(b); - }, - removeClass: (b) => { - a.classList.remove(b); - }, - hasClass: (b) => a.classList.contains(b), - }; - } - function Wa(a, b, c) { - if (!a) return { x: 0, y: 0 }; - var d, - e, - f = b.x, - g = b.y, - h = f + c.left, - i = g + c.top; - if ("touchstart" === a.type) { - var j = a; - (d = j.changedTouches[0].pageX - h), - (e = j.changedTouches[0].pageY - i); - } else { - var k = a; - (d = k.pageX - h), (e = k.pageY - i); - } - return { x: d, y: e }; - } - function Xa(a) { - var b = a.key; - if (Ec.has(b)) return b; - var c = Gc.get(a.keyCode); - return c ? c : Dc.UNKNOWN; - } - function Ya() { - return { - bufferClearTimeout: 0, - currentFirstChar: "", - sortedIndexCursor: 0, - typeaheadBuffer: "", - }; - } - function Za(a, b) { - for (var c, d = new Map(), e = 0; e < a; e++) - if (((c = b(e).trim()), !!c)) { - var f = c[0].toLowerCase(); - d.has(f) || d.set(f, []), - d.get(f).push({ text: c.toLowerCase(), index: e }); - } - return ( - d.forEach(function (a) { - a.sort(function (a, b) { - return a.index - b.index; - }); - }), - d - ); - } - function $a(a, b) { - var c = a.nextChar, - d = a.focusItemAtIndex, - e = a.sortedIndexByFirstChar, - f = a.focusedItemIndex, - g = a.skipFocus, - h = a.isItemAtIndexDisabled; - clearTimeout(b.bufferClearTimeout), - (b.bufferClearTimeout = setTimeout(function () { - db(b); - }, Qc.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS)), - (b.typeaheadBuffer += c); - var i; - return ( - (i = 1 === b.typeaheadBuffer.length ? ab(e, f, h, b) : bb(e, h, b)), - -1 === i || g || d(i), - i - ); - } - function ab(a, b, c, d) { - var e = d.typeaheadBuffer[0], - f = a.get(e); - if (!f) return -1; - if (e === d.currentFirstChar && f[d.sortedIndexCursor].index === b) { - d.sortedIndexCursor = (d.sortedIndexCursor + 1) % f.length; - var g = f[d.sortedIndexCursor].index; - if (!c(g)) return g; - } - d.currentFirstChar = e; - var h, - i = -1; - for (h = 0; h < f.length; h++) - if (!c(f[h].index)) { - i = h; - break; - } - for (; h < f.length; h++) - if (f[h].index > b && !c(f[h].index)) { - i = h; - break; - } - return -1 === i - ? -1 - : ((d.sortedIndexCursor = i), f[d.sortedIndexCursor].index); - } - function bb(a, b, c) { - var d = c.typeaheadBuffer[0], - e = a.get(d); - if (!e) return -1; - var f = e[c.sortedIndexCursor]; - if (0 === f.text.lastIndexOf(c.typeaheadBuffer, 0) && !b(f.index)) - return f.index; - for ( - var g = (c.sortedIndexCursor + 1) % e.length, h = -1; - g !== c.sortedIndexCursor; - ) { - var i = e[g], - j = 0 === i.text.lastIndexOf(c.typeaheadBuffer, 0), - k = !b(i.index); - if (j && k) { - h = g; - break; - } - g = (g + 1) % e.length; - } - return -1 === h - ? -1 - : ((c.sortedIndexCursor = h), e[c.sortedIndexCursor].index); - } - function cb(a) { - return 0 < a.typeaheadBuffer.length; - } - function db(a) { - a.typeaheadBuffer = ""; - } - function eb(a, b) { - var c = a.event, - d = a.isTargetListItem, - e = a.focusedItemIndex, - f = a.focusItemAtIndex, - g = a.sortedIndexByFirstChar, - h = a.isItemAtIndexDisabled, - i = "ArrowLeft" === Xa(c), - j = "ArrowUp" === Xa(c), - k = "ArrowRight" === Xa(c), - l = "ArrowDown" === Xa(c), - m = "Home" === Xa(c), - n = "End" === Xa(c), - o = "Enter" === Xa(c), - p = "Spacebar" === Xa(c); - if (c.ctrlKey || c.metaKey || i || j || k || l || m || n || o) return -1; - var q = !p && 1 === c.key.length; - if (q) { - Sc(c); - var r = { - focusItemAtIndex: f, - focusedItemIndex: e, - nextChar: c.key.toLowerCase(), - sortedIndexByFirstChar: g, - skipFocus: !1, - isItemAtIndexDisabled: h, - }; - return $a(r, b); - } - if (!p) return -1; - d && Sc(c); - var s = d && cb(b); - if (s) { - var r = { - focusItemAtIndex: f, - focusedItemIndex: e, - nextChar: " ", - sortedIndexByFirstChar: g, - skipFocus: !1, - isItemAtIndexDisabled: h, - }; - return $a(r, b); - } - return -1; - } - function fb(a) { - return a instanceof Set; - } - function gb(a) { - var b, - c = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 50; - return function () { - var d = - !(0 < arguments.length && arguments[0] !== void 0) || arguments[0]; - clearTimeout(b), - (b = setTimeout(() => { - a(d); - }, c)); - }; - } - function hb() { - var a = this.itemsReadyResolver; - (this.itemsReady = new Promise((a) => (this.itemsReadyResolver = a))), - a(); - } - var ib = - window.ShadowRoot && - (void 0 === window.ShadyCSS || window.ShadyCSS.nativeShadow) && - "adoptedStyleSheets" in Document.prototype && - "replace" in CSSStyleSheet.prototype, - jb = Symbol(), - kb = new Map(); - class e { - constructor(a, b) { - if (((this._$cssResult$ = !0), b !== jb)) - throw Error( - "CSSResult is not constructable. Use `unsafeCSS` or `css` instead." - ); - this.cssText = a; - } - get styleSheet() { - var a = kb.get(this.cssText); - return ( - ib && - void 0 === a && - (kb.set(this.cssText, (a = new CSSStyleSheet())), - a.replaceSync(this.cssText)), - a - ); - } - toString() { - return this.cssText; - } - } - var n, - lb = (a) => new e("string" == typeof a ? a : a + "", jb), - mb = function (a) { - for ( - var b = arguments.length, c = Array(1 < b ? b - 1 : 0), d = 1; - d < b; - d++ - ) - c[d - 1] = arguments[d]; - var f = - 1 === a.length - ? a[0] - : c.reduce( - (b, c, d) => - b + - ((a) => { - if (!0 === a._$cssResult$) return a.cssText; - if ("number" == typeof a) return a; - throw Error( - "Value passed to 'css' function must be a 'css' function result: " + - a + - ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security." - ); - })(c) + - a[d + 1], - a[0] - ); - return new e(f, jb); - }, - nb = (a, b) => { - ib - ? (a.adoptedStyleSheets = b.map((a) => - a instanceof CSSStyleSheet ? a : a.styleSheet - )) - : b.forEach((b) => { - var c = document.createElement("style"), - d = window.litNonce; - void 0 !== d && c.setAttribute("nonce", d), - (c.textContent = b.cssText), - a.appendChild(c); - }); - }, - i = ib - ? (a) => a - : (a) => - a instanceof CSSStyleSheet - ? ((a) => { - var b = ""; - for (var c of a.cssRules) b += c.cssText; - return lb(b); - })(a) - : a, - S = window.trustedTypes, - ob = S ? S.emptyScript : "", - pb = window.reactiveElementPolyfillSupport, - qb = { - toAttribute(a, b) { - return ( - b === Boolean - ? (a = a ? ob : null) - : b === Object || b === Array - ? (a = null == a ? a : JSON.stringify(a)) - : void 0, - a - ); - }, - fromAttribute(a, b) { - var c = a; - switch (b) { - case Boolean: - c = null !== a; - break; - case Number: - c = null === a ? null : +a; - break; - case Object: - case Array: - try { - c = JSON.parse(a); - } catch (a) { - c = null; - } - } - return c; - }, - }, - rb = (a, b) => b !== a && (b == b || a == a), - sb = { - attribute: !0, - type: String, - converter: qb, - reflect: !1, - hasChanged: rb, - }; - class h extends HTMLElement { - constructor() { - super(), - (this._$Et = new Map()), - (this.isUpdatePending = !1), - (this.hasUpdated = !1), - (this._$Ei = null), - this.o(); - } - static addInitializer(a) { - var b; - (null !== (b = this.l) && void 0 !== b) || (this.l = []), - this.l.push(a); - } - static get observedAttributes() { - this.finalize(); - var a = []; - return ( - this.elementProperties.forEach((b, c) => { - var d = this._$Eh(c, b); - void 0 !== d && (this._$Eu.set(d, c), a.push(d)); - }), - a - ); - } - static createProperty(a) { - var b = - 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : sb; - if ( - (b.state && (b.attribute = !1), - this.finalize(), - this.elementProperties.set(a, b), - !b.noAccessor && !this.prototype.hasOwnProperty(a)) - ) { - var c = "symbol" == typeof a ? Symbol() : "__" + a, - d = this.getPropertyDescriptor(a, c, b); - void 0 !== d && Object.defineProperty(this.prototype, a, d); - } - } - static getPropertyDescriptor(a, b, c) { - return { - get() { - return this[b]; - }, - set(d) { - var e = this[a]; - (this[b] = d), this.requestUpdate(a, e, c); - }, - configurable: !0, - enumerable: !0, - }; - } - static getPropertyOptions(a) { - return this.elementProperties.get(a) || sb; - } - static finalize() { - if (this.hasOwnProperty("finalized")) return !1; - this.finalized = !0; - var a = Object.getPrototypeOf(this); - if ( - (a.finalize(), - (this.elementProperties = new Map(a.elementProperties)), - (this._$Eu = new Map()), - this.hasOwnProperty("properties")) - ) { - var b = this.properties, - c = [ - ...Object.getOwnPropertyNames(b), - ...Object.getOwnPropertySymbols(b), - ]; - for (var d of c) this.createProperty(d, b[d]); - } - return (this.elementStyles = this.finalizeStyles(this.styles)), !0; - } - static finalizeStyles(a) { - var b = []; - if (Array.isArray(a)) { - var c = new Set(a.flat(1 / 0).reverse()); - for (var d of c) b.unshift(i(d)); - } else void 0 !== a && b.push(i(a)); - return b; - } - static _$Eh(a, b) { - var c = b.attribute; - return !1 === c - ? void 0 - : "string" == typeof c - ? c - : "string" == typeof a - ? a.toLowerCase() - : void 0; - } - o() { - var a; - (this._$Ep = new Promise((a) => (this.enableUpdating = a))), - (this._$AL = new Map()), - this._$Em(), - this.requestUpdate(), - null === (a = this.constructor.l) || - void 0 === a || - a.forEach((a) => a(this)); - } - addController(a) { - var b, c; - (null !== (b = this._$Eg) && void 0 !== b ? b : (this._$Eg = [])).push( - a - ), - void 0 !== this.renderRoot && - this.isConnected && - (null === (c = a.hostConnected) || void 0 === c || c.call(a)); - } - removeController(a) { - var b; - null === (b = this._$Eg) || - void 0 === b || - b.splice(this._$Eg.indexOf(a) >>> 0, 1); - } - _$Em() { - this.constructor.elementProperties.forEach((a, b) => { - this.hasOwnProperty(b) && (this._$Et.set(b, this[b]), delete this[b]); - }); - } - createRenderRoot() { - var a, - b = - null !== (a = this.shadowRoot) && void 0 !== a - ? a - : this.attachShadow(this.constructor.shadowRootOptions); - return nb(b, this.constructor.elementStyles), b; - } - connectedCallback() { - var a; - void 0 === this.renderRoot && - (this.renderRoot = this.createRenderRoot()), - this.enableUpdating(!0), - null === (a = this._$Eg) || - void 0 === a || - a.forEach((a) => { - var b; - return null === (b = a.hostConnected) || void 0 === b - ? void 0 - : b.call(a); - }); - } - enableUpdating() {} - disconnectedCallback() { - var a; - null === (a = this._$Eg) || - void 0 === a || - a.forEach((a) => { - var b; - return null === (b = a.hostDisconnected) || void 0 === b - ? void 0 - : b.call(a); - }); - } - attributeChangedCallback(a, b, c) { - this._$AK(a, c); - } - _$ES(a, b) { - var c, - d, - f = - 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : sb, - g = this.constructor._$Eh(a, f); - if (void 0 !== g && !0 === f.reflect) { - var h = ( - null !== - (d = - null === (c = f.converter) || void 0 === c - ? void 0 - : c.toAttribute) && void 0 !== d - ? d - : qb.toAttribute - )(b, f.type); - (this._$Ei = a), - null == h ? this.removeAttribute(g) : this.setAttribute(g, h), - (this._$Ei = null); - } - } - _$AK(a, b) { - var c, - d, - f, - g = this.constructor, - h = g._$Eu.get(a); - if (void 0 !== h && this._$Ei !== h) { - var i = g.getPropertyOptions(h), - j = i.converter, - k = - null !== - (f = - null !== - (d = - null === (c = j) || void 0 === c - ? void 0 - : c.fromAttribute) && void 0 !== d - ? d - : "function" == typeof j - ? j - : null) && void 0 !== f - ? f - : qb.fromAttribute; - (this._$Ei = h), (this[h] = k(b, i.type)), (this._$Ei = null); - } - } - requestUpdate(a, b, c) { - var d = !0; - void 0 !== a && - (((c = c || this.constructor.getPropertyOptions(a)).hasChanged || rb)( - this[a], - b - ) - ? (this._$AL.has(a) || this._$AL.set(a, b), - !0 === c.reflect && - this._$Ei !== a && - (void 0 === this._$EC && (this._$EC = new Map()), - this._$EC.set(a, c))) - : (d = !1)), - !this.isUpdatePending && d && (this._$Ep = this._$E_()); - } - _$E_() { - var a = this; - return o(function* () { - a.isUpdatePending = !0; - try { - yield a._$Ep; - } catch (a) { - Promise.reject(a); - } - var b = a.scheduleUpdate(); - return null != b && (yield b), !a.isUpdatePending; - })(); - } - scheduleUpdate() { - return this.performUpdate(); - } - performUpdate() { - var a; - if (this.isUpdatePending) { - this.hasUpdated, - this._$Et && - (this._$Et.forEach((a, b) => (this[b] = a)), - (this._$Et = void 0)); - var b = !1, - c = this._$AL; - try { - (b = this.shouldUpdate(c)), - b - ? (this.willUpdate(c), - null === (a = this._$Eg) || - void 0 === a || - a.forEach((a) => { - var b; - return null === (b = a.hostUpdate) || void 0 === b - ? void 0 - : b.call(a); - }), - this.update(c)) - : this._$EU(); - } catch (a) { - throw ((b = !1), this._$EU(), a); - } - b && this._$AE(c); - } - } - willUpdate() {} - _$AE(a) { - var b; - null === (b = this._$Eg) || - void 0 === b || - b.forEach((a) => { - var b; - return null === (b = a.hostUpdated) || void 0 === b - ? void 0 - : b.call(a); - }), - this.hasUpdated || ((this.hasUpdated = !0), this.firstUpdated(a)), - this.updated(a); - } - _$EU() { - (this._$AL = new Map()), (this.isUpdatePending = !1); - } - get updateComplete() { - return this.getUpdateComplete(); - } - getUpdateComplete() { - return this._$Ep; - } - shouldUpdate() { - return !0; - } - update() { - void 0 !== this._$EC && - (this._$EC.forEach((a, b) => this._$ES(b, this[b], a)), - (this._$EC = void 0)), - this._$EU(); - } - updated() {} - firstUpdated() {} - } - (h.finalized = !0), - (h.elementProperties = new Map()), - (h.elementStyles = []), - (h.shadowRootOptions = { mode: "open" }), - null == pb || pb({ ReactiveElement: h }), - (null !== (n = globalThis.reactiveElementVersions) && void 0 !== n - ? n - : (globalThis.reactiveElementVersions = []) - ).push("1.3.0"); - var a, - tb = globalThis.trustedTypes, - ub = tb ? tb.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, - vb = "lit$".concat((Math.random() + "").slice(9), "$"), - wb = "?" + vb, - xb = "<".concat(wb, ">"), - yb = document, - zb = function () { - var a = - 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : ""; - return yb.createComment(a); - }, - Ab = (a) => - null === a || ("object" != typeof a && "function" != typeof a), - Bb = Array.isArray, - d = (a) => { - var b; - return ( - Bb(a) || - "function" == - typeof (null === (b = a) || void 0 === b - ? void 0 - : b[Symbol.iterator]) - ); - }, - Cb = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, - c = /-->/g, - Db = />/g, - Eb = - />|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g, - f = /'/g, - _ = /"/g, - m = /^(?:script|style|textarea|title)$/i, - g = ((a) => - function (b) { - for ( - var c = arguments.length, d = Array(1 < c ? c - 1 : 0), e = 1; - e < c; - e++ - ) - d[e - 1] = arguments[e]; - return { _$litType$: a, strings: b, values: d }; - })(1), - $ = Symbol.for("lit-noChange"), - b = Symbol.for("lit-nothing"), - Fb = new WeakMap(), - T = (a, b, c) => { - var d, - f, - g = - null !== (d = null == c ? void 0 : c.renderBefore) && void 0 !== d - ? d - : b, - h = g._$litPart$; - if (void 0 === h) { - var i = - null !== (f = null == c ? void 0 : c.renderBefore) && void 0 !== f - ? f - : null; - g._$litPart$ = h = new Kb( - b.insertBefore(zb(), i), - i, - void 0, - null == c ? {} : c - ); - } - return h._$AI(a), h; - }, - Gb = yb.createTreeWalker(yb, 129, null, !1), - Hb = (a, b) => { - for ( - var e, - g = a.length - 1, - i = [], - j = 2 === b ? "" : "", - k = Cb, - l = 0; - l < g; - l++ - ) { - for ( - var n = a[l], o = void 0, p = void 0, q = -1, s = 0; - s < n.length && ((k.lastIndex = s), (p = k.exec(n)), null !== p); + .checkbox-options ha-formfield { + margin-top: 10px; + } + + .overall-config { + margin-bottom: 20px; + } +`;var oi=(t,e)=>t.reduce((t,i)=>(i.defineId?t[i.defineId]=i:i.promise.then(t=>{void 0===e.registry.get(i.name)&&e.registry.define(i.name,t)}),t),{});var si=t=>({name:t,promise:customElements.whenDefined(t).then(()=>customElements.get(t))});const ai=(t,e,i={},n={})=>{const 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};class li extends(ei(Ct)){static get elementDefinitions(){return oi([si("ha-checkbox"),si("ha-formfield"),si("ha-form-string"),si("ha-select"),si("mwc-list-item")],li)}static get styles(){return ri}static get properties(){return{hass:{},_config:{}}}setConfig(t){this._config={...ni,...t}}get entityOptions(){const t=Object.keys(this.hass.states).filter(t=>["switch","light","group"].includes(t.substr(0,t.indexOf("."))));return t.sort(),t}firstUpdated(){this._firstRendered=!0}render(){if(!this.hass)return Q``;let{header:t}=this._config;if(!t&&this._config.entity){let e=this._config.entity.split(".")[1]||"";e&&(e=e.charAt(0).toUpperCase()+e.slice(1),t=e)}const e=this.entityOptions.map(t=>Q`${t}`);return Q` +
+ +
+ +
+ +
+ + ${e} + + +
+ +
+ + +
+ +
+
+ + + + + + +
+ +
+ + + + + + +
+ +
+ + + + + + +
+ +
+ + + + + + +
+ +
+ + + + + + +
+ +
+ + + + + + +
- ) - (s = k.lastIndex), - k === Cb - ? "!--" === p[1] - ? (k = c) - : void 0 === p[1] - ? void 0 === p[2] - ? void 0 !== p[3] && (k = Eb) - : (m.test(p[2]) && (e = RegExp("" === p[0] - ? ((k = null == e ? Cb : e), (q = -1)) - : void 0 === p[1] - ? (q = -2) - : ((q = k.lastIndex - p[2].length), - (o = p[1]), - (k = void 0 === p[3] ? Eb : '"' === p[3] ? _ : f)) - : k === _ || k === f - ? (k = Eb) - : k === c || k === Db - ? (k = Cb) - : ((k = Eb), (e = void 0)); - var u = k === Eb && a[l + 1].startsWith("/>") ? " " : ""; - j += - k === Cb - ? n + xb - : 0 <= q - ? (i.push(o), n.slice(0, q) + "$lit$" + n.slice(q) + vb + u) - : n + vb + (-2 === q ? (i.push(void 0), l) : u); - } - var t = j + (a[g] || "") + (2 === b ? "" : ""); - if (!Array.isArray(a) || !a.hasOwnProperty("raw")) - throw Error("invalid template strings array"); - return [void 0 === ub ? t : ub.createHTML(t), i]; - }; - class Ib { - constructor(b, e) { - var f, - { strings: g, _$litType$: h } = b; - this.parts = []; - var i = 0, - j = 0, - n = g.length - 1, - o = this.parts, - [c, p] = Hb(g, h); - if ( - ((this.el = Ib.createElement(c, e)), - (Gb.currentNode = this.el.content), - 2 === h) - ) { - var a = this.el.content, - q = a.firstChild; - q.remove(), a.append(...q.childNodes); - } - for (; null !== (f = Gb.nextNode()) && o.length < n; ) { - if (1 === f.nodeType) { - if (f.hasAttributes()) { - var s = []; - for (var t of f.getAttributeNames()) - if (t.endsWith("$lit$") || t.startsWith(vb)) { - var u = p[j++]; - if ((s.push(t), void 0 !== u)) { - var v = f.getAttribute(u.toLowerCase() + "$lit$").split(vb), - w = /([.?@])?(.*)/.exec(u); - o.push({ - type: 1, - index: i, - name: w[2], - strings: v, - ctor: - "." === w[1] - ? Lb - : "?" === w[1] - ? k - : "@" === w[1] - ? Mb - : N, - }); - } else o.push({ type: 6, index: i }); - } - for (var x of s) f.removeAttribute(x); - } - if (m.test(f.tagName)) { - var y = f.textContent.split(vb), - z = y.length - 1; - if (0 < z) { - f.textContent = tb ? tb.emptyScript : ""; - for (var A = 0; A < z; A++) - f.append(y[A], zb()), - Gb.nextNode(), - o.push({ type: 2, index: ++i }); - f.append(y[z], zb()); - } - } - } else if (8 === f.nodeType) - if (f.data === wb) o.push({ type: 2, index: i }); - else - for (var B = -1; -1 !== (B = f.data.indexOf(vb, B + 1)); ) - o.push({ type: 7, index: i }), (B += vb.length - 1); - i++; - } - } - static createElement(a) { - var b = yb.createElement("template"); - return (b.innerHTML = a), b; - } - } - class Jb { - constructor(a, b) { - (this.v = []), (this._$AN = void 0), (this._$AD = a), (this._$AM = b); - } - get parentNode() { - return this._$AM.parentNode; - } - get _$AU() { - return this._$AM._$AU; - } - p(a) { - var b, - { - el: { content: e }, - parts: c, - } = this._$AD, - f = ( - null !== (b = null == a ? void 0 : a.creationScope) && void 0 !== b - ? b - : yb - ).importNode(e, !0); - Gb.currentNode = f; - for (var g = Gb.nextNode(), j = 0, h = 0, k = c[0]; void 0 !== k; ) { - if (j === k.index) { - var d = void 0; - 2 === k.type - ? (d = new Kb(g, g.nextSibling, this, a)) - : 1 === k.type - ? (d = new k.ctor(g, k.name, k.strings, this, a)) - : 6 === k.type && (d = new Nb(g, this, a)), - this.v.push(d), - (k = c[++h]); - } - j !== (null == k ? void 0 : k.index) && ((g = Gb.nextNode()), j++); - } - return f; - } - m(a) { - var b = 0; - for (var c of this.v) - void 0 !== c && - (void 0 === c.strings - ? c._$AI(a[b]) - : (c._$AI(a, c, b), (b += c.strings.length - 2))), - b++; - } - } - class Kb { - constructor(a, c, d, f) { - var e; - (this.type = 2), - (this._$AH = b), - (this._$AN = void 0), - (this._$AA = a), - (this._$AB = c), - (this._$AM = d), - (this.options = f), - (this._$Cg = - null === (e = null == f ? void 0 : f.isConnected) || - void 0 === e || - e); - } - get _$AU() { - var a, b; - return null !== - (b = null === (a = this._$AM) || void 0 === a ? void 0 : a._$AU) && - void 0 !== b - ? b - : this._$Cg; - } - get parentNode() { - var a = this._$AA.parentNode, - b = this._$AM; - return void 0 !== b && 11 === a.nodeType && (a = b.parentNode), a; - } - get startNode() { - return this._$AA; - } - get endNode() { - return this._$AB; - } - _$AI(a) { - var c = - 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : this; - (a = Ka(this, a, c)), - Ab(a) - ? a === b || null == a || "" === a - ? (this._$AH !== b && this._$AR(), (this._$AH = b)) - : a !== this._$AH && a !== $ && this.$(a) - : void 0 === a._$litType$ - ? void 0 === a.nodeType - ? d(a) - ? this.S(a) - : this.$(a) - : this.k(a) - : this.T(a); - } - A(a) { - var b = - 1 < arguments.length && arguments[1] !== void 0 - ? arguments[1] - : this._$AB; - return this._$AA.parentNode.insertBefore(a, b); - } - k(a) { - this._$AH !== a && (this._$AR(), (this._$AH = this.A(a))); - } - $(a) { - this._$AH !== b && Ab(this._$AH) - ? (this._$AA.nextSibling.data = a) - : this.k(yb.createTextNode(a)), - (this._$AH = a); - } - T(a) { - var b, - { values: c, _$litType$: d } = a, - e = - "number" == typeof d - ? this._$AC(a) - : (void 0 === d.el && - (d.el = Ib.createElement(d.h, this.options)), - d); - if ((null === (b = this._$AH) || void 0 === b ? void 0 : b._$AD) === e) - this._$AH.m(c); - else { - var f = new Jb(e, this), - g = f.p(this.options); - f.m(c), this.k(g), (this._$AH = f); - } - } - _$AC(a) { - var b = Fb.get(a.strings); - return void 0 === b && Fb.set(a.strings, (b = new Ib(a))), b; - } - S(a) { - Bb(this._$AH) || ((this._$AH = []), this._$AR()); - var b, - c = this._$AH, - d = 0; - for (var f of a) - d === c.length - ? c.push( - (b = new Kb(this.A(zb()), this.A(zb()), this, this.options)) - ) - : (b = c[d]), - b._$AI(f), - d++; - d < c.length && (this._$AR(b && b._$AB.nextSibling, d), (c.length = d)); - } - _$AR() { - var a, - b = - 0 < arguments.length && arguments[0] !== void 0 - ? arguments[0] - : this._$AA.nextSibling, - c = 1 < arguments.length ? arguments[1] : void 0; - for ( - null === (a = this._$AP) || void 0 === a || a.call(this, !1, !0, c); - b && b !== this._$AB; +
+ + + + + + + + + +
- ) { - var d = b.nextSibling; - b.remove(), (b = d); - } - } - setConnected(a) { - var b; - void 0 === this._$AM && - ((this._$Cg = a), - null === (b = this._$AP) || void 0 === b || b.call(this, a)); - } - } - class N { - constructor(a, c, d, f, e) { - (this.type = 1), - (this._$AH = b), - (this._$AN = void 0), - (this.element = a), - (this.name = c), - (this._$AM = f), - (this.options = e), - 2 < d.length || "" !== d[0] || "" !== d[1] - ? ((this._$AH = Array(d.length - 1).fill(new String())), - (this.strings = d)) - : (this._$AH = b); - } - get tagName() { - return this.element.tagName; - } - get _$AU() { - return this._$AM._$AU; - } - _$AI(a) { - var c = - 1 < arguments.length && arguments[1] !== void 0 - ? arguments[1] - : this, - d = 2 < arguments.length ? arguments[2] : void 0, - f = 3 < arguments.length ? arguments[3] : void 0, - e = this.strings, - g = !1; - if (void 0 === e) - (a = Ka(this, a, c, 0)), - (g = !Ab(a) || (a !== this._$AH && a !== $)), - g && (this._$AH = a); - else { - var h, - i, - j = a; - for (a = e[0], h = 0; h < e.length - 1; h++) - (i = Ka(this, j[d + h], c, h)), - i === $ && (i = this._$AH[h]), - g || (g = !Ab(i) || i !== this._$AH[h]), - i === b - ? (a = b) - : a !== b && (a += (null == i ? "" : i) + e[h + 1]), - (this._$AH[h] = i); - } - g && !f && this.C(a); - } - C(a) { - a === b - ? this.element.removeAttribute(this.name) - : this.element.setAttribute(this.name, null == a ? "" : a); - } - } - class Lb extends N { - constructor() { - super(...arguments), (this.type = 3); - } - C(a) { - this.element[this.name] = a === b ? void 0 : a; - } - } - var M = tb ? tb.emptyScript : ""; - class k extends N { - constructor() { - super(...arguments), (this.type = 4); - } - C(a) { - a && a !== b - ? this.element.setAttribute(this.name, M) - : this.element.removeAttribute(this.name); - } - } - class Mb extends N { - constructor(a, b, c, d, e) { - super(a, b, c, d, e), (this.type = 5); - } - _$AI(a) { - var c, - d = - 1 < arguments.length && arguments[1] !== void 0 - ? arguments[1] - : this; - if ( - (a = null !== (c = Ka(this, a, d, 0)) && void 0 !== c ? c : b) !== $ - ) { - var f = this._$AH, - e = - (a === b && f !== b) || - a.capture !== f.capture || - a.once !== f.once || - a.passive !== f.passive, - g = a !== b && (f === b || e); - e && this.element.removeEventListener(this.name, this, f), - g && this.element.addEventListener(this.name, this, a), - (this._$AH = a); - } - } - handleEvent(a) { - var b, c; - "function" == typeof this._$AH - ? this._$AH.call( - null !== - (c = - null === (b = this.options) || void 0 === b - ? void 0 - : b.host) && void 0 !== c - ? c - : this.element, - a - ) - : this._$AH.handleEvent(a); - } - } - class Nb { - constructor(a, b, c) { - (this.element = a), - (this.type = 6), - (this._$AN = void 0), - (this._$AM = b), - (this.options = c); - } - get _$AU() { - return this._$AM._$AU; - } - _$AI(a) { - Ka(this, a); - } - } - var L = window.litHtmlPolyfillSupport; - null == L || L(Ib, Kb), - (null !== (a = globalThis.litHtmlVersions) && void 0 !== a - ? a - : (globalThis.litHtmlVersions = []) - ).push("2.2.0"); - var Ob, Pb; - class Qb extends h { - constructor() { - super(...arguments), - (this.renderOptions = { host: this }), - (this._$Dt = void 0); - } - createRenderRoot() { - var a, - b, - c = super.createRenderRoot(); - return ( - (null !== (a = (b = this.renderOptions).renderBefore) && - void 0 !== a) || - (b.renderBefore = c.firstChild), - c - ); - } - update(a) { - var b = this.render(); - this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), - super.update(a), - (this._$Dt = T(b, this.renderRoot, this.renderOptions)); - } - connectedCallback() { - var a; - super.connectedCallback(), - null === (a = this._$Dt) || void 0 === a || a.setConnected(!0); - } - disconnectedCallback() { - var a; - super.disconnectedCallback(), - null === (a = this._$Dt) || void 0 === a || a.setConnected(!1); - } - render() { - return $; - } - } - (Qb.finalized = !0), - (Qb._$litElement$ = !0), - null === (Ob = globalThis.litElementHydrateSupport) || - void 0 === Ob || - Ob.call(globalThis, { LitElement: Qb }); - var Rb = globalThis.litElementPolyfillSupport; - null == Rb || Rb({ LitElement: Qb }), - (null !== (Pb = globalThis.litElementVersions) && void 0 !== Pb - ? Pb - : (globalThis.litElementVersions = []) - ).push("3.2.0"); - var Sb = mb( - p || - (p = j([ - "\n .light-entity-card {\n padding: 16px;\n }\n\n .light-entity-child-card {\n box-shadow: none !important;\n padding: 0 !important;\n }\n\n .light-entity-card.group {\n padding-bottom: 0;\n padding-top: 0;\n }\n\n .ha-slider-full-width ha-slider {\n width: 100%;\n }\n\n .percent-slider {\n color: var(--primary-text-color);\n margin-top: 5px;\n }\n\n .light-entity-card__header {\n display: flex;\n justify-content: space-between;\n @apply --paper-font-headline;\n line-height: 40px;\n color: var(--primary-text-color);\n font-size: 24px;\n }\n\n .group .light-entity-card__header {\n font-size: 16px;\n }\n\n .light-entity-card-sliders > div {\n margin-top: 10px;\n }\n\n .group .light-entity-card-sliders > div {\n margin-top: 0px;\n }\n\n .light-entity-card__toggle {\n display: flex;\n cursor: pointer;\n }\n\n .light-entity-card__color-picker {\n display: flex;\n justify-content: space-around;\n --ha-color-picker-wheel-borderwidth: 5;\n --ha-color-picker-wheel-bordercolor: white;\n --ha-color-picker-wheel-shadow: none;\n --ha-color-picker-marker-borderwidth: 2;\n --ha-color-picker-marker-bordercolor: white;\n }\n\n .group .light-entity-card__color-picker {\n width: 50%;\n margin: 0 auto;\n }\n \n .light-entity-card-color_temp {\n background-image: var(--ha-slider-background);\n }\n\n .group .light-entity-card-effectlist {\n margin-top: -25px;\n }\n\n .light-entity-card-center {\n display: flex;\n justify-content: center;\n cursor: pointer;\n }\n\n .light-entity-card-toggle {\n margin-right: 5px;\n }\n\n .hidden {\n display: none;\n }\n\n .icon-container {\n margin-top: 4px;\n }\n", - ])) - ), - Tb = { - shorten_cards: !1, - consolidate_entities: !1, - child_card: !1, - hide_header: !1, - header: "", - color_wheel: !0, - persist_features: !1, - brightness: !0, - color_temp: !0, - white_value: !0, - color_picker: !0, - smooth_color_wheel: !1, - speed: !0, - intensity: !0, - force_features: !1, - show_slider_percent: !1, - full_width_sliders: !1, - brightness_icon: "weather-sunny", - white_icon: "file-word-box", - temperature_icon: "thermometer", - speed_icon: "speedometer", - intensity_icon: "transit-connection-horizontal", - }, - Ub = mb( - q || - (q = j([ - "\n .entities {\n padding-top: 10px;\n padding-bottom: 10px;\n display: flex;\n }\n\n .entities ha-formfield {\n display: block;\n margin-bottom: 10px;\n margin-left: 10px;\n }\n\n .checkbox-options {\n display: flex;\n }\n \n mwc-select {\n width: 100%;\n }\n\n .checkbox-options ha-formfield,\n .entities mwc-switch,\n .entities ha-form-string {\n padding-right: 2%;\n width: 48%;\n }\n\n .checkbox-options ha-formfield {\n margin-top: 10px;\n }\n\n .overall-config {\n margin-bottom: 20px;\n }\n", - ])) - ), - Vb = (a, b) => - a.reduce( - (a, c) => ( - c.defineId - ? (a[c.defineId] = c) - : c.promise.then((a) => { - void 0 === b.registry.get(c.name) && - b.registry.define(c.name, a); - }), - a - ), - {} - ), - Wb = (a) => ({ - name: a, - promise: customElements - .whenDefined(a) - .then(() => customElements.get(a)), - }), - Xb = function (a, c) { - return ( - (Xb = - Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && - function (a, c) { - a.__proto__ = c; - }) || - function (a, c) { - for (var b in c) - Object.prototype.hasOwnProperty.call(c, b) && (a[b] = c[b]); - }), - Xb(a, c) - ); - }, - Yb = function () { - return ( - (Yb = - Object.assign || - function (a) { - for (var b, c = 1, d = arguments.length; c < d; c++) - for (var e in ((b = arguments[c]), b)) - Object.prototype.hasOwnProperty.call(b, e) && (a[e] = b[e]); - return a; - }), - Yb.apply(this, arguments) - ); - }, - Zb = (a) => (b, c) => { - if (!b.constructor._observers) { - b.constructor._observers = new Map(); - var d = b.updated; - b.updated = function (a) { - d.call(this, a), - a.forEach((a, b) => { - var c = this.constructor._observers, - d = c.get(b); - d !== void 0 && d.call(this, this[b], a); - }); - }; - } else if (!b.constructor.hasOwnProperty("_observers")) { - var e = b.constructor._observers; - (b.constructor._observers = new Map()), - e.forEach((a, c) => b.constructor._observers.set(c, a)); - } - b.constructor._observers.set(c, a); - }; - class $b { - constructor(a) { - (this.startPress = (b) => { - a().then((a) => { - a && a.startPress(b); - }); - }), - (this.endPress = () => { - a().then((a) => { - a && a.endPress(); - }); - }), - (this.startFocus = () => { - a().then((a) => { - a && a.startFocus(); - }); - }), - (this.endFocus = () => { - a().then((a) => { - a && a.endFocus(); - }); - }), - (this.startHover = () => { - a().then((a) => { - a && a.startHover(); - }); - }), - (this.endHover = () => { - a().then((a) => { - a && a.endHover(); - }); - }); - } - } - var ac, - bc = (a, b) => - "method" === b.kind && b.descriptor && !("value" in b.descriptor) - ? l( - l({}, b), - {}, - { - finisher(c) { - c.createProperty(b.key, a); - }, - } - ) - : { - kind: "field", - key: Symbol(), - placement: "own", - descriptor: {}, - originalKey: b.key, - initializer() { - "function" == typeof b.initializer && - (this[b.key] = b.initializer.call(this)); - }, - finisher(c) { - c.createProperty(b.key, a); - }, - }, - cc = (a) => { - var { finisher: b, descriptor: c } = a; - return (a, d) => { - var e; - if (void 0 === d) { - var f = null !== (e = a.originalKey) && void 0 !== e ? e : a.key, - g = - null == c - ? l(l({}, a), {}, { key: f }) - : { - kind: "method", - placement: "prototype", - key: f, - descriptor: c(a.key), - }; - return ( - null != b && - (g.finisher = function (a) { - b(a, f); - }), - g - ); - } - { - var h = a.constructor; - void 0 !== c && Object.defineProperty(a, d, c(d)), - null == b || b(h, d); - } - }; - }, - dc = - null == - (null === (ac = window.HTMLSlotElement) || void 0 === ac - ? void 0 - : ac.prototype.assignedElements) - ? (a, b) => - a.assignedNodes(b).filter((a) => a.nodeType === Node.ELEMENT_NODE) - : (a, b) => a.assignedElements(b), - ec = { - ATTRIBUTE: 1, - CHILD: 2, - PROPERTY: 3, - BOOLEAN_ATTRIBUTE: 4, - EVENT: 5, - ELEMENT: 6, - }, - fc = (a) => - function () { - for (var b = arguments.length, c = Array(b), d = 0; d < b; d++) - c[d] = arguments[d]; - return { _$litDirective$: a, values: c }; - }; - class gc { - constructor() {} - get _$AU() { - return this._$AM._$AU; - } - _$AT(a, b, c) { - (this._$Ct = a), (this._$AM = b), (this._$Ci = c); - } - _$AS(a, b) { - return this.update(a, b); - } - update(a, b) { - return this.render(...b); - } - } - var hc = fc( - class extends gc { - constructor(a) { - var b; - if ( - (super(a), - a.type !== ec.ATTRIBUTE || - "class" !== a.name || - 2 < - (null === (b = a.strings) || void 0 === b ? void 0 : b.length)) - ) - throw Error( - "`classMap()` can only be used in the `class` attribute and must be the only part in the attribute." - ); - } - render(a) { - return ( - " " + - Object.keys(a) - .filter((b) => a[b]) - .join(" ") + - " " - ); - } - update(a, b) { - var c, - d, - [f] = b; - if (void 0 === this.et) { - for (var e in ((this.et = new Set()), - void 0 !== a.strings && - (this.st = new Set( - a.strings - .join(" ") - .split(/\s/) - .filter((a) => "" !== a) - )), - f)) - !f[e] || - (null !== (c = this.st) && void 0 !== c && c.has(e)) || - this.et.add(e); - return this.render(f); - } - var g = a.element.classList; - for (var h in (this.et.forEach((a) => { - a in f || (g.remove(a), this.et.delete(a)); - }), - f)) { - var i = !!f[h]; - i === this.et.has(h) || - (null === (d = this.st) || void 0 === d ? void 0 : d.has(h)) || - (i - ? (g.add(h), this.et.add(h)) - : (g.remove(h), this.et.delete(h))); - } - return $; - } - } - ); - class ic extends Qb { - constructor() { - super(...arguments), - (this.value = ""), - (this.group = null), - (this.tabindex = -1), - (this.disabled = !1), - (this.twoline = !1), - (this.activated = !1), - (this.graphic = null), - (this.multipleGraphics = !1), - (this.hasMeta = !1), - (this.noninteractive = !1), - (this.selected = !1), - (this.shouldRenderRipple = !1), - (this._managingList = null), - (this.boundOnClick = this.onClick.bind(this)), - (this._firstChanged = !0), - (this._skipPropRequest = !1), - (this.rippleHandlers = new $b( - () => ((this.shouldRenderRipple = !0), this.ripple) - )), - (this.listeners = [ - { - target: this, - eventNames: ["click"], - cb: () => { - this.onClick(); - }, - }, - { - target: this, - eventNames: ["mouseenter"], - cb: this.rippleHandlers.startHover, - }, - { - target: this, - eventNames: ["mouseleave"], - cb: this.rippleHandlers.endHover, - }, - { - target: this, - eventNames: ["focus"], - cb: this.rippleHandlers.startFocus, - }, - { - target: this, - eventNames: ["blur"], - cb: this.rippleHandlers.endFocus, - }, - { - target: this, - eventNames: ["mousedown", "touchstart"], - cb: (a) => { - var b = a.type; - this.onDown("mousedown" === b ? "mouseup" : "touchend", a); - }, - }, - ]); - } - get text() { - var a = this.textContent; - return a ? a.trim() : ""; - } - render() { - var a = this.renderText(), - b = this.graphic ? this.renderGraphic() : g(r || (r = j([""]))), - c = this.hasMeta ? this.renderMeta() : g(s || (s = j([""]))); - return g( - t || (t = j(["\n ", "\n ", "\n ", "\n ", ""])), - this.renderRipple(), - b, - a, - c - ); - } - renderRipple() { - return this.shouldRenderRipple - ? g( - u || - (u = j([ - "\n \n ", - ])), - this.activated - ) - : this.activated - ? g(v || (v = j(['
']))) - : ""; - } - renderGraphic() { - var a = { multi: this.multipleGraphics }; - return g( - w || - (w = j([ - '\n \n \n ', - ])), - hc(a) - ); - } - renderMeta() { - return g( - x || - (x = j([ - '\n \n \n ', - ])) - ); - } - renderText() { - var a = this.twoline ? this.renderTwoline() : this.renderSingleLine(); - return g( - y || - (y = j([ - '\n \n ', - "\n ", - ])), - a - ); - } - renderSingleLine() { - return g(z || (z = j([""]))); - } - renderTwoline() { - return g( - A || - (A = j([ - '\n \n \n \n \n \n \n ', - ])) - ); - } - onClick() { - this.fireRequestSelected(!this.selected, "interaction"); - } - onDown(a, b) { - var c = () => { - window.removeEventListener(a, c), this.rippleHandlers.endPress(); - }; - window.addEventListener(a, c), this.rippleHandlers.startPress(b); - } - fireRequestSelected(a, b) { - if (!this.noninteractive) { - var c = new CustomEvent("request-selected", { - bubbles: !0, - composed: !0, - detail: { source: b, selected: a }, - }); - this.dispatchEvent(c); - } - } - connectedCallback() { - super.connectedCallback(), - this.noninteractive || this.setAttribute("mwc-list-item", ""); - for (var a of this.listeners) - for (var b of a.eventNames) - a.target.addEventListener(b, a.cb, { passive: !0 }); - } - disconnectedCallback() { - super.disconnectedCallback(); - for (var a of this.listeners) - for (var b of a.eventNames) a.target.removeEventListener(b, a.cb); - this._managingList && - (this._managingList.debouncedLayout - ? this._managingList.debouncedLayout(!0) - : this._managingList.layout(!0)); - } - firstUpdated() { - var a = new Event("list-item-rendered", { bubbles: !0, composed: !0 }); - this.dispatchEvent(a); - } - } - Na([Ra("slot")], ic.prototype, "slotElement", void 0), - Na( - [ - (function (a) { - return cc({ - descriptor: () => ({ - get() { - var b = this; - return o(function* () { - var c; - return ( - yield b.updateComplete, - null === (c = b.renderRoot) || void 0 === c - ? void 0 - : c.querySelector(a) - ); - })(); - }, - enumerable: !0, - configurable: !0, - }), - }); - })("mwc-ripple"), - ], - ic.prototype, - "ripple", - void 0 - ), - Na([Pa({ type: String })], ic.prototype, "value", void 0), - Na([Pa({ type: String, reflect: !0 })], ic.prototype, "group", void 0), - Na([Pa({ type: Number, reflect: !0 })], ic.prototype, "tabindex", void 0), - Na( - [ - Pa({ type: Boolean, reflect: !0 }), - Zb(function (a) { - a - ? this.setAttribute("aria-disabled", "true") - : this.setAttribute("aria-disabled", "false"); - }), - ], - ic.prototype, - "disabled", - void 0 - ), - Na([Pa({ type: Boolean, reflect: !0 })], ic.prototype, "twoline", void 0), - Na( - [Pa({ type: Boolean, reflect: !0 })], - ic.prototype, - "activated", - void 0 - ), - Na([Pa({ type: String, reflect: !0 })], ic.prototype, "graphic", void 0), - Na([Pa({ type: Boolean })], ic.prototype, "multipleGraphics", void 0), - Na([Pa({ type: Boolean })], ic.prototype, "hasMeta", void 0), - Na( - [ - Pa({ type: Boolean, reflect: !0 }), - Zb(function (a) { - a - ? (this.removeAttribute("aria-checked"), - this.removeAttribute("mwc-list-item"), - (this.selected = !1), - (this.activated = !1), - (this.tabIndex = -1)) - : this.setAttribute("mwc-list-item", ""); - }), - ], - ic.prototype, - "noninteractive", - void 0 - ), - Na( - [ - Pa({ type: Boolean, reflect: !0 }), - Zb(function (a) { - var b = this.getAttribute("role"), - c = - "gridcell" === b || - "option" === b || - "row" === b || - "tab" === b; - return ( - c && a - ? this.setAttribute("aria-selected", "true") - : c && this.setAttribute("aria-selected", "false"), - this._firstChanged - ? void (this._firstChanged = !1) - : void ( - this._skipPropRequest || - this.fireRequestSelected(a, "property") - ) - ); - }), - ], - ic.prototype, - "selected", - void 0 - ), - Na([Qa()], ic.prototype, "shouldRenderRipple", void 0), - Na([Qa()], ic.prototype, "_managingList", void 0); - var jc = mb( - B || - (B = j([ - ':host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding, 16px);padding-right:var(--mdc-list-side-padding, 16px);outline:none;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host:focus{outline:none}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary, #6200ee);--mdc-ripple-color: var( --mdc-theme-primary, #6200ee )}:host([activated]) .mdc-deprecated-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12);background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-deprecated-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-deprecated-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-deprecated-list-item__meta{width:var(--mdc-list-item-meta-size, 24px);height:var(--mdc-list-item-meta-size, 24px);margin-left:auto;margin-right:0;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-item__meta.multi{width:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:var(--mdc-list-item-meta-size, 24px);line-height:var(--mdc-list-item-meta-size, 24px)}.mdc-deprecated-list-item__meta ::slotted(.material-icons),.mdc-deprecated-list-item__meta ::slotted(mwc-icon){line-height:var(--mdc-list-item-meta-size, 24px) !important}.mdc-deprecated-list-item__meta ::slotted(:not(.material-icons):not(mwc-icon)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit)}[dir=rtl] .mdc-deprecated-list-item__meta,.mdc-deprecated-list-item__meta[dir=rtl]{margin-left:0;margin-right:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:100%;height:100%}.mdc-deprecated-list-item__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mdc-deprecated-list-item__text ::slotted([for]),.mdc-deprecated-list-item__text[for]{pointer-events:none}.mdc-deprecated-list-item__primary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;margin-bottom:-20px;display:block}.mdc-deprecated-list-item__primary-text::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-deprecated-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-deprecated-list-item__secondary-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;display:block}.mdc-deprecated-list-item__secondary-text::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-deprecated-list--dense .mdc-deprecated-list-item__secondary-text{font-size:inherit}* ::slotted(a),a{color:inherit;text-decoration:none}:host([twoline]){height:72px}:host([twoline]) .mdc-deprecated-list-item__text{align-self:flex-start}:host([disabled]),:host([noninteractive]){cursor:default;pointer-events:none}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*){opacity:.38}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__primary-text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__secondary-text ::slotted(*){color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-deprecated-list-item__secondary-text ::slotted(*){color:rgba(0, 0, 0, 0.54);color:var(--mdc-theme-text-secondary-on-background, rgba(0, 0, 0, 0.54))}.mdc-deprecated-list-item__graphic ::slotted(*){background-color:transparent;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-icon-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-group__subheader ::slotted(*){color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 40px);height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 40px);line-height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 40px) !important}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){border-radius:50%}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic{margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 16px)}[dir=rtl] :host([graphic=avatar]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=medium]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=large]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=avatar]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=medium]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=large]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=control]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 16px);margin-right:0}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 24px);height:var(--mdc-list-item-graphic-size, 24px);margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 32px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 24px);line-height:var(--mdc-list-item-graphic-size, 24px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 24px) !important}[dir=rtl] :host([graphic=icon]) .mdc-deprecated-list-item__graphic,:host([graphic=icon]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 32px);margin-right:0}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:56px}:host([graphic=medium]:not([twoLine])),:host([graphic=large]:not([twoLine])){height:72px}:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 56px);height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic.multi,:host([graphic=large]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(*),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 56px);line-height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 56px) !important}:host([graphic=large]){padding-left:0px}', - ])) - ), - kc = (a) => a.nodeType === Node.ELEMENT_NODE, - lc = () => {}, - mc = { - get passive() { - return !1; - }, - }; - document.addEventListener("x", lc, mc), - document.removeEventListener("x", lc); - var nc = function () { - var a = - 0 < arguments.length && arguments[0] !== void 0 - ? arguments[0] - : window.document, - b = a.activeElement, - c = []; - if (!b) return c; - for (; b && (c.push(b), b.shadowRoot); ) b = b.shadowRoot.activeElement; - return c; - }, - oc = (a) => { - var b = nc(); - if (!b.length) return !1; - var c = b[b.length - 1], - d = new Event("check-if-focused", { bubbles: !0, composed: !0 }), - e = [], - f = (a) => { - e = a.composedPath(); - }; - return ( - document.body.addEventListener("check-if-focused", f), - c.dispatchEvent(d), - document.body.removeEventListener("check-if-focused", f), - -1 !== e.indexOf(a) - ); - }; - class pc extends Qb { - click() { - return this.mdcRoot - ? (this.mdcRoot.focus(), void this.mdcRoot.click()) - : void super.click(); - } - createFoundation() { - this.mdcFoundation !== void 0 && this.mdcFoundation.destroy(), - this.mdcFoundationClass && - ((this.mdcFoundation = new this.mdcFoundationClass( - this.createAdapter() - )), - this.mdcFoundation.init()); - } - firstUpdated() { - this.createFoundation(); - } - } - var qc = (function () { - function a(a) { - void 0 === a && (a = {}), (this.adapter = a); - } - return ( - Object.defineProperty(a, "cssClasses", { - get: function () { - return {}; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(a, "strings", { - get: function () { - return {}; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(a, "numbers", { - get: function () { - return {}; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(a, "defaultAdapter", { - get: function () { - return {}; - }, - enumerable: !1, - configurable: !0, - }), - (a.prototype.init = function () {}), - (a.prototype.destroy = function () {}), - a - ); - })(), - rc = { - BG_FOCUSED: "mdc-ripple-upgraded--background-focused", - FG_ACTIVATION: "mdc-ripple-upgraded--foreground-activation", - FG_DEACTIVATION: "mdc-ripple-upgraded--foreground-deactivation", - ROOT: "mdc-ripple-upgraded", - UNBOUNDED: "mdc-ripple-upgraded--unbounded", - }, - sc = { - VAR_FG_SCALE: "--mdc-ripple-fg-scale", - VAR_FG_SIZE: "--mdc-ripple-fg-size", - VAR_FG_TRANSLATE_END: "--mdc-ripple-fg-translate-end", - VAR_FG_TRANSLATE_START: "--mdc-ripple-fg-translate-start", - VAR_LEFT: "--mdc-ripple-left", - VAR_TOP: "--mdc-ripple-top", - }, - tc = { - DEACTIVATION_TIMEOUT_MS: 225, - FG_DEACTIVATION_MS: 150, - INITIAL_ORIGIN_SCALE: 0.6, - PADDING: 10, - TAP_DELAY_MS: 300, - }, - uc = ["touchstart", "pointerdown", "mousedown", "keydown"], - vc = ["touchend", "pointerup", "mouseup", "contextmenu"], - wc = [], - xc = (function (a) { - function b(c) { - var d = a.call(this, Yb(Yb({}, b.defaultAdapter), c)) || this; - return ( - (d.activationAnimationHasEnded = !1), - (d.activationTimer = 0), - (d.fgDeactivationRemovalTimer = 0), - (d.fgScale = "0"), - (d.frame = { width: 0, height: 0 }), - (d.initialSize = 0), - (d.layoutFrame = 0), - (d.maxRadius = 0), - (d.unboundedCoords = { left: 0, top: 0 }), - (d.activationState = d.defaultActivationState()), - (d.activationTimerCallback = function () { - (d.activationAnimationHasEnded = !0), - d.runDeactivationUXLogicIfReady(); - }), - (d.activateHandler = function (a) { - d.activateImpl(a); - }), - (d.deactivateHandler = function () { - d.deactivateImpl(); - }), - (d.focusHandler = function () { - d.handleFocus(); - }), - (d.blurHandler = function () { - d.handleBlur(); - }), - (d.resizeHandler = function () { - d.layout(); - }), - d - ); - } - return ( - Ma(b, a), - Object.defineProperty(b, "cssClasses", { - get: function () { - return rc; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "strings", { - get: function () { - return sc; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "numbers", { - get: function () { - return tc; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "defaultAdapter", { - get: function () { - return { - addClass: function () {}, - browserSupportsCssVars: function () { - return !0; - }, - computeBoundingRect: function () { - return { - top: 0, - right: 0, - bottom: 0, - left: 0, - width: 0, - height: 0, - }; - }, - containsEventTarget: function () { - return !0; - }, - deregisterDocumentInteractionHandler: function () {}, - deregisterInteractionHandler: function () {}, - deregisterResizeHandler: function () {}, - getWindowPageOffset: function () { - return { x: 0, y: 0 }; - }, - isSurfaceActive: function () { - return !0; - }, - isSurfaceDisabled: function () { - return !0; - }, - isUnbounded: function () { - return !0; - }, - registerDocumentInteractionHandler: function () {}, - registerInteractionHandler: function () {}, - registerResizeHandler: function () {}, - removeClass: function () {}, - updateCssVariable: function () {}, - }; - }, - enumerable: !1, - configurable: !0, - }), - (b.prototype.init = function () { - var a = this, - c = this.supportsPressRipple(); - if ((this.registerRootHandlers(c), c)) { - var d = b.cssClasses, - e = d.ROOT, - f = d.UNBOUNDED; - requestAnimationFrame(function () { - a.adapter.addClass(e), - a.adapter.isUnbounded() && - (a.adapter.addClass(f), a.layoutInternal()); - }); - } - }), - (b.prototype.destroy = function () { - var a = this; - if (this.supportsPressRipple()) { - this.activationTimer && - (clearTimeout(this.activationTimer), - (this.activationTimer = 0), - this.adapter.removeClass(b.cssClasses.FG_ACTIVATION)), - this.fgDeactivationRemovalTimer && - (clearTimeout(this.fgDeactivationRemovalTimer), - (this.fgDeactivationRemovalTimer = 0), - this.adapter.removeClass(b.cssClasses.FG_DEACTIVATION)); - var c = b.cssClasses, - d = c.ROOT, - e = c.UNBOUNDED; - requestAnimationFrame(function () { - a.adapter.removeClass(d), - a.adapter.removeClass(e), - a.removeCssVars(); - }); - } - this.deregisterRootHandlers(), - this.deregisterDeactivationHandlers(); - }), - (b.prototype.activate = function (a) { - this.activateImpl(a); - }), - (b.prototype.deactivate = function () { - this.deactivateImpl(); - }), - (b.prototype.layout = function () { - var a = this; - this.layoutFrame && cancelAnimationFrame(this.layoutFrame), - (this.layoutFrame = requestAnimationFrame(function () { - a.layoutInternal(), (a.layoutFrame = 0); - })); - }), - (b.prototype.setUnbounded = function (a) { - var c = b.cssClasses.UNBOUNDED; - a ? this.adapter.addClass(c) : this.adapter.removeClass(c); - }), - (b.prototype.handleFocus = function () { - var a = this; - requestAnimationFrame(function () { - return a.adapter.addClass(b.cssClasses.BG_FOCUSED); - }); - }), - (b.prototype.handleBlur = function () { - var a = this; - requestAnimationFrame(function () { - return a.adapter.removeClass(b.cssClasses.BG_FOCUSED); - }); - }), - (b.prototype.supportsPressRipple = function () { - return this.adapter.browserSupportsCssVars(); - }), - (b.prototype.defaultActivationState = function () { - return { - activationEvent: void 0, - hasDeactivationUXRun: !1, - isActivated: !1, - isProgrammatic: !1, - wasActivatedByPointer: !1, - wasElementMadeActive: !1, - }; - }), - (b.prototype.registerRootHandlers = function (a) { - var b, c; - if (a) { - try { - for (var d, e = Oa(uc), f = e.next(); !f.done; f = e.next()) - (d = f.value), - this.adapter.registerInteractionHandler( - d, - this.activateHandler - ); - } catch (a) { - b = { error: a }; - } finally { - try { - f && !f.done && (c = e.return) && c.call(e); - } finally { - if (b) throw b.error; - } - } - this.adapter.isUnbounded() && - this.adapter.registerResizeHandler(this.resizeHandler); - } - this.adapter.registerInteractionHandler("focus", this.focusHandler), - this.adapter.registerInteractionHandler("blur", this.blurHandler); - }), - (b.prototype.registerDeactivationHandlers = function (a) { - var b, c; - if ("keydown" === a.type) - this.adapter.registerInteractionHandler( - "keyup", - this.deactivateHandler - ); - else - try { - for (var d, e = Oa(vc), f = e.next(); !f.done; f = e.next()) - (d = f.value), - this.adapter.registerDocumentInteractionHandler( - d, - this.deactivateHandler - ); - } catch (a) { - b = { error: a }; - } finally { - try { - f && !f.done && (c = e.return) && c.call(e); - } finally { - if (b) throw b.error; - } - } - }), - (b.prototype.deregisterRootHandlers = function () { - var a, b; - try { - for (var c, d = Oa(uc), e = d.next(); !e.done; e = d.next()) - (c = e.value), - this.adapter.deregisterInteractionHandler( - c, - this.activateHandler - ); - } catch (b) { - a = { error: b }; - } finally { - try { - e && !e.done && (b = d.return) && b.call(d); - } finally { - if (a) throw a.error; - } - } - this.adapter.deregisterInteractionHandler( - "focus", - this.focusHandler - ), - this.adapter.deregisterInteractionHandler( - "blur", - this.blurHandler - ), - this.adapter.isUnbounded() && - this.adapter.deregisterResizeHandler(this.resizeHandler); - }), - (b.prototype.deregisterDeactivationHandlers = function () { - var a, b; - this.adapter.deregisterInteractionHandler( - "keyup", - this.deactivateHandler - ); - try { - for (var c, d = Oa(vc), e = d.next(); !e.done; e = d.next()) - (c = e.value), - this.adapter.deregisterDocumentInteractionHandler( - c, - this.deactivateHandler - ); - } catch (b) { - a = { error: b }; - } finally { - try { - e && !e.done && (b = d.return) && b.call(d); - } finally { - if (a) throw a.error; - } - } - }), - (b.prototype.removeCssVars = function () { - var a = this, - c = b.strings, - d = Object.keys(c); - d.forEach(function (b) { - 0 === b.indexOf("VAR_") && - a.adapter.updateCssVariable(c[b], null); - }); - }), - (b.prototype.activateImpl = function (a) { - var b = this; - if (!this.adapter.isSurfaceDisabled()) { - var c = this.activationState; - if (!c.isActivated) { - var d = this.previousActivationEvent, - e = d && void 0 !== a && d.type !== a.type; - if (!e) { - (c.isActivated = !0), - (c.isProgrammatic = void 0 === a), - (c.activationEvent = a), - (c.wasActivatedByPointer = - !c.isProgrammatic && - void 0 !== a && - ("mousedown" === a.type || - "touchstart" === a.type || - "pointerdown" === a.type)); - var f = - void 0 !== a && - 0 < wc.length && - wc.some(function (a) { - return b.adapter.containsEventTarget(a); - }); - return f - ? void this.resetActivationState() - : void (void 0 !== a && - (wc.push(a.target), - this.registerDeactivationHandlers(a)), - (c.wasElementMadeActive = this.checkElementMadeActive(a)), - c.wasElementMadeActive && this.animateActivation(), - requestAnimationFrame(function () { - (wc = []), - c.wasElementMadeActive || - void 0 === a || - (" " !== a.key && 32 !== a.keyCode) || - ((c.wasElementMadeActive = - b.checkElementMadeActive(a)), - c.wasElementMadeActive && b.animateActivation()), - c.wasElementMadeActive || - (b.activationState = b.defaultActivationState()); - })); - } - } - } - }), - (b.prototype.checkElementMadeActive = function (a) { - return ( - void 0 === a || - "keydown" !== a.type || - this.adapter.isSurfaceActive() - ); - }), - (b.prototype.animateActivation = function () { - var a = this, - c = b.strings, - d = c.VAR_FG_TRANSLATE_START, - e = c.VAR_FG_TRANSLATE_END, - f = b.cssClasses, - g = f.FG_DEACTIVATION, - h = f.FG_ACTIVATION, - i = b.numbers.DEACTIVATION_TIMEOUT_MS; - this.layoutInternal(); - var j = "", - k = ""; - if (!this.adapter.isUnbounded()) { - var l = this.getFgTranslationCoordinates(), - m = l.startPoint, - n = l.endPoint; - (j = m.x + "px, " + m.y + "px"), (k = n.x + "px, " + n.y + "px"); - } - this.adapter.updateCssVariable(d, j), - this.adapter.updateCssVariable(e, k), - clearTimeout(this.activationTimer), - clearTimeout(this.fgDeactivationRemovalTimer), - this.rmBoundedActivationClasses(), - this.adapter.removeClass(g), - this.adapter.computeBoundingRect(), - this.adapter.addClass(h), - (this.activationTimer = setTimeout(function () { - a.activationTimerCallback(); - }, i)); - }), - (b.prototype.getFgTranslationCoordinates = function () { - var a, - b = this.activationState, - c = b.activationEvent, - d = b.wasActivatedByPointer; - (a = d - ? Wa( - c, - this.adapter.getWindowPageOffset(), - this.adapter.computeBoundingRect() - ) - : { x: this.frame.width / 2, y: this.frame.height / 2 }), - (a = { - x: a.x - this.initialSize / 2, - y: a.y - this.initialSize / 2, - }); - var e = { - x: this.frame.width / 2 - this.initialSize / 2, - y: this.frame.height / 2 - this.initialSize / 2, - }; - return { startPoint: a, endPoint: e }; - }), - (b.prototype.runDeactivationUXLogicIfReady = function () { - var a = this, - c = b.cssClasses.FG_DEACTIVATION, - d = this.activationState, - e = d.hasDeactivationUXRun, - f = d.isActivated; - (e || !f) && - this.activationAnimationHasEnded && - (this.rmBoundedActivationClasses(), - this.adapter.addClass(c), - (this.fgDeactivationRemovalTimer = setTimeout(function () { - a.adapter.removeClass(c); - }, tc.FG_DEACTIVATION_MS))); - }), - (b.prototype.rmBoundedActivationClasses = function () { - var a = b.cssClasses.FG_ACTIVATION; - this.adapter.removeClass(a), - (this.activationAnimationHasEnded = !1), - this.adapter.computeBoundingRect(); - }), - (b.prototype.resetActivationState = function () { - var a = this; - (this.previousActivationEvent = - this.activationState.activationEvent), - (this.activationState = this.defaultActivationState()), - setTimeout(function () { - return (a.previousActivationEvent = void 0); - }, b.numbers.TAP_DELAY_MS); - }), - (b.prototype.deactivateImpl = function () { - var a = this, - b = this.activationState; - if (b.isActivated) { - var c = Yb({}, b); - b.isProgrammatic - ? (requestAnimationFrame(function () { - a.animateDeactivation(c); - }), - this.resetActivationState()) - : (this.deregisterDeactivationHandlers(), - requestAnimationFrame(function () { - (a.activationState.hasDeactivationUXRun = !0), - a.animateDeactivation(c), - a.resetActivationState(); - })); - } - }), - (b.prototype.animateDeactivation = function (a) { - var b = a.wasActivatedByPointer, - c = a.wasElementMadeActive; - (b || c) && this.runDeactivationUXLogicIfReady(); - }), - (b.prototype.layoutInternal = function () { - var a = Math.floor, - c = Math.max, - d = this; - this.frame = this.adapter.computeBoundingRect(); - var e = c(this.frame.height, this.frame.width); - this.maxRadius = this.adapter.isUnbounded() - ? e - : (function getBoundedRadius() { - var a = Math.sqrt, - c = Math.pow, - e = a(c(d.frame.width, 2) + c(d.frame.height, 2)); - return e + b.numbers.PADDING; - })(); - var f = a(e * b.numbers.INITIAL_ORIGIN_SCALE); - (this.initialSize = - this.adapter.isUnbounded() && 0 != f % 2 ? f - 1 : f), - (this.fgScale = "" + this.maxRadius / this.initialSize), - this.updateLayoutCssVars(); - }), - (b.prototype.updateLayoutCssVars = function () { - var a = Math.round, - c = b.strings, - d = c.VAR_FG_SIZE, - e = c.VAR_LEFT, - f = c.VAR_TOP, - g = c.VAR_FG_SCALE; - this.adapter.updateCssVariable(d, this.initialSize + "px"), - this.adapter.updateCssVariable(g, this.fgScale), - this.adapter.isUnbounded() && - ((this.unboundedCoords = { - left: a(this.frame.width / 2 - this.initialSize / 2), - top: a(this.frame.height / 2 - this.initialSize / 2), - }), - this.adapter.updateCssVariable( - e, - this.unboundedCoords.left + "px" - ), - this.adapter.updateCssVariable( - f, - this.unboundedCoords.top + "px" - )); - }), - b - ); - })(qc), - yc = fc( - class extends gc { - constructor(a) { - var b; - if ( - (super(a), - a.type !== ec.ATTRIBUTE || - "style" !== a.name || - 2 < - (null === (b = a.strings) || void 0 === b - ? void 0 - : b.length)) - ) - throw Error( - "The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute." - ); - } - render(a) { - return Object.keys(a).reduce((b, c) => { - var d = a[c]; - return null == d - ? b - : b + - "" - .concat( - (c = c - .replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&") - .toLowerCase()), - ":" - ) - .concat(d, ";"); - }, ""); - } - update(a, b) { - var [c] = b, - { style: d } = a.element; - if (void 0 === this.ct) { - for (var e in ((this.ct = new Set()), c)) this.ct.add(e); - return this.render(c); - } - for (var f in (this.ct.forEach((a) => { - null == c[a] && - (this.ct.delete(a), - a.includes("-") ? d.removeProperty(a) : (d[a] = "")); - }), - c)) { - var g = c[f]; - null != g && - (this.ct.add(f), - f.includes("-") ? d.setProperty(f, g) : (d[f] = g)); - } - return $; - } - } - ); - class zc extends pc { - constructor() { - super(...arguments), - (this.primary = !1), - (this.accent = !1), - (this.unbounded = !1), - (this.disabled = !1), - (this.activated = !1), - (this.selected = !1), - (this.internalUseStateLayerCustomProperties = !1), - (this.hovering = !1), - (this.bgFocused = !1), - (this.fgActivation = !1), - (this.fgDeactivation = !1), - (this.fgScale = ""), - (this.fgSize = ""), - (this.translateStart = ""), - (this.translateEnd = ""), - (this.leftPos = ""), - (this.topPos = ""), - (this.mdcFoundationClass = xc); - } - get isActive() { - return Ua(this.parentElement || this, ":active"); - } - createAdapter() { - return { - browserSupportsCssVars: () => !0, - isUnbounded: () => this.unbounded, - isSurfaceActive: () => this.isActive, - isSurfaceDisabled: () => this.disabled, - addClass: (a) => { - switch (a) { - case "mdc-ripple-upgraded--background-focused": - this.bgFocused = !0; - break; - case "mdc-ripple-upgraded--foreground-activation": - this.fgActivation = !0; - break; - case "mdc-ripple-upgraded--foreground-deactivation": - this.fgDeactivation = !0; - break; - default: - } - }, - removeClass: (a) => { - switch (a) { - case "mdc-ripple-upgraded--background-focused": - this.bgFocused = !1; - break; - case "mdc-ripple-upgraded--foreground-activation": - this.fgActivation = !1; - break; - case "mdc-ripple-upgraded--foreground-deactivation": - this.fgDeactivation = !1; - break; - default: - } - }, - containsEventTarget: () => !0, - registerInteractionHandler: () => void 0, - deregisterInteractionHandler: () => void 0, - registerDocumentInteractionHandler: () => void 0, - deregisterDocumentInteractionHandler: () => void 0, - registerResizeHandler: () => void 0, - deregisterResizeHandler: () => void 0, - updateCssVariable: (a, b) => { - switch (a) { - case "--mdc-ripple-fg-scale": - this.fgScale = b; - break; - case "--mdc-ripple-fg-size": - this.fgSize = b; - break; - case "--mdc-ripple-fg-translate-end": - this.translateEnd = b; - break; - case "--mdc-ripple-fg-translate-start": - this.translateStart = b; - break; - case "--mdc-ripple-left": - this.leftPos = b; - break; - case "--mdc-ripple-top": - this.topPos = b; - break; - default: - } - }, - computeBoundingRect: () => - (this.parentElement || this).getBoundingClientRect(), - getWindowPageOffset: () => ({ - x: window.pageXOffset, - y: window.pageYOffset, - }), - }; - } - startPress(a) { - this.waitForFoundation(() => { - this.mdcFoundation.activate(a); - }); - } - endPress() { - this.waitForFoundation(() => { - this.mdcFoundation.deactivate(); - }); - } - startFocus() { - this.waitForFoundation(() => { - this.mdcFoundation.handleFocus(); - }); - } - endFocus() { - this.waitForFoundation(() => { - this.mdcFoundation.handleBlur(); - }); - } - startHover() { - this.hovering = !0; - } - endHover() { - this.hovering = !1; - } - waitForFoundation(a) { - this.mdcFoundation ? a() : this.updateComplete.then(a); - } - update(a) { - a.has("disabled") && this.disabled && this.endHover(), super.update(a); - } - render() { - var a = this.activated && (this.primary || !this.accent), - b = this.selected && (this.primary || !this.accent), - c = { - "mdc-ripple-surface--accent": this.accent, - "mdc-ripple-surface--primary--activated": a, - "mdc-ripple-surface--accent--activated": - this.accent && this.activated, - "mdc-ripple-surface--primary--selected": b, - "mdc-ripple-surface--accent--selected": - this.accent && this.selected, - "mdc-ripple-surface--disabled": this.disabled, - "mdc-ripple-surface--hover": this.hovering, - "mdc-ripple-surface--primary": this.primary, - "mdc-ripple-surface--selected": this.selected, - "mdc-ripple-upgraded--background-focused": this.bgFocused, - "mdc-ripple-upgraded--foreground-activation": this.fgActivation, - "mdc-ripple-upgraded--foreground-deactivation": this.fgDeactivation, - "mdc-ripple-upgraded--unbounded": this.unbounded, - "mdc-ripple-surface--internal-use-state-layer-custom-properties": - this.internalUseStateLayerCustomProperties, - }; - return g( - C || - (C = j([ - '\n
', - ])), - hc(c), - yc({ - "--mdc-ripple-fg-scale": this.fgScale, - "--mdc-ripple-fg-size": this.fgSize, - "--mdc-ripple-fg-translate-end": this.translateEnd, - "--mdc-ripple-fg-translate-start": this.translateStart, - "--mdc-ripple-left": this.leftPos, - "--mdc-ripple-top": this.topPos, - }) - ); - } - } - Na([Ra(".mdc-ripple-surface")], zc.prototype, "mdcRoot", void 0), - Na([Pa({ type: Boolean })], zc.prototype, "primary", void 0), - Na([Pa({ type: Boolean })], zc.prototype, "accent", void 0), - Na([Pa({ type: Boolean })], zc.prototype, "unbounded", void 0), - Na([Pa({ type: Boolean })], zc.prototype, "disabled", void 0), - Na([Pa({ type: Boolean })], zc.prototype, "activated", void 0), - Na([Pa({ type: Boolean })], zc.prototype, "selected", void 0), - Na( - [Pa({ type: Boolean })], - zc.prototype, - "internalUseStateLayerCustomProperties", - void 0 - ), - Na([Qa()], zc.prototype, "hovering", void 0), - Na([Qa()], zc.prototype, "bgFocused", void 0), - Na([Qa()], zc.prototype, "fgActivation", void 0), - Na([Qa()], zc.prototype, "fgDeactivation", void 0), - Na([Qa()], zc.prototype, "fgScale", void 0), - Na([Qa()], zc.prototype, "fgSize", void 0), - Na([Qa()], zc.prototype, "translateStart", void 0), - Na([Qa()], zc.prototype, "translateEnd", void 0), - Na([Qa()], zc.prototype, "leftPos", void 0), - Na([Qa()], zc.prototype, "topPos", void 0); - var Ac = mb( - D || - (D = j([ - '.mdc-ripple-surface{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:block}:host .mdc-ripple-surface{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;will-change:unset}.mdc-ripple-surface--primary::before,.mdc-ripple-surface--primary::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary:hover::before,.mdc-ripple-surface--primary.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--primary.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before,.mdc-ripple-surface--primary--activated::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--activated:hover::before,.mdc-ripple-surface--primary--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--primary--selected::before,.mdc-ripple-surface--primary--selected::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--selected:hover::before,.mdc-ripple-surface--primary--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent::before,.mdc-ripple-surface--accent::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent:hover::before,.mdc-ripple-surface--accent.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--accent.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before,.mdc-ripple-surface--accent--activated::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--activated:hover::before,.mdc-ripple-surface--accent--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--accent--selected::before,.mdc-ripple-surface--accent--selected::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--selected:hover::before,.mdc-ripple-surface--accent--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--disabled{opacity:0}.mdc-ripple-surface--internal-use-state-layer-custom-properties::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties::after{background-color:#000;background-color:var(--mdc-ripple-hover-state-layer-color, #000)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:hover::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-state-layer-opacity, 0.04)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}', - ])) - ); - class Bc extends La(zc) { - static get defineId() { - return "mwc-ripple"; - } - static get elementDefinitions() { - return Vb([], Bc); - } - static get styles() { - return Ac; - } - } - class Cc extends La(ic) { - static get defineId() { - return "mwc-list-item"; - } - static get elementDefinitions() { - return Vb([Bc], Cc); - } - static get styles() { - return jc; - } - } - var Dc = { - UNKNOWN: "Unknown", - BACKSPACE: "Backspace", - ENTER: "Enter", - SPACEBAR: "Spacebar", - PAGE_UP: "PageUp", - PAGE_DOWN: "PageDown", - END: "End", - HOME: "Home", - ARROW_LEFT: "ArrowLeft", - ARROW_UP: "ArrowUp", - ARROW_RIGHT: "ArrowRight", - ARROW_DOWN: "ArrowDown", - DELETE: "Delete", - ESCAPE: "Escape", - TAB: "Tab", - }, - Ec = new Set(); - Ec.add(Dc.BACKSPACE), - Ec.add(Dc.ENTER), - Ec.add(Dc.SPACEBAR), - Ec.add(Dc.PAGE_UP), - Ec.add(Dc.PAGE_DOWN), - Ec.add(Dc.END), - Ec.add(Dc.HOME), - Ec.add(Dc.ARROW_LEFT), - Ec.add(Dc.ARROW_UP), - Ec.add(Dc.ARROW_RIGHT), - Ec.add(Dc.ARROW_DOWN), - Ec.add(Dc.DELETE), - Ec.add(Dc.ESCAPE), - Ec.add(Dc.TAB); - var Fc = { - BACKSPACE: 8, - ENTER: 13, - SPACEBAR: 32, - PAGE_UP: 33, - PAGE_DOWN: 34, - END: 35, - HOME: 36, - ARROW_LEFT: 37, - ARROW_UP: 38, - ARROW_RIGHT: 39, - ARROW_DOWN: 40, - DELETE: 46, - ESCAPE: 27, - TAB: 9, - }, - Gc = new Map(); - Gc.set(Fc.BACKSPACE, Dc.BACKSPACE), - Gc.set(Fc.ENTER, Dc.ENTER), - Gc.set(Fc.SPACEBAR, Dc.SPACEBAR), - Gc.set(Fc.PAGE_UP, Dc.PAGE_UP), - Gc.set(Fc.PAGE_DOWN, Dc.PAGE_DOWN), - Gc.set(Fc.END, Dc.END), - Gc.set(Fc.HOME, Dc.HOME), - Gc.set(Fc.ARROW_LEFT, Dc.ARROW_LEFT), - Gc.set(Fc.ARROW_UP, Dc.ARROW_UP), - Gc.set(Fc.ARROW_RIGHT, Dc.ARROW_RIGHT), - Gc.set(Fc.ARROW_DOWN, Dc.ARROW_DOWN), - Gc.set(Fc.DELETE, Dc.DELETE), - Gc.set(Fc.ESCAPE, Dc.ESCAPE), - Gc.set(Fc.TAB, Dc.TAB); - var Hc, - Ic, - Jc, - Kc, - Lc = new Set([ - Dc.PAGE_UP, - Dc.PAGE_DOWN, - Dc.END, - Dc.HOME, - Dc.ARROW_LEFT, - Dc.ARROW_UP, - Dc.ARROW_RIGHT, - Dc.ARROW_DOWN, - ]), - Mc = { - LIST_ITEM_ACTIVATED_CLASS: "mdc-list-item--activated", - LIST_ITEM_CLASS: "mdc-list-item", - LIST_ITEM_DISABLED_CLASS: "mdc-list-item--disabled", - LIST_ITEM_SELECTED_CLASS: "mdc-list-item--selected", - LIST_ITEM_TEXT_CLASS: "mdc-list-item__text", - LIST_ITEM_PRIMARY_TEXT_CLASS: "mdc-list-item__primary-text", - ROOT: "mdc-list", - }, - Nc = - ((Hc = {}), - (Hc["" + Mc.LIST_ITEM_ACTIVATED_CLASS] = "mdc-list-item--activated"), - (Hc["" + Mc.LIST_ITEM_CLASS] = "mdc-list-item"), - (Hc["" + Mc.LIST_ITEM_DISABLED_CLASS] = "mdc-list-item--disabled"), - (Hc["" + Mc.LIST_ITEM_SELECTED_CLASS] = "mdc-list-item--selected"), - (Hc["" + Mc.LIST_ITEM_PRIMARY_TEXT_CLASS] = - "mdc-list-item__primary-text"), - (Hc["" + Mc.ROOT] = "mdc-list"), - Hc), - Oc = - ((Ic = {}), - (Ic["" + Mc.LIST_ITEM_ACTIVATED_CLASS] = - "mdc-deprecated-list-item--activated"), - (Ic["" + Mc.LIST_ITEM_CLASS] = "mdc-deprecated-list-item"), - (Ic["" + Mc.LIST_ITEM_DISABLED_CLASS] = - "mdc-deprecated-list-item--disabled"), - (Ic["" + Mc.LIST_ITEM_SELECTED_CLASS] = - "mdc-deprecated-list-item--selected"), - (Ic["" + Mc.LIST_ITEM_TEXT_CLASS] = "mdc-deprecated-list-item__text"), - (Ic["" + Mc.LIST_ITEM_PRIMARY_TEXT_CLASS] = - "mdc-deprecated-list-item__primary-text"), - (Ic["" + Mc.ROOT] = "mdc-deprecated-list"), - Ic), - Pc = { - ACTION_EVENT: "MDCList:action", - ARIA_CHECKED: "aria-checked", - ARIA_CHECKED_CHECKBOX_SELECTOR: - '[role="checkbox"][aria-checked="true"]', - ARIA_CHECKED_RADIO_SELECTOR: '[role="radio"][aria-checked="true"]', - ARIA_CURRENT: "aria-current", - ARIA_DISABLED: "aria-disabled", - ARIA_ORIENTATION: "aria-orientation", - ARIA_ORIENTATION_HORIZONTAL: "horizontal", - ARIA_ROLE_CHECKBOX_SELECTOR: '[role="checkbox"]', - ARIA_SELECTED: "aria-selected", - ARIA_INTERACTIVE_ROLES_SELECTOR: '[role="listbox"], [role="menu"]', - ARIA_MULTI_SELECTABLE_SELECTOR: '[aria-multiselectable="true"]', - CHECKBOX_RADIO_SELECTOR: 'input[type="checkbox"], input[type="radio"]', - CHECKBOX_SELECTOR: 'input[type="checkbox"]', - CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: - "\n ." + - Mc.LIST_ITEM_CLASS + - " button:not(:disabled),\n ." + - Mc.LIST_ITEM_CLASS + - " a,\n ." + - Oc[Mc.LIST_ITEM_CLASS] + - " button:not(:disabled),\n ." + - Oc[Mc.LIST_ITEM_CLASS] + - " a\n ", - DEPRECATED_SELECTOR: ".mdc-deprecated-list", - FOCUSABLE_CHILD_ELEMENTS: - "\n ." + - Mc.LIST_ITEM_CLASS + - " button:not(:disabled),\n ." + - Mc.LIST_ITEM_CLASS + - " a,\n ." + - Mc.LIST_ITEM_CLASS + - ' input[type="radio"]:not(:disabled),\n .' + - Mc.LIST_ITEM_CLASS + - ' input[type="checkbox"]:not(:disabled),\n .' + - Oc[Mc.LIST_ITEM_CLASS] + - " button:not(:disabled),\n ." + - Oc[Mc.LIST_ITEM_CLASS] + - " a,\n ." + - Oc[Mc.LIST_ITEM_CLASS] + - ' input[type="radio"]:not(:disabled),\n .' + - Oc[Mc.LIST_ITEM_CLASS] + - ' input[type="checkbox"]:not(:disabled)\n ', - RADIO_SELECTOR: 'input[type="radio"]', - SELECTED_ITEM_SELECTOR: '[aria-selected="true"], [aria-current="true"]', - }, - Qc = { UNSET_INDEX: -1, TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS: 300 }, - Rc = ["input", "button", "textarea", "select"], - Sc = function (a) { - var b = a.target; - if (b) { - var c = ("" + b.tagName).toLowerCase(); - -1 === Rc.indexOf(c) && a.preventDefault(); - } - }, - Tc = - !( - null === - (Kc = - null === (Jc = window.ShadyDOM) || void 0 === Jc - ? void 0 - : Jc.inUse) || void 0 === Kc - ) && Kc; - class Uc extends pc { - constructor() { - super(...arguments), - (this.disabled = !1), - (this.containingForm = null), - (this.formDataListener = (a) => { - this.disabled || this.setFormData(a.formData); - }); - } - findFormElement() { - if (!this.shadowRoot || Tc) return null; - var a = this.getRootNode(), - b = a.querySelectorAll("form"); - for (var c of Array.from(b)) if (c.contains(this)) return c; - return null; - } - connectedCallback() { - var a; - super.connectedCallback(), - (this.containingForm = this.findFormElement()), - null === (a = this.containingForm) || void 0 === a - ? void 0 - : a.addEventListener("formdata", this.formDataListener); - } - disconnectedCallback() { - var a; - super.disconnectedCallback(), - null === (a = this.containingForm) || void 0 === a - ? void 0 - : a.removeEventListener("formdata", this.formDataListener), - (this.containingForm = null); - } - click() { - this.formElement && - !this.disabled && - (this.formElement.focus(), this.formElement.click()); - } - firstUpdated() { - super.firstUpdated(), - this.shadowRoot && - this.mdcRoot.addEventListener("change", (a) => { - this.dispatchEvent(new Event("change", a)); - }); - } - } - (Uc.shadowRootOptions = { mode: "open", delegatesFocus: !0 }), - Na([Pa({ type: Boolean })], Uc.prototype, "disabled", void 0); - var Vc = { - LABEL_FLOAT_ABOVE: "mdc-floating-label--float-above", - LABEL_REQUIRED: "mdc-floating-label--required", - LABEL_SHAKE: "mdc-floating-label--shake", - ROOT: "mdc-floating-label", - }, - Wc = (function (a) { - function b(c) { - var d = a.call(this, Yb(Yb({}, b.defaultAdapter), c)) || this; - return ( - (d.shakeAnimationEndHandler = function () { - d.handleShakeAnimationEnd(); - }), - d - ); - } - return ( - Ma(b, a), - Object.defineProperty(b, "cssClasses", { - get: function () { - return Vc; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "defaultAdapter", { - get: function () { - return { - addClass: function () {}, - removeClass: function () {}, - getWidth: function () { - return 0; - }, - registerInteractionHandler: function () {}, - deregisterInteractionHandler: function () {}, - }; - }, - enumerable: !1, - configurable: !0, - }), - (b.prototype.init = function () { - this.adapter.registerInteractionHandler( - "animationend", - this.shakeAnimationEndHandler - ); - }), - (b.prototype.destroy = function () { - this.adapter.deregisterInteractionHandler( - "animationend", - this.shakeAnimationEndHandler - ); - }), - (b.prototype.getWidth = function () { - return this.adapter.getWidth(); - }), - (b.prototype.shake = function (a) { - var c = b.cssClasses.LABEL_SHAKE; - a ? this.adapter.addClass(c) : this.adapter.removeClass(c); - }), - (b.prototype.float = function (a) { - var c = b.cssClasses, - d = c.LABEL_FLOAT_ABOVE, - e = c.LABEL_SHAKE; - a - ? this.adapter.addClass(d) - : (this.adapter.removeClass(d), this.adapter.removeClass(e)); - }), - (b.prototype.setRequired = function (a) { - var c = b.cssClasses.LABEL_REQUIRED; - a ? this.adapter.addClass(c) : this.adapter.removeClass(c); - }), - (b.prototype.handleShakeAnimationEnd = function () { - var a = b.cssClasses.LABEL_SHAKE; - this.adapter.removeClass(a); - }), - b - ); - })(qc), - Xc = (a) => ({ - addClass: (b) => a.classList.add(b), - removeClass: (b) => a.classList.remove(b), - getWidth: () => a.scrollWidth, - registerInteractionHandler: (b, c) => { - a.addEventListener(b, c); - }, - deregisterInteractionHandler: (b, c) => { - a.removeEventListener(b, c); - }, - }); - var Yc = fc( - class extends gc { - constructor(a) { - switch ( - (super(a), - (this.foundation = null), - (this.previousPart = null), - a.type) - ) { - case ec.ATTRIBUTE: - case ec.PROPERTY: - break; - default: - throw new Error( - "FloatingLabel directive only support attribute and property parts" - ); - } - } - update(a, b) { - var [c] = b; - if (a !== this.previousPart) { - this.foundation && this.foundation.destroy(), - (this.previousPart = a); - var d = a.element; - d.classList.add("mdc-floating-label"); - var e = Xc(d); - (this.foundation = new Wc(e)), this.foundation.init(); - } - return this.render(c); - } - render() { - return this.foundation; - } - } - ), - Zc = { - LINE_RIPPLE_ACTIVE: "mdc-line-ripple--active", - LINE_RIPPLE_DEACTIVATING: "mdc-line-ripple--deactivating", - }, - $c = (function (a) { - function b(c) { - var d = a.call(this, Yb(Yb({}, b.defaultAdapter), c)) || this; - return ( - (d.transitionEndHandler = function (a) { - d.handleTransitionEnd(a); - }), - d - ); - } - return ( - Ma(b, a), - Object.defineProperty(b, "cssClasses", { - get: function () { - return Zc; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "defaultAdapter", { - get: function () { - return { - addClass: function () {}, - removeClass: function () {}, - hasClass: function () { - return !1; - }, - setStyle: function () {}, - registerEventHandler: function () {}, - deregisterEventHandler: function () {}, - }; - }, - enumerable: !1, - configurable: !0, - }), - (b.prototype.init = function () { - this.adapter.registerEventHandler( - "transitionend", - this.transitionEndHandler - ); - }), - (b.prototype.destroy = function () { - this.adapter.deregisterEventHandler( - "transitionend", - this.transitionEndHandler - ); - }), - (b.prototype.activate = function () { - this.adapter.removeClass(Zc.LINE_RIPPLE_DEACTIVATING), - this.adapter.addClass(Zc.LINE_RIPPLE_ACTIVE); - }), - (b.prototype.setRippleCenter = function (a) { - this.adapter.setStyle("transform-origin", a + "px center"); - }), - (b.prototype.deactivate = function () { - this.adapter.addClass(Zc.LINE_RIPPLE_DEACTIVATING); - }), - (b.prototype.handleTransitionEnd = function (a) { - var b = this.adapter.hasClass(Zc.LINE_RIPPLE_DEACTIVATING); - "opacity" === a.propertyName && - b && - (this.adapter.removeClass(Zc.LINE_RIPPLE_ACTIVE), - this.adapter.removeClass(Zc.LINE_RIPPLE_DEACTIVATING)); - }), - b - ); - })(qc), - _c = (a) => ({ - addClass: (b) => a.classList.add(b), - removeClass: (b) => a.classList.remove(b), - hasClass: (b) => a.classList.contains(b), - setStyle: (b, c) => a.style.setProperty(b, c), - registerEventHandler: (b, c) => { - a.addEventListener(b, c); - }, - deregisterEventHandler: (b, c) => { - a.removeEventListener(b, c); - }, - }); - var ad, - bd = fc( - class extends gc { - constructor(a) { - switch ( - (super(a), - (this.previousPart = null), - (this.foundation = null), - a.type) - ) { - case ec.ATTRIBUTE: - case ec.PROPERTY: - return; - default: - throw new Error( - "LineRipple only support attribute and property parts." - ); - } - } - update(a) { - if (this.previousPart !== a) { - this.foundation && this.foundation.destroy(), - (this.previousPart = a); - var b = a.element; - b.classList.add("mdc-line-ripple"); - var c = _c(b); - (this.foundation = new $c(c)), this.foundation.init(); - } - return this.render(); - } - render() { - return this.foundation; - } - } - ), - cd = { - ANCHOR: "mdc-menu-surface--anchor", - ANIMATING_CLOSED: "mdc-menu-surface--animating-closed", - ANIMATING_OPEN: "mdc-menu-surface--animating-open", - FIXED: "mdc-menu-surface--fixed", - IS_OPEN_BELOW: "mdc-menu-surface--is-open-below", - OPEN: "mdc-menu-surface--open", - ROOT: "mdc-menu-surface", - }, - dd = { - CLOSED_EVENT: "MDCMenuSurface:closed", - CLOSING_EVENT: "MDCMenuSurface:closing", - OPENED_EVENT: "MDCMenuSurface:opened", - FOCUSABLE_ELEMENTS: - 'button:not(:disabled), [href]:not([aria-disabled="true"]), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])', - }, - ed = { - TRANSITION_OPEN_DURATION: 120, - TRANSITION_CLOSE_DURATION: 75, - MARGIN_TO_EDGE: 32, - ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67, - TOUCH_EVENT_WAIT_MS: 30, - }; - (function (a) { - (a[(a.BOTTOM = 1)] = "BOTTOM"), - (a[(a.CENTER = 2)] = "CENTER"), - (a[(a.RIGHT = 4)] = "RIGHT"), - (a[(a.FLIP_RTL = 8)] = "FLIP_RTL"); - })(ad || (ad = {})); - var fd; - (function (a) { - (a[(a.TOP_LEFT = 0)] = "TOP_LEFT"), - (a[(a.TOP_RIGHT = 4)] = "TOP_RIGHT"), - (a[(a.BOTTOM_LEFT = 1)] = "BOTTOM_LEFT"), - (a[(a.BOTTOM_RIGHT = 5)] = "BOTTOM_RIGHT"), - (a[(a.TOP_START = 8)] = "TOP_START"), - (a[(a.TOP_END = 12)] = "TOP_END"), - (a[(a.BOTTOM_START = 9)] = "BOTTOM_START"), - (a[(a.BOTTOM_END = 13)] = "BOTTOM_END"); - })(fd || (fd = {})); - var gd = { - ACTIVATED: "mdc-select--activated", - DISABLED: "mdc-select--disabled", - FOCUSED: "mdc-select--focused", - INVALID: "mdc-select--invalid", - MENU_INVALID: "mdc-select__menu--invalid", - OUTLINED: "mdc-select--outlined", - REQUIRED: "mdc-select--required", - ROOT: "mdc-select", - WITH_LEADING_ICON: "mdc-select--with-leading-icon", - }, - hd = { - ARIA_CONTROLS: "aria-controls", - ARIA_DESCRIBEDBY: "aria-describedby", - ARIA_SELECTED_ATTR: "aria-selected", - CHANGE_EVENT: "MDCSelect:change", - HIDDEN_INPUT_SELECTOR: 'input[type="hidden"]', - LABEL_SELECTOR: ".mdc-floating-label", - LEADING_ICON_SELECTOR: ".mdc-select__icon", - LINE_RIPPLE_SELECTOR: ".mdc-line-ripple", - MENU_SELECTOR: ".mdc-select__menu", - OUTLINE_SELECTOR: ".mdc-notched-outline", - SELECTED_TEXT_SELECTOR: ".mdc-select__selected-text", - SELECT_ANCHOR_SELECTOR: ".mdc-select__anchor", - VALUE_ATTR: "data-value", - }, - id = { - LABEL_SCALE: 0.75, - UNSET_INDEX: -1, - CLICK_DEBOUNCE_TIMEOUT_MS: 330, - }, - jd = (function (a) { - function b(c, d) { - void 0 === d && (d = {}); - var e = a.call(this, Yb(Yb({}, b.defaultAdapter), c)) || this; - return ( - (e.disabled = !1), - (e.isMenuOpen = !1), - (e.useDefaultValidation = !0), - (e.customValidity = !0), - (e.lastSelectedIndex = id.UNSET_INDEX), - (e.clickDebounceTimeout = 0), - (e.recentlyClicked = !1), - (e.leadingIcon = d.leadingIcon), - (e.helperText = d.helperText), - e - ); - } - return ( - Ma(b, a), - Object.defineProperty(b, "cssClasses", { - get: function () { - return gd; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "numbers", { - get: function () { - return id; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "strings", { - get: function () { - return hd; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "defaultAdapter", { - get: function () { - return { - addClass: function () {}, - removeClass: function () {}, - hasClass: function () { - return !1; - }, - activateBottomLine: function () {}, - deactivateBottomLine: function () {}, - getSelectedIndex: function () { - return -1; - }, - setSelectedIndex: function () {}, - hasLabel: function () { - return !1; - }, - floatLabel: function () {}, - getLabelWidth: function () { - return 0; - }, - setLabelRequired: function () {}, - hasOutline: function () { - return !1; - }, - notchOutline: function () {}, - closeOutline: function () {}, - setRippleCenter: function () {}, - notifyChange: function () {}, - setSelectedText: function () {}, - isSelectAnchorFocused: function () { - return !1; - }, - getSelectAnchorAttr: function () { - return ""; - }, - setSelectAnchorAttr: function () {}, - removeSelectAnchorAttr: function () {}, - addMenuClass: function () {}, - removeMenuClass: function () {}, - openMenu: function () {}, - closeMenu: function () {}, - getAnchorElement: function () { - return null; - }, - setMenuAnchorElement: function () {}, - setMenuAnchorCorner: function () {}, - setMenuWrapFocus: function () {}, - focusMenuItemAtIndex: function () {}, - getMenuItemCount: function () { - return 0; - }, - getMenuItemValues: function () { - return []; - }, - getMenuItemTextAtIndex: function () { - return ""; - }, - isTypeaheadInProgress: function () { - return !1; - }, - typeaheadMatchItem: function () { - return -1; - }, - }; - }, - enumerable: !1, - configurable: !0, - }), - (b.prototype.getSelectedIndex = function () { - return this.adapter.getSelectedIndex(); - }), - (b.prototype.setSelectedIndex = function (a, b, c) { - void 0 === b && (b = !1), - void 0 === c && (c = !1), - a >= this.adapter.getMenuItemCount() || - (a === id.UNSET_INDEX - ? this.adapter.setSelectedText("") - : this.adapter.setSelectedText( - this.adapter.getMenuItemTextAtIndex(a).trim() - ), - this.adapter.setSelectedIndex(a), - b && this.adapter.closeMenu(), - !c && this.lastSelectedIndex !== a && this.handleChange(), - (this.lastSelectedIndex = a)); - }), - (b.prototype.setValue = function (a, b) { - void 0 === b && (b = !1); - var c = this.adapter.getMenuItemValues().indexOf(a); - this.setSelectedIndex(c, !1, b); - }), - (b.prototype.getValue = function () { - var a = this.adapter.getSelectedIndex(), - b = this.adapter.getMenuItemValues(); - return a === id.UNSET_INDEX ? "" : b[a]; - }), - (b.prototype.getDisabled = function () { - return this.disabled; - }), - (b.prototype.setDisabled = function (a) { - (this.disabled = a), - this.disabled - ? (this.adapter.addClass(gd.DISABLED), this.adapter.closeMenu()) - : this.adapter.removeClass(gd.DISABLED), - this.leadingIcon && this.leadingIcon.setDisabled(this.disabled), - this.disabled - ? this.adapter.removeSelectAnchorAttr("tabindex") - : this.adapter.setSelectAnchorAttr("tabindex", "0"), - this.adapter.setSelectAnchorAttr( - "aria-disabled", - this.disabled.toString() - ); - }), - (b.prototype.openMenu = function () { - this.adapter.addClass(gd.ACTIVATED), - this.adapter.openMenu(), - (this.isMenuOpen = !0), - this.adapter.setSelectAnchorAttr("aria-expanded", "true"); - }), - (b.prototype.setHelperTextContent = function (a) { - this.helperText && this.helperText.setContent(a); - }), - (b.prototype.layout = function () { - if (this.adapter.hasLabel()) { - var a = 0 < this.getValue().length, - b = this.adapter.hasClass(gd.FOCUSED), - c = a || b, - d = this.adapter.hasClass(gd.REQUIRED); - this.notchOutline(c), - this.adapter.floatLabel(c), - this.adapter.setLabelRequired(d); - } - }), - (b.prototype.layoutOptions = function () { - var a = this.adapter.getMenuItemValues(), - b = a.indexOf(this.getValue()); - this.setSelectedIndex(b, !1, !0); - }), - (b.prototype.handleMenuOpened = function () { - if (0 !== this.adapter.getMenuItemValues().length) { - var a = this.getSelectedIndex(), - b = 0 <= a ? a : 0; - this.adapter.focusMenuItemAtIndex(b); - } - }), - (b.prototype.handleMenuClosing = function () { - this.adapter.setSelectAnchorAttr("aria-expanded", "false"); - }), - (b.prototype.handleMenuClosed = function () { - this.adapter.removeClass(gd.ACTIVATED), - (this.isMenuOpen = !1), - this.adapter.isSelectAnchorFocused() || this.blur(); - }), - (b.prototype.handleChange = function () { - this.layout(), this.adapter.notifyChange(this.getValue()); - var a = this.adapter.hasClass(gd.REQUIRED); - a && this.useDefaultValidation && this.setValid(this.isValid()); - }), - (b.prototype.handleMenuItemAction = function (a) { - this.setSelectedIndex(a, !0); - }), - (b.prototype.handleFocus = function () { - this.adapter.addClass(gd.FOCUSED), - this.layout(), - this.adapter.activateBottomLine(); - }), - (b.prototype.handleBlur = function () { - this.isMenuOpen || this.blur(); - }), - (b.prototype.handleClick = function (a) { - if (!(this.disabled || this.recentlyClicked)) - return ( - this.setClickDebounceTimeout(), - this.isMenuOpen - ? void this.adapter.closeMenu() - : void (this.adapter.setRippleCenter(a), this.openMenu()) - ); - }), - (b.prototype.handleKeydown = function (a) { - if (!this.isMenuOpen && this.adapter.hasClass(gd.FOCUSED)) { - var b = Xa(a) === Dc.ENTER, - c = Xa(a) === Dc.SPACEBAR, - d = Xa(a) === Dc.ARROW_UP, - e = Xa(a) === Dc.ARROW_DOWN, - f = a.ctrlKey || a.metaKey; - if ( - !f && - ((!c && a.key && 1 === a.key.length) || - (c && this.adapter.isTypeaheadInProgress())) - ) { - var g = c ? " " : a.key, - h = this.adapter.typeaheadMatchItem( - g, - this.getSelectedIndex() - ); - return ( - 0 <= h && this.setSelectedIndex(h), void a.preventDefault() - ); - } - (b || c || d || e) && - (d && 0 < this.getSelectedIndex() - ? this.setSelectedIndex(this.getSelectedIndex() - 1) - : e && - this.getSelectedIndex() < - this.adapter.getMenuItemCount() - 1 && - this.setSelectedIndex(this.getSelectedIndex() + 1), - this.openMenu(), - a.preventDefault()); - } - }), - (b.prototype.notchOutline = function (a) { - if (this.adapter.hasOutline()) { - var b = this.adapter.hasClass(gd.FOCUSED); - if (a) { - var c = id.LABEL_SCALE, - d = this.adapter.getLabelWidth() * c; - this.adapter.notchOutline(d); - } else b || this.adapter.closeOutline(); - } - }), - (b.prototype.setLeadingIconAriaLabel = function (a) { - this.leadingIcon && this.leadingIcon.setAriaLabel(a); - }), - (b.prototype.setLeadingIconContent = function (a) { - this.leadingIcon && this.leadingIcon.setContent(a); - }), - (b.prototype.getUseDefaultValidation = function () { - return this.useDefaultValidation; - }), - (b.prototype.setUseDefaultValidation = function (a) { - this.useDefaultValidation = a; - }), - (b.prototype.setValid = function (a) { - this.useDefaultValidation || (this.customValidity = a), - this.adapter.setSelectAnchorAttr("aria-invalid", (!a).toString()), - a - ? (this.adapter.removeClass(gd.INVALID), - this.adapter.removeMenuClass(gd.MENU_INVALID)) - : (this.adapter.addClass(gd.INVALID), - this.adapter.addMenuClass(gd.MENU_INVALID)), - this.syncHelperTextValidity(a); - }), - (b.prototype.isValid = function () { - return this.useDefaultValidation && - this.adapter.hasClass(gd.REQUIRED) && - !this.adapter.hasClass(gd.DISABLED) - ? this.getSelectedIndex() !== id.UNSET_INDEX && - (0 !== this.getSelectedIndex() || !!this.getValue()) - : this.customValidity; - }), - (b.prototype.setRequired = function (a) { - a - ? this.adapter.addClass(gd.REQUIRED) - : this.adapter.removeClass(gd.REQUIRED), - this.adapter.setSelectAnchorAttr("aria-required", a.toString()), - this.adapter.setLabelRequired(a); - }), - (b.prototype.getRequired = function () { - return "true" === this.adapter.getSelectAnchorAttr("aria-required"); - }), - (b.prototype.init = function () { - var a = this.adapter.getAnchorElement(); - a && - (this.adapter.setMenuAnchorElement(a), - this.adapter.setMenuAnchorCorner(fd.BOTTOM_START)), - this.adapter.setMenuWrapFocus(!1), - this.setDisabled(this.adapter.hasClass(gd.DISABLED)), - this.syncHelperTextValidity(!this.adapter.hasClass(gd.INVALID)), - this.layout(), - this.layoutOptions(); - }), - (b.prototype.blur = function () { - this.adapter.removeClass(gd.FOCUSED), - this.layout(), - this.adapter.deactivateBottomLine(); - var a = this.adapter.hasClass(gd.REQUIRED); - a && this.useDefaultValidation && this.setValid(this.isValid()); - }), - (b.prototype.syncHelperTextValidity = function (a) { - if (this.helperText) { - this.helperText.setValidity(a); - var b = this.helperText.isVisible(), - c = this.helperText.getId(); - b && c - ? this.adapter.setSelectAnchorAttr(hd.ARIA_DESCRIBEDBY, c) - : this.adapter.removeSelectAnchorAttr(hd.ARIA_DESCRIBEDBY); - } - }), - (b.prototype.setClickDebounceTimeout = function () { - var a = this; - clearTimeout(this.clickDebounceTimeout), - (this.clickDebounceTimeout = setTimeout(function () { - a.recentlyClicked = !1; - }, id.CLICK_DEBOUNCE_TIMEOUT_MS)), - (this.recentlyClicked = !0); - }), - b - ); - })(qc), - kd = (a) => (null == a ? b : a), - ld = function () { - var a = - 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : {}, - b = {}; - for (var c in a) b[c] = a[c]; - return Object.assign( - { - badInput: !1, - customError: !1, - patternMismatch: !1, - rangeOverflow: !1, - rangeUnderflow: !1, - stepMismatch: !1, - tooLong: !1, - tooShort: !1, - typeMismatch: !1, - valid: !0, - valueMissing: !1, - }, - b - ); - }; - class md extends Uc { - constructor() { - super(...arguments), - (this.mdcFoundationClass = jd), - (this.disabled = !1), - (this.outlined = !1), - (this.label = ""), - (this.outlineOpen = !1), - (this.outlineWidth = 0), - (this.value = ""), - (this.name = ""), - (this.selectedText = ""), - (this.icon = ""), - (this.menuOpen = !1), - (this.helper = ""), - (this.validateOnInitialRender = !1), - (this.validationMessage = ""), - (this.required = !1), - (this.naturalMenuWidth = !1), - (this.isUiValid = !0), - (this.fixedMenuPosition = !1), - (this.typeaheadState = Ya()), - (this.sortedIndexByFirstChar = new Map()), - (this.menuElement_ = null), - (this.listeners = []), - (this.onBodyClickBound = () => void 0), - (this._menuUpdateComplete = null), - (this.valueSetDirectly = !1), - (this.validityTransform = null), - (this._validity = ld()); - } - get items() { - return ( - this.menuElement_ || (this.menuElement_ = this.menuElement), - this.menuElement_ ? this.menuElement_.items : [] - ); - } - get selected() { - var a = this.menuElement; - return a ? a.selected : null; - } - get index() { - var a = this.menuElement; - return a ? a.index : -1; - } - get shouldRenderHelperText() { - return !!this.helper || !!this.validationMessage; - } - get validity() { - return this._checkValidity(this.value), this._validity; - } - render() { - var a = { - "mdc-select--disabled": this.disabled, - "mdc-select--no-label": !this.label, - "mdc-select--filled": !this.outlined, - "mdc-select--outlined": this.outlined, - "mdc-select--with-leading-icon": !!this.icon, - "mdc-select--required": this.required, - "mdc-select--invalid": !this.isUiValid, - }, - b = { "mdc-select__menu--invalid": !this.isUiValid }, - c = !this.label ? void 0 : "label", - d = this.shouldRenderHelperText ? "helper-text" : void 0; - return g( - E || - (E = j([ - '\n \n \n \n
\n ', - '\n \n \n \n \n \n \n \n \n \n ', - '\n
\n \n ', - ])) - ); - } - renderOutline() { - return this.outlined - ? g( - G || - (G = j([ - "\n \n ', - "\n ", - ])), - this.outlineWidth, - this.outlineOpen, - this.renderLabel() - ) - : b; - } - renderLabel() { - return this.label - ? g( - H || - (H = j([ - "\n ', - "\n ", - ])), - Yc(this.label), - this.label - ) - : b; - } - renderLeadingIcon() { - return this.icon - ? g( - I || - (I = j([ - '
', - "
", - ])), - this.icon - ) - : b; - } - renderLineRipple() { - return this.outlined - ? b - : g( - J || - (J = j([ - "\n \n ", - ])), - bd() - ); - } - renderHelperText() { - if (!this.shouldRenderHelperText) return b; - var a = this.validationMessage && !this.isUiValid; - return g( - K || - (K = j([ - '\n ', - "

", - ])), - hc({ "mdc-select-helper-text--validation-msg": a }), - a ? this.validationMessage : this.helper - ); - } - createAdapter() { - var a = this; - return Object.assign(Object.assign({}, Va(this.mdcRoot)), { - activateBottomLine: () => { - this.lineRippleElement && - this.lineRippleElement.lineRippleFoundation.activate(); - }, - deactivateBottomLine: () => { - this.lineRippleElement && - this.lineRippleElement.lineRippleFoundation.deactivate(); - }, - hasLabel: () => !!this.label, - floatLabel: (a) => { - this.labelElement && - this.labelElement.floatingLabelFoundation.float(a); - }, - getLabelWidth: () => - this.labelElement - ? this.labelElement.floatingLabelFoundation.getWidth() - : 0, - setLabelRequired: (a) => { - this.labelElement && - this.labelElement.floatingLabelFoundation.setRequired(a); - }, - hasOutline: () => this.outlined, - notchOutline: (a) => { - var b = this.outlineElement; - b && - !this.outlineOpen && - ((this.outlineWidth = a), (this.outlineOpen = !0)); - }, - closeOutline: () => { - this.outlineElement && (this.outlineOpen = !1); - }, - setRippleCenter: (a) => { - if (this.lineRippleElement) { - var b = this.lineRippleElement.lineRippleFoundation; - b.setRippleCenter(a); - } - }, - notifyChange: (function () { - var b = o(function* (b) { - if (a.valueSetDirectly || b !== a.value) { - (a.valueSetDirectly = !1), - (a.value = b), - yield a.updateComplete; - var c = new Event("change", { bubbles: !0 }); - a.dispatchEvent(c); - } - }); - return function () { - return b.apply(this, arguments); - }; - })(), - setSelectedText: (a) => (this.selectedText = a), - isSelectAnchorFocused: () => { - var a = this.anchorElement; - if (!a) return !1; - var b = a.getRootNode(); - return b.activeElement === a; - }, - getSelectAnchorAttr: (a) => { - var b = this.anchorElement; - return b ? b.getAttribute(a) : null; - }, - setSelectAnchorAttr: (a, b) => { - var c = this.anchorElement; - c && c.setAttribute(a, b); - }, - removeSelectAnchorAttr: (a) => { - var b = this.anchorElement; - b && b.removeAttribute(a); - }, - openMenu: () => { - this.menuOpen = !0; - }, - closeMenu: () => { - this.menuOpen = !1; - }, - addMenuClass: () => void 0, - removeMenuClass: () => void 0, - getAnchorElement: () => this.anchorElement, - setMenuAnchorElement: () => {}, - setMenuAnchorCorner: () => { - var a = this.menuElement; - a && (a.corner = "BOTTOM_START"); - }, - setMenuWrapFocus: (a) => { - var b = this.menuElement; - b && (b.wrapFocus = a); - }, - focusMenuItemAtIndex: (a) => { - var b = this.menuElement; - if (b) { - var c = b.items[a]; - c && c.focus(); - } - }, - getMenuItemCount: () => { - var a = this.menuElement; - return a ? a.items.length : 0; - }, - getMenuItemValues: () => { - var a = this.menuElement; - if (!a) return []; - var b = a.items; - return b.map((a) => a.value); - }, - getMenuItemTextAtIndex: (a) => { - var b = this.menuElement; - if (!b) return ""; - var c = b.items[a]; - return c ? c.text : ""; - }, - getSelectedIndex: () => this.index, - setSelectedIndex: () => void 0, - isTypeaheadInProgress: () => cb(this.typeaheadState), - typeaheadMatchItem: (a, b) => { - if (!this.menuElement) return -1; - var c = { - focusItemAtIndex: (a) => { - this.menuElement.focusItemAtIndex(a); - }, - focusedItemIndex: b - ? b - : this.menuElement.getFocusedItemIndex(), - nextChar: a, - sortedIndexByFirstChar: this.sortedIndexByFirstChar, - skipFocus: !1, - isItemAtIndexDisabled: (a) => this.items[a].disabled, - }, - d = $a(c, this.typeaheadState); - return -1 !== d && this.select(d), d; - }, - }); - } - checkValidity() { - var a = this._checkValidity(this.value); - if (!a) { - var b = new Event("invalid", { bubbles: !1, cancelable: !0 }); - this.dispatchEvent(b); - } - return a; - } - reportValidity() { - var a = this.checkValidity(); - return (this.isUiValid = a), a; - } - _checkValidity(a) { - var b = this.formElement.validity, - c = ld(b); - if (this.validityTransform) { - var d = this.validityTransform(a, c); - c = Object.assign(Object.assign({}, c), d); - } - return (this._validity = c), this._validity.valid; - } - setCustomValidity(a) { - (this.validationMessage = a), this.formElement.setCustomValidity(a); - } - getUpdateComplete() { - var a = () => super.getUpdateComplete, - b = this; - return o(function* () { - yield b._menuUpdateComplete; - var c = yield a().call(b); - return c; - })(); - } - firstUpdated() { - var a = () => super.firstUpdated, - b = this; - return o(function* () { - var c = b.menuElement; - if ( - (c && - ((b._menuUpdateComplete = c.updateComplete), - yield b._menuUpdateComplete), - a().call(b), - (b.mdcFoundation.isValid = () => !0), - (b.mdcFoundation.setValid = () => void 0), - b.mdcFoundation.setDisabled(b.disabled), - b.validateOnInitialRender && b.reportValidity(), - !b.selected) - ) { - !b.items.length && - b.slotElement && - b.slotElement.assignedNodes({ flatten: !0 }).length && - (yield new Promise((a) => requestAnimationFrame(a)), - yield b.layout()); - var d = b.items.length && "" === b.items[0].value; - if (!b.value && d) return void b.select(0); - b.selectByValue(b.value); - } - b.sortedIndexByFirstChar = Za(b.items.length, (a) => b.items[a].text); - })(); - } - onItemsUpdated() { - this.sortedIndexByFirstChar = Za( - this.items.length, - (a) => this.items[a].text - ); - } - select(a) { - var b = this.menuElement; - b && b.select(a); - } - selectByValue(a) { - for (var b, c = -1, d = 0; d < this.items.length; d++) - if (((b = this.items[d]), b.value === a)) { - c = d; - break; - } - (this.valueSetDirectly = !0), - this.select(c), - this.mdcFoundation.handleChange(); - } - disconnectedCallback() { - super.disconnectedCallback(); - for (var a of this.listeners) - a.target.removeEventListener(a.name, a.cb); - } - focus() { - var a = new CustomEvent("focus"), - b = this.anchorElement; - b && (b.dispatchEvent(a), b.focus()); - } - blur() { - var a = new CustomEvent("blur"), - b = this.anchorElement; - b && (b.dispatchEvent(a), b.blur()); - } - onFocus() { - this.mdcFoundation && this.mdcFoundation.handleFocus(); - } - onBlur() { - this.mdcFoundation && this.mdcFoundation.handleBlur(); - var a = this.menuElement; - a && !a.open && this.reportValidity(); - } - onClick(a) { - if (this.mdcFoundation) { - this.focus(); - var b = a.target.getBoundingClientRect(), - c = 0; - c = "touches" in a ? a.touches[0].clientX : a.clientX; - var d = c - b.left; - this.mdcFoundation.handleClick(d); - } - } - onKeydown(a) { - var b = Xa(a) === Dc.ARROW_UP, - c = Xa(a) === Dc.ARROW_DOWN; - if (c || b) { - var d = b && 0 < this.index, - e = c && this.index < this.items.length - 1; - return ( - d ? this.select(this.index - 1) : e && this.select(this.index + 1), - a.preventDefault(), - void this.mdcFoundation.openMenu() - ); - } - this.mdcFoundation.handleKeydown(a); - } - handleTypeahead(a) { - if (this.menuElement) { - var b = this.menuElement.getFocusedItemIndex(), - c = kc(a.target) ? a.target : null, - d = !!c && c.hasAttribute("mwc-list-item"), - e = { - event: a, - focusItemAtIndex: (a) => { - this.menuElement.focusItemAtIndex(a); - }, - focusedItemIndex: b, - isTargetListItem: d, - sortedIndexByFirstChar: this.sortedIndexByFirstChar, - isItemAtIndexDisabled: (a) => this.items[a].disabled, - }; - eb(e, this.typeaheadState); - } - } - onSelected(a) { - var b = this; - return o(function* () { - b.mdcFoundation || (yield b.updateComplete), - b.mdcFoundation.handleMenuItemAction(a.detail.index); - var c = b.items[a.detail.index]; - c && (b.value = c.value); - })(); - } - onOpened() { - this.mdcFoundation && - ((this.menuOpen = !0), this.mdcFoundation.handleMenuOpened()); - } - onClosed() { - this.mdcFoundation && - ((this.menuOpen = !1), this.mdcFoundation.handleMenuClosed()); - } - setFormData(a) { - this.name && null !== this.selected && a.append(this.name, this.value); - } - layout() { - var a = arguments, - b = this; - return o(function* () { - var c = !(0 < a.length && void 0 !== a[0]) || a[0]; - b.mdcFoundation && b.mdcFoundation.layout(), yield b.updateComplete; - var d = b.menuElement; - d && d.layout(c); - var e = b.labelElement; - if (!e) return void (b.outlineOpen = !1); - var f = !!b.label && !!b.value; - if ((e.floatingLabelFoundation.float(f), !!b.outlined)) { - (b.outlineOpen = f), yield b.updateComplete; - var g = e.floatingLabelFoundation.getWidth(); - b.outlineOpen && (b.outlineWidth = g); - } - })(); - } - layoutOptions() { - var a = this; - return o(function* () { - a.mdcFoundation && a.mdcFoundation.layoutOptions(); - })(); - } - } - Na([Ra(".mdc-select")], md.prototype, "mdcRoot", void 0), - Na([Ra(".formElement")], md.prototype, "formElement", void 0), - Na([Ra("slot")], md.prototype, "slotElement", void 0), - Na([Ra("select")], md.prototype, "nativeSelectElement", void 0), - Na([Ra("input")], md.prototype, "nativeInputElement", void 0), - Na([Ra(".mdc-line-ripple")], md.prototype, "lineRippleElement", void 0), - Na([Ra(".mdc-floating-label")], md.prototype, "labelElement", void 0), - Na([Ra("mwc-notched-outline")], md.prototype, "outlineElement", void 0), - Na([Ra(".mdc-menu")], md.prototype, "menuElement", void 0), - Na([Ra(".mdc-select__anchor")], md.prototype, "anchorElement", void 0), - Na( - [ - Pa({ type: Boolean, attribute: "disabled", reflect: !0 }), - Zb(function (a) { - this.mdcFoundation && this.mdcFoundation.setDisabled(a); - }), - ], - md.prototype, - "disabled", - void 0 - ), - Na( - [ - Pa({ type: Boolean }), - Zb(function (a, b) { - b !== void 0 && this.outlined !== b && this.layout(!1); - }), - ], - md.prototype, - "outlined", - void 0 - ), - Na( - [ - Pa({ type: String }), - Zb(function (a, b) { - b !== void 0 && this.label !== b && this.layout(!1); - }), - ], - md.prototype, - "label", - void 0 - ), - Na([Qa()], md.prototype, "outlineOpen", void 0), - Na([Qa()], md.prototype, "outlineWidth", void 0), - Na( - [ - Pa({ type: String }), - Zb(function (a) { - if (this.mdcFoundation) { - var b = null === this.selected && !!a, - c = this.selected && this.selected.value !== a; - (b || c) && this.selectByValue(a), this.reportValidity(); - } - }), - ], - md.prototype, - "value", - void 0 - ), - Na([Pa()], md.prototype, "name", void 0), - Na([Qa()], md.prototype, "selectedText", void 0), - Na([Pa({ type: String })], md.prototype, "icon", void 0), - Na([Qa()], md.prototype, "menuOpen", void 0), - Na([Pa({ type: String })], md.prototype, "helper", void 0), - Na( - [Pa({ type: Boolean })], - md.prototype, - "validateOnInitialRender", - void 0 - ), - Na([Pa({ type: String })], md.prototype, "validationMessage", void 0), - Na([Pa({ type: Boolean })], md.prototype, "required", void 0), - Na([Pa({ type: Boolean })], md.prototype, "naturalMenuWidth", void 0), - Na([Qa()], md.prototype, "isUiValid", void 0), - Na([Pa({ type: Boolean })], md.prototype, "fixedMenuPosition", void 0), - Na( - [ - (function (a) { - return cc({ - finisher: (b, c) => { - Object.assign(b.prototype[c], a); - }, - }); - })({ capture: !0 }), - ], - md.prototype, - "handleTypeahead", - null - ); - var nd, - od = mb( - O || - (O = j([ - '.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-floating-label,.mdc-floating-label[dir=rtl]{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.mdc-floating-label--float-above{cursor:auto}.mdc-floating-label--required::after{margin-left:1px;margin-right:0px;content:"*"}[dir=rtl] .mdc-floating-label--required::after,.mdc-floating-label--required[dir=rtl]::after{margin-left:0;margin-right:1px}.mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-standard 250ms 1}@keyframes mdc-floating-label-shake-float-above-standard{0%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-106%) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-106%) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{border-bottom-width:1px;z-index:1}.mdc-line-ripple::after{transform:scaleX(0);border-bottom-width:2px;opacity:0;z-index:2}.mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-select{display:inline-flex;position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__selected-text{color:rgba(0, 0, 0, 0.87)}.mdc-select.mdc-select--disabled .mdc-select__selected-text{color:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled) .mdc-floating-label{color:rgba(0, 0, 0, 0.6)}.mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-floating-label{color:rgba(98, 0, 238, 0.87)}.mdc-select.mdc-select--disabled .mdc-floating-label{color:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled) .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.54)}.mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-select__dropdown-icon{fill:#6200ee;fill:var(--mdc-theme-primary, #6200ee)}.mdc-select.mdc-select--disabled .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled)+.mdc-select-helper-text{color:rgba(0, 0, 0, 0.6)}.mdc-select.mdc-select--disabled+.mdc-select-helper-text{color:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:rgba(0, 0, 0, 0.54)}.mdc-select.mdc-select--disabled .mdc-select__icon{color:rgba(0, 0, 0, 0.38)}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-select.mdc-select--disabled .mdc-select__selected-text{color:GrayText}.mdc-select.mdc-select--disabled .mdc-select__dropdown-icon{fill:red}.mdc-select.mdc-select--disabled .mdc-floating-label{color:GrayText}.mdc-select.mdc-select--disabled .mdc-line-ripple::before{border-bottom-color:GrayText}.mdc-select.mdc-select--disabled .mdc-notched-outline__leading,.mdc-select.mdc-select--disabled .mdc-notched-outline__notch,.mdc-select.mdc-select--disabled .mdc-notched-outline__trailing{border-color:GrayText}.mdc-select.mdc-select--disabled .mdc-select__icon{color:GrayText}.mdc-select.mdc-select--disabled+.mdc-select-helper-text{color:GrayText}}.mdc-select .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-select .mdc-select__anchor{padding-left:16px;padding-right:0}[dir=rtl] .mdc-select .mdc-select__anchor,.mdc-select .mdc-select__anchor[dir=rtl]{padding-left:0;padding-right:16px}.mdc-select.mdc-select--with-leading-icon .mdc-select__anchor{padding-left:0;padding-right:0}[dir=rtl] .mdc-select.mdc-select--with-leading-icon .mdc-select__anchor,.mdc-select.mdc-select--with-leading-icon .mdc-select__anchor[dir=rtl]{padding-left:0;padding-right:0}.mdc-select .mdc-select__icon{width:24px;height:24px;font-size:24px}.mdc-select .mdc-select__dropdown-icon{width:24px;height:24px}.mdc-select .mdc-select__menu .mdc-deprecated-list-item{padding-left:16px;padding-right:16px}[dir=rtl] .mdc-select .mdc-select__menu .mdc-deprecated-list-item,.mdc-select .mdc-select__menu .mdc-deprecated-list-item[dir=rtl]{padding-left:16px;padding-right:16px}.mdc-select .mdc-select__menu .mdc-deprecated-list-item__graphic{margin-left:0;margin-right:12px}[dir=rtl] .mdc-select .mdc-select__menu .mdc-deprecated-list-item__graphic,.mdc-select .mdc-select__menu .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:12px;margin-right:0}.mdc-select__dropdown-icon{margin-left:12px;margin-right:12px;display:inline-flex;position:relative;align-self:center;align-items:center;justify-content:center;flex-shrink:0;pointer-events:none}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-active,.mdc-select__dropdown-icon .mdc-select__dropdown-icon-inactive{position:absolute;top:0;left:0}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-graphic{width:41.6666666667%;height:20.8333333333%}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-inactive{opacity:1;transition:opacity 75ms linear 75ms}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-active{opacity:0;transition:opacity 75ms linear}[dir=rtl] .mdc-select__dropdown-icon,.mdc-select__dropdown-icon[dir=rtl]{margin-left:12px;margin-right:12px}.mdc-select--activated .mdc-select__dropdown-icon .mdc-select__dropdown-icon-inactive{opacity:0;transition:opacity 49.5ms linear}.mdc-select--activated .mdc-select__dropdown-icon .mdc-select__dropdown-icon-active{opacity:1;transition:opacity 100.5ms linear 49.5ms}.mdc-select__anchor{width:200px;min-width:0;flex:1 1 auto;position:relative;box-sizing:border-box;overflow:hidden;outline:none;cursor:pointer}.mdc-select__anchor .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-select__selected-text-container{display:flex;appearance:none;pointer-events:none;box-sizing:border-box;width:auto;min-width:0;flex-grow:1;height:28px;border:none;outline:none;padding:0;background-color:transparent;color:inherit}.mdc-select__selected-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;width:100%;text-align:left}[dir=rtl] .mdc-select__selected-text,.mdc-select__selected-text[dir=rtl]{text-align:right}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-floating-label{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-floating-label{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--invalid+.mdc-select-helper-text--validation-msg{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-select__dropdown-icon{fill:#b00020;fill:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-select__dropdown-icon{fill:#b00020;fill:var(--mdc-theme-error, #b00020)}.mdc-select--disabled{cursor:default;pointer-events:none}.mdc-select--with-leading-icon .mdc-select__menu .mdc-deprecated-list-item{padding-left:12px;padding-right:12px}[dir=rtl] .mdc-select--with-leading-icon .mdc-select__menu .mdc-deprecated-list-item,.mdc-select--with-leading-icon .mdc-select__menu .mdc-deprecated-list-item[dir=rtl]{padding-left:12px;padding-right:12px}.mdc-select__menu .mdc-deprecated-list .mdc-select__icon,.mdc-select__menu .mdc-list .mdc-select__icon{margin-left:0;margin-right:0}[dir=rtl] .mdc-select__menu .mdc-deprecated-list .mdc-select__icon,[dir=rtl] .mdc-select__menu .mdc-list .mdc-select__icon,.mdc-select__menu .mdc-deprecated-list .mdc-select__icon[dir=rtl],.mdc-select__menu .mdc-list .mdc-select__icon[dir=rtl]{margin-left:0;margin-right:0}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--activated,.mdc-select__menu .mdc-list .mdc-deprecated-list-item--selected,.mdc-select__menu .mdc-list .mdc-deprecated-list-item--activated{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-deprecated-list-item__graphic,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--activated .mdc-deprecated-list-item__graphic,.mdc-select__menu .mdc-list .mdc-deprecated-list-item--selected .mdc-deprecated-list-item__graphic,.mdc-select__menu .mdc-list .mdc-deprecated-list-item--activated .mdc-deprecated-list-item__graphic{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-select__menu .mdc-list-item__start{display:inline-flex;align-items:center}.mdc-select__option{padding-left:16px;padding-right:16px}[dir=rtl] .mdc-select__option,.mdc-select__option[dir=rtl]{padding-left:16px;padding-right:16px}.mdc-select__one-line-option.mdc-list-item--with-one-line{height:48px}.mdc-select__two-line-option.mdc-list-item--with-two-lines{height:64px}.mdc-select__two-line-option.mdc-list-item--with-two-lines .mdc-list-item__start{margin-top:20px}.mdc-select__two-line-option.mdc-list-item--with-two-lines .mdc-list-item__primary-text{display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-select__two-line-option.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before{display:inline-block;width:0;height:28px;content:"";vertical-align:0}.mdc-select__two-line-option.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-select__two-line-option.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end{display:block;margin-top:0;line-height:normal}.mdc-select__two-line-option.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before{display:inline-block;width:0;height:36px;content:"";vertical-align:0}.mdc-select__option-with-leading-content{padding-left:0;padding-right:12px}.mdc-select__option-with-leading-content.mdc-list-item{padding-left:0;padding-right:auto}[dir=rtl] .mdc-select__option-with-leading-content.mdc-list-item,.mdc-select__option-with-leading-content.mdc-list-item[dir=rtl]{padding-left:auto;padding-right:0}.mdc-select__option-with-leading-content .mdc-list-item__start{margin-left:12px;margin-right:0}[dir=rtl] .mdc-select__option-with-leading-content .mdc-list-item__start,.mdc-select__option-with-leading-content .mdc-list-item__start[dir=rtl]{margin-left:0;margin-right:12px}.mdc-select__option-with-leading-content .mdc-list-item__start{width:36px;height:24px}[dir=rtl] .mdc-select__option-with-leading-content,.mdc-select__option-with-leading-content[dir=rtl]{padding-left:12px;padding-right:0}.mdc-select__option-with-meta.mdc-list-item{padding-left:auto;padding-right:0}[dir=rtl] .mdc-select__option-with-meta.mdc-list-item,.mdc-select__option-with-meta.mdc-list-item[dir=rtl]{padding-left:0;padding-right:auto}.mdc-select__option-with-meta .mdc-list-item__end{margin-left:12px;margin-right:12px}[dir=rtl] .mdc-select__option-with-meta .mdc-list-item__end,.mdc-select__option-with-meta .mdc-list-item__end[dir=rtl]{margin-left:12px;margin-right:12px}.mdc-select--filled .mdc-select__anchor{height:56px;display:flex;align-items:baseline}.mdc-select--filled .mdc-select__anchor::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.mdc-select--filled.mdc-select--no-label .mdc-select__anchor .mdc-select__selected-text::before{content:"\u200B"}.mdc-select--filled.mdc-select--no-label .mdc-select__anchor .mdc-select__selected-text-container{height:100%;display:inline-flex;align-items:center}.mdc-select--filled.mdc-select--no-label .mdc-select__anchor::before{display:none}.mdc-select--filled .mdc-select__anchor{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-select--filled:not(.mdc-select--disabled) .mdc-select__anchor{background-color:whitesmoke}.mdc-select--filled.mdc-select--disabled .mdc-select__anchor{background-color:#fafafa}.mdc-select--filled:not(.mdc-select--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42)}.mdc-select--filled:not(.mdc-select--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87)}.mdc-select--filled:not(.mdc-select--disabled) .mdc-line-ripple::after{border-bottom-color:#6200ee;border-bottom-color:var(--mdc-theme-primary, #6200ee)}.mdc-select--filled.mdc-select--disabled .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.06)}.mdc-select--filled .mdc-floating-label{max-width:calc(100% - 64px)}.mdc-select--filled .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 64px / 0.75)}.mdc-select--filled .mdc-menu-surface--is-open-below{border-top-left-radius:0px;border-top-right-radius:0px}.mdc-select--filled.mdc-select--focused.mdc-line-ripple::after{transform:scale(1, 2);opacity:1}.mdc-select--filled .mdc-floating-label{left:16px;right:initial}[dir=rtl] .mdc-select--filled .mdc-floating-label,.mdc-select--filled .mdc-floating-label[dir=rtl]{left:initial;right:16px}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{left:48px;right:initial}[dir=rtl] .mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label,.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label[dir=rtl]{left:initial;right:48px}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{max-width:calc(100% - 96px)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 96px / 0.75)}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled):hover .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-line-ripple::after{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined{border:none}.mdc-select--outlined .mdc-select__anchor{height:56px}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{font-size:.75rem}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined-56px 250ms 1}@keyframes mdc-floating-label-shake-float-above-select-outlined-56px{0%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}}.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}@supports(top: max(0%)){.mdc-select--outlined .mdc-select__anchor{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-select--outlined .mdc-select__anchor,.mdc-select--outlined .mdc-select__anchor[dir=rtl]{padding-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-select--outlined .mdc-select__anchor,.mdc-select--outlined .mdc-select__anchor[dir=rtl]{padding-right:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-select--outlined+.mdc-select-helper-text{margin-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-select--outlined+.mdc-select-helper-text,.mdc-select--outlined+.mdc-select-helper-text[dir=rtl]{margin-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-select--outlined+.mdc-select-helper-text,.mdc-select--outlined+.mdc-select-helper-text[dir=rtl]{margin-right:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-select--outlined:not(.mdc-select--disabled) .mdc-select__anchor{background-color:transparent}.mdc-select--outlined.mdc-select--disabled .mdc-select__anchor{background-color:transparent}.mdc-select--outlined:not(.mdc-select--disabled) .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled) .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled) .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.38)}.mdc-select--outlined:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.87)}.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-width:2px}.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-select--outlined.mdc-select--disabled .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--disabled .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--disabled .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.06)}.mdc-select--outlined .mdc-select__anchor :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-select--outlined .mdc-select__anchor{display:flex;align-items:baseline;overflow:visible}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined 250ms 1}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{font-size:.75rem}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-select--outlined .mdc-select__anchor .mdc-select__selected-text::before{content:"\u200B"}.mdc-select--outlined .mdc-select__anchor .mdc-select__selected-text-container{height:100%;display:inline-flex;align-items:center}.mdc-select--outlined .mdc-select__anchor::before{display:none}.mdc-select--outlined .mdc-select__selected-text-container{display:flex;border:none;z-index:1;background-color:transparent}.mdc-select--outlined .mdc-select__icon{z-index:2}.mdc-select--outlined .mdc-floating-label{line-height:1.15rem;left:4px;right:initial}[dir=rtl] .mdc-select--outlined .mdc-floating-label,.mdc-select--outlined .mdc-floating-label[dir=rtl]{left:initial;right:4px}.mdc-select--outlined.mdc-select--focused .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled) .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled) .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled) .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-width:2px}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label{left:36px;right:initial}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label[dir=rtl]{left:initial;right:36px}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above{transform:translateY(-37.25px) translateX(-32px) scale(1)}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-37.25px) translateX(32px) scale(1)}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above{font-size:.75rem}.mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) translateX(-32px) scale(0.75)}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above,[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl],.mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-34.75px) translateX(32px) scale(0.75)}.mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px 250ms 1}@keyframes mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px{0%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--shake,.mdc-select--outlined.mdc-select--with-leading-icon[dir=rtl] .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px 250ms 1}@keyframes mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px-rtl{0%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - -32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - -32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-select__anchor :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 96px)}.mdc-select--outlined .mdc-menu-surface{margin-bottom:8px}.mdc-select--outlined.mdc-select--no-label .mdc-menu-surface,.mdc-select--outlined .mdc-menu-surface--is-open-below{margin-bottom:0}.mdc-select__anchor{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity}.mdc-select__anchor .mdc-select__ripple::before,.mdc-select__anchor .mdc-select__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-select__anchor .mdc-select__ripple::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-select__anchor .mdc-select__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-select__anchor.mdc-ripple-upgraded .mdc-select__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-select__anchor.mdc-ripple-upgraded .mdc-select__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-select__anchor.mdc-ripple-upgraded--unbounded .mdc-select__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-select__anchor.mdc-ripple-upgraded--foreground-activation .mdc-select__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-select__anchor.mdc-ripple-upgraded--foreground-deactivation .mdc-select__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-select__anchor .mdc-select__ripple::before,.mdc-select__anchor .mdc-select__ripple::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-select__anchor.mdc-ripple-upgraded .mdc-select__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-select__anchor .mdc-select__ripple::before,.mdc-select__anchor .mdc-select__ripple::after{background-color:rgba(0, 0, 0, 0.87);background-color:var(--mdc-ripple-color, rgba(0, 0, 0, 0.87))}.mdc-select__anchor:hover .mdc-select__ripple::before,.mdc-select__anchor.mdc-ripple-surface--hover .mdc-select__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-select__anchor.mdc-ripple-upgraded--background-focused .mdc-select__ripple::before,.mdc-select__anchor:not(.mdc-ripple-upgraded):focus .mdc-select__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-select__anchor .mdc-select__ripple{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-deprecated-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-deprecated-list-item__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:hover .mdc-deprecated-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-surface--hover .mdc-deprecated-list-item__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-upgraded--background-focused .mdc-deprecated-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded):focus .mdc-deprecated-list-item__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded) .mdc-deprecated-list-item__ripple::after{transition:opacity 150ms linear}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded):active .mdc-deprecated-list-item__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-list-item__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:hover .mdc-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-surface--hover .mdc-list-item__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-upgraded--background-focused .mdc-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded):focus .mdc-list-item__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded) .mdc-list-item__ripple::after{transition:opacity 150ms linear}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded):active .mdc-list-item__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-select-helper-text{margin:0;margin-left:16px;margin-right:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit);display:block;margin-top:0;line-height:normal}[dir=rtl] .mdc-select-helper-text,.mdc-select-helper-text[dir=rtl]{margin-left:16px;margin-right:16px}.mdc-select-helper-text::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.mdc-select-helper-text--validation-msg{opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-select--invalid+.mdc-select-helper-text--validation-msg,.mdc-select-helper-text--validation-msg-persistent{opacity:1}.mdc-select--with-leading-icon .mdc-select__icon{display:inline-block;box-sizing:border-box;border:none;text-decoration:none;cursor:pointer;user-select:none;flex-shrink:0;align-self:center;background-color:transparent;fill:currentColor}.mdc-select--with-leading-icon .mdc-select__icon{margin-left:12px;margin-right:12px}[dir=rtl] .mdc-select--with-leading-icon .mdc-select__icon,.mdc-select--with-leading-icon .mdc-select__icon[dir=rtl]{margin-left:12px;margin-right:12px}.mdc-select__icon:not([tabindex]),.mdc-select__icon[tabindex="-1"]{cursor:default;pointer-events:none}.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}:host{display:inline-block;vertical-align:top;outline:none}.mdc-select{width:100%}[hidden]{display:none}.mdc-select__icon{z-index:2}.mdc-select--with-leading-icon{--mdc-list-item-graphic-margin: calc( 48px - var(--mdc-list-item-graphic-size, 24px) - var(--mdc-list-side-padding, 16px) )}.mdc-select .mdc-select__anchor .mdc-select__selected-text{overflow:hidden}.mdc-select .mdc-select__anchor *{display:inline-flex}.mdc-select .mdc-select__anchor .mdc-floating-label{display:inline-block}mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-select-outlined-idle-border-color, rgba(0, 0, 0, 0.38) );--mdc-notched-outline-notch-offset: 1px}:host(:not([disabled]):hover) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-select-outlined-hover-border-color, rgba(0, 0, 0, 0.87) )}:host(:not([disabled])) .mdc-select:not(.mdc-select--disabled) .mdc-select__selected-text{color:rgba(0, 0, 0, 0.87);color:var(--mdc-select-ink-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-select:not(.mdc-select--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42);border-bottom-color:var(--mdc-select-idle-line-color, rgba(0, 0, 0, 0.42))}:host(:not([disabled])) .mdc-select:not(.mdc-select--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87);border-bottom-color:var(--mdc-select-hover-line-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-select:not(.mdc-select--outlined):not(.mdc-select--disabled) .mdc-select__anchor{background-color:whitesmoke;background-color:var(--mdc-select-fill-color, whitesmoke)}:host(:not([disabled])) .mdc-select.mdc-select--invalid .mdc-select__dropdown-icon{fill:var(--mdc-select-error-dropdown-icon-color, var(--mdc-select-error-color, var(--mdc-theme-error, #b00020)))}:host(:not([disabled])) .mdc-select.mdc-select--invalid .mdc-floating-label,:host(:not([disabled])) .mdc-select.mdc-select--invalid .mdc-floating-label::after{color:var(--mdc-select-error-color, var(--mdc-theme-error, #b00020))}:host(:not([disabled])) .mdc-select.mdc-select--invalid mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-select-error-color, var(--mdc-theme-error, #b00020))}.mdc-select__menu--invalid{--mdc-theme-primary: var(--mdc-select-error-color, var(--mdc-theme-error, #b00020))}:host(:not([disabled])) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label,:host(:not([disabled])) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label::after{color:rgba(0, 0, 0, 0.6);color:var(--mdc-select-label-ink-color, rgba(0, 0, 0, 0.6))}:host(:not([disabled])) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.54);fill:var(--mdc-select-dropdown-icon-color, rgba(0, 0, 0, 0.54))}:host(:not([disabled])) .mdc-select.mdc-select--focused mwc-notched-outline{--mdc-notched-outline-stroke-width: 2px;--mdc-notched-outline-notch-offset: 2px}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-select-focused-label-color, var(--mdc-theme-primary, rgba(98, 0, 238, 0.87)) )}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) .mdc-select__dropdown-icon{fill:rgba(98,0,238,.87);fill:var(--mdc-select-focused-dropdown-icon-color, var(--mdc-theme-primary, rgba(98, 0, 238, 0.87)))}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) .mdc-floating-label{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) .mdc-floating-label::after{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host(:not([disabled])) .mdc-select-helper-text:not(.mdc-select-helper-text--validation-msg){color:var(--mdc-select-label-ink-color, rgba(0, 0, 0, 0.6))}:host([disabled]){pointer-events:none}:host([disabled]) .mdc-select:not(.mdc-select--outlined).mdc-select--disabled .mdc-select__anchor{background-color:#fafafa;background-color:var(--mdc-select-disabled-fill-color, #fafafa)}:host([disabled]) .mdc-select.mdc-select--outlined mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-select-outlined-disabled-border-color, rgba(0, 0, 0, 0.06) )}:host([disabled]) .mdc-select .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.38);fill:var(--mdc-select-disabled-dropdown-icon-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label,:host([disabled]) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label::after{color:rgba(0, 0, 0, 0.38);color:var(--mdc-select-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-select-helper-text{color:rgba(0, 0, 0, 0.38);color:var(--mdc-select-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-select__selected-text{color:rgba(0, 0, 0, 0.38);color:var(--mdc-select-disabled-ink-color, rgba(0, 0, 0, 0.38))}', - ])) - ), - pd = { - MENU_SELECTED_LIST_ITEM: "mdc-menu-item--selected", - MENU_SELECTION_GROUP: "mdc-menu__selection-group", - ROOT: "mdc-menu", - }, - qd = { - ARIA_CHECKED_ATTR: "aria-checked", - ARIA_DISABLED_ATTR: "aria-disabled", - CHECKBOX_SELECTOR: 'input[type="checkbox"]', - LIST_SELECTOR: ".mdc-list,.mdc-deprecated-list", - SELECTED_EVENT: "MDCMenu:selected", - SKIP_RESTORE_FOCUS: "data-menu-item-skip-restore-focus", - }, - rd = { FOCUS_ROOT_INDEX: -1 }; - (function (a) { - (a[(a.NONE = 0)] = "NONE"), - (a[(a.LIST_ROOT = 1)] = "LIST_ROOT"), - (a[(a.FIRST_ITEM = 2)] = "FIRST_ITEM"), - (a[(a.LAST_ITEM = 3)] = "LAST_ITEM"); - })(nd || (nd = {})); - var sd = (function (a) { - function b(c) { - var d = a.call(this, Yb(Yb({}, b.defaultAdapter), c)) || this; - return ( - (d.isSurfaceOpen = !1), - (d.isQuickOpen = !1), - (d.isHoistedElement = !1), - (d.isFixedPosition = !1), - (d.isHorizontallyCenteredOnViewport = !1), - (d.maxHeight = 0), - (d.openBottomBias = 0), - (d.openAnimationEndTimerId = 0), - (d.closeAnimationEndTimerId = 0), - (d.animationRequestId = 0), - (d.anchorCorner = fd.TOP_START), - (d.originCorner = fd.TOP_START), - (d.anchorMargin = { top: 0, right: 0, bottom: 0, left: 0 }), - (d.position = { x: 0, y: 0 }), - d - ); - } - return ( - Ma(b, a), - Object.defineProperty(b, "cssClasses", { - get: function () { - return cd; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "strings", { - get: function () { - return dd; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "numbers", { - get: function () { - return ed; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "Corner", { - get: function () { - return fd; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "defaultAdapter", { - get: function () { - return { - addClass: function () {}, - removeClass: function () {}, - hasClass: function () { - return !1; - }, - hasAnchor: function () { - return !1; - }, - isElementInContainer: function () { - return !1; - }, - isFocused: function () { - return !1; - }, - isRtl: function () { - return !1; - }, - getInnerDimensions: function () { - return { height: 0, width: 0 }; - }, - getAnchorDimensions: function () { - return null; - }, - getWindowDimensions: function () { - return { height: 0, width: 0 }; - }, - getBodyDimensions: function () { - return { height: 0, width: 0 }; - }, - getWindowScroll: function () { - return { x: 0, y: 0 }; - }, - setPosition: function () {}, - setMaxHeight: function () {}, - setTransformOrigin: function () {}, - saveFocus: function () {}, - restoreFocus: function () {}, - notifyClose: function () {}, - notifyOpen: function () {}, - notifyClosing: function () {}, - }; - }, - enumerable: !1, - configurable: !0, - }), - (b.prototype.init = function () { - var a = b.cssClasses, - c = a.ROOT, - d = a.OPEN; - if (!this.adapter.hasClass(c)) - throw new Error(c + " class required in root element."); - this.adapter.hasClass(d) && (this.isSurfaceOpen = !0); - }), - (b.prototype.destroy = function () { - clearTimeout(this.openAnimationEndTimerId), - clearTimeout(this.closeAnimationEndTimerId), - cancelAnimationFrame(this.animationRequestId); - }), - (b.prototype.setAnchorCorner = function (a) { - this.anchorCorner = a; - }), - (b.prototype.flipCornerHorizontally = function () { - this.originCorner ^= ad.RIGHT; - }), - (b.prototype.setAnchorMargin = function (a) { - (this.anchorMargin.top = a.top || 0), - (this.anchorMargin.right = a.right || 0), - (this.anchorMargin.bottom = a.bottom || 0), - (this.anchorMargin.left = a.left || 0); - }), - (b.prototype.setIsHoisted = function (a) { - this.isHoistedElement = a; - }), - (b.prototype.setFixedPosition = function (a) { - this.isFixedPosition = a; - }), - (b.prototype.isFixed = function () { - return this.isFixedPosition; - }), - (b.prototype.setAbsolutePosition = function (a, b) { - (this.position.x = this.isFinite(a) ? a : 0), - (this.position.y = this.isFinite(b) ? b : 0); - }), - (b.prototype.setIsHorizontallyCenteredOnViewport = function (a) { - this.isHorizontallyCenteredOnViewport = a; - }), - (b.prototype.setQuickOpen = function (a) { - this.isQuickOpen = a; - }), - (b.prototype.setMaxHeight = function (a) { - this.maxHeight = a; - }), - (b.prototype.setOpenBottomBias = function (a) { - this.openBottomBias = a; - }), - (b.prototype.isOpen = function () { - return this.isSurfaceOpen; - }), - (b.prototype.open = function () { - var a = this; - this.isSurfaceOpen || - (this.adapter.saveFocus(), - this.isQuickOpen - ? ((this.isSurfaceOpen = !0), - this.adapter.addClass(b.cssClasses.OPEN), - (this.dimensions = this.adapter.getInnerDimensions()), - this.autoposition(), - this.adapter.notifyOpen()) - : (this.adapter.addClass(b.cssClasses.ANIMATING_OPEN), - (this.animationRequestId = requestAnimationFrame(function () { - (a.dimensions = a.adapter.getInnerDimensions()), - a.autoposition(), - a.adapter.addClass(b.cssClasses.OPEN), - (a.openAnimationEndTimerId = setTimeout(function () { - (a.openAnimationEndTimerId = 0), - a.adapter.removeClass(b.cssClasses.ANIMATING_OPEN), - a.adapter.notifyOpen(); - }, ed.TRANSITION_OPEN_DURATION)); - })), - (this.isSurfaceOpen = !0))); - }), - (b.prototype.close = function (a) { - var c = this; - if ((void 0 === a && (a = !1), !!this.isSurfaceOpen)) - return ( - this.adapter.notifyClosing(), - this.isQuickOpen - ? ((this.isSurfaceOpen = !1), - a || this.maybeRestoreFocus(), - this.adapter.removeClass(b.cssClasses.OPEN), - this.adapter.removeClass(b.cssClasses.IS_OPEN_BELOW), - void this.adapter.notifyClose()) - : void (this.adapter.addClass(b.cssClasses.ANIMATING_CLOSED), - requestAnimationFrame(function () { - c.adapter.removeClass(b.cssClasses.OPEN), - c.adapter.removeClass(b.cssClasses.IS_OPEN_BELOW), - (c.closeAnimationEndTimerId = setTimeout(function () { - (c.closeAnimationEndTimerId = 0), - c.adapter.removeClass( - b.cssClasses.ANIMATING_CLOSED - ), - c.adapter.notifyClose(); - }, ed.TRANSITION_CLOSE_DURATION)); - }), - (this.isSurfaceOpen = !1), - !a && this.maybeRestoreFocus()) - ); - }), - (b.prototype.handleBodyClick = function (a) { - var b = a.target; - this.adapter.isElementInContainer(b) || this.close(); - }), - (b.prototype.handleKeydown = function (a) { - var b = a.keyCode, - c = a.key; - ("Escape" === c || 27 === b) && this.close(); - }), - (b.prototype.autoposition = function () { - var a; - this.measurements = this.getAutoLayoutmeasurements(); - var c = this.getoriginCorner(), - d = this.getMenuSurfaceMaxHeight(c), - e = this.hasBit(c, ad.BOTTOM) ? "bottom" : "top", - f = this.hasBit(c, ad.RIGHT) ? "right" : "left", - g = this.getHorizontalOriginOffset(c), - h = this.getVerticalOriginOffset(c), - i = this.measurements, - j = i.anchorSize, - k = i.surfaceSize, - l = ((a = {}), (a[f] = g), (a[e] = h), a); - j.width / k.width > ed.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO && - (f = "center"), - (this.isHoistedElement || this.isFixedPosition) && - this.adjustPositionForHoistedElement(l), - this.adapter.setTransformOrigin(f + " " + e), - this.adapter.setPosition(l), - this.adapter.setMaxHeight(d ? d + "px" : ""), - this.hasBit(c, ad.BOTTOM) || - this.adapter.addClass(b.cssClasses.IS_OPEN_BELOW); - }), - (b.prototype.getAutoLayoutmeasurements = function () { - var a = this.adapter.getAnchorDimensions(), - b = this.adapter.getBodyDimensions(), - c = this.adapter.getWindowDimensions(), - d = this.adapter.getWindowScroll(); - return ( - a || - (a = { - top: this.position.y, - right: this.position.x, - bottom: this.position.y, - left: this.position.x, - width: 0, - height: 0, - }), - { - anchorSize: a, - bodySize: b, - surfaceSize: this.dimensions, - viewportDistance: { - top: a.top, - right: c.width - a.right, - bottom: c.height - a.bottom, - left: a.left, - }, - viewportSize: c, - windowScroll: d, - } - ); - }), - (b.prototype.getoriginCorner = function () { - var a, - c, - d = this.originCorner, - e = this.measurements, - f = e.viewportDistance, - g = e.anchorSize, - h = e.surfaceSize, - i = b.numbers.MARGIN_TO_EDGE, - j = this.hasBit(this.anchorCorner, ad.BOTTOM); - j - ? ((a = f.top - i + this.anchorMargin.bottom), - (c = f.bottom - i - this.anchorMargin.bottom)) - : ((a = f.top - i + this.anchorMargin.top), - (c = f.bottom - i + g.height - this.anchorMargin.top)); - var k = 0 < c - h.height; - !k && - a > c + this.openBottomBias && - (d = this.setBit(d, ad.BOTTOM)); - var l = this.adapter.isRtl(), - m = this.hasBit(this.anchorCorner, ad.FLIP_RTL), - n = - this.hasBit(this.anchorCorner, ad.RIGHT) || - this.hasBit(d, ad.RIGHT), - o = !1; - o = l && m ? !n : n; - var p, q; - o - ? ((p = f.left + g.width + this.anchorMargin.right), - (q = f.right - this.anchorMargin.right)) - : ((p = f.left + this.anchorMargin.left), - (q = f.right + g.width - this.anchorMargin.left)); - var r = 0 < p - h.width, - s = 0 < q - h.width, - t = this.hasBit(d, ad.FLIP_RTL) && this.hasBit(d, ad.RIGHT); - return ( - (s && t && l) || (!r && t) - ? (d = this.unsetBit(d, ad.RIGHT)) - : ((r && o && l) || (r && !o && n) || (!s && p >= q)) && - (d = this.setBit(d, ad.RIGHT)), - d - ); - }), - (b.prototype.getMenuSurfaceMaxHeight = function (a) { - if (0 < this.maxHeight) return this.maxHeight; - var c = this.measurements.viewportDistance, - d = 0, - e = this.hasBit(a, ad.BOTTOM), - f = this.hasBit(this.anchorCorner, ad.BOTTOM), - g = b.numbers.MARGIN_TO_EDGE; - return ( - e - ? ((d = c.top + this.anchorMargin.top - g), - !f && (d += this.measurements.anchorSize.height)) - : ((d = - c.bottom - - this.anchorMargin.bottom + - this.measurements.anchorSize.height - - g), - f && (d -= this.measurements.anchorSize.height)), - d - ); - }), - (b.prototype.getHorizontalOriginOffset = function (a) { - var b = this.measurements.anchorSize, - c = this.hasBit(a, ad.RIGHT), - d = this.hasBit(this.anchorCorner, ad.RIGHT); - if (c) { - var e = d - ? b.width - this.anchorMargin.left - : this.anchorMargin.right; - return this.isHoistedElement || this.isFixedPosition - ? e - - (this.measurements.viewportSize.width - - this.measurements.bodySize.width) - : e; - } - return d - ? b.width - this.anchorMargin.right - : this.anchorMargin.left; - }), - (b.prototype.getVerticalOriginOffset = function (a) { - var b = this.measurements.anchorSize, - c = this.hasBit(a, ad.BOTTOM), - d = this.hasBit(this.anchorCorner, ad.BOTTOM), - e = 0; - return ( - (e = c - ? d - ? b.height - this.anchorMargin.top - : -this.anchorMargin.bottom - : d - ? b.height + this.anchorMargin.bottom - : this.anchorMargin.top), - e - ); - }), - (b.prototype.adjustPositionForHoistedElement = function (a) { - var b, - c, - d = this.measurements, - e = d.windowScroll, - f = d.viewportDistance, - g = d.surfaceSize, - h = d.viewportSize, - i = Object.keys(a); - try { - for (var j = Oa(i), k = j.next(); !k.done; k = j.next()) { - var l = k.value, - m = a[l] || 0; - if ( - this.isHorizontallyCenteredOnViewport && - ("left" === l || "right" === l) - ) { - a[l] = (h.width - g.width) / 2; - continue; - } - (m += f[l]), - this.isFixedPosition || - ("top" === l - ? (m += e.y) - : "bottom" === l - ? (m -= e.y) - : "left" === l - ? (m += e.x) - : (m -= e.x)), - (a[l] = m); - } - } catch (a) { - b = { error: a }; - } finally { - try { - k && !k.done && (c = j.return) && c.call(j); - } finally { - if (b) throw b.error; - } - } - }), - (b.prototype.maybeRestoreFocus = function () { - var a = this, - b = this.adapter.isFocused(), - c = - document.activeElement && - this.adapter.isElementInContainer(document.activeElement); - (b || c) && - setTimeout(function () { - a.adapter.restoreFocus(); - }, ed.TOUCH_EVENT_WAIT_MS); - }), - (b.prototype.hasBit = function (a, b) { - return !!(a & b); - }), - (b.prototype.setBit = function (a, b) { - return a | b; - }), - (b.prototype.unsetBit = function (a, b) { - return a ^ b; - }), - (b.prototype.isFinite = function (a) { - return "number" == typeof a && isFinite(a); - }), - b - ); - })(qc), - td = (function (a) { - function b(c) { - var d = a.call(this, Yb(Yb({}, b.defaultAdapter), c)) || this; - return ( - (d.closeAnimationEndTimerId = 0), - (d.defaultFocusState = nd.LIST_ROOT), - (d.selectedIndex = -1), - d - ); - } - return ( - Ma(b, a), - Object.defineProperty(b, "cssClasses", { - get: function () { - return pd; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "strings", { - get: function () { - return qd; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "numbers", { - get: function () { - return rd; - }, - enumerable: !1, - configurable: !0, - }), - Object.defineProperty(b, "defaultAdapter", { - get: function () { - return { - addClassToElementAtIndex: function () {}, - removeClassFromElementAtIndex: function () {}, - addAttributeToElementAtIndex: function () {}, - removeAttributeFromElementAtIndex: function () {}, - getAttributeFromElementAtIndex: function () { - return null; - }, - elementContainsClass: function () { - return !1; - }, - closeSurface: function () {}, - getElementIndex: function () { - return -1; - }, - notifySelected: function () {}, - getMenuItemCount: function () { - return 0; - }, - focusItemAtIndex: function () {}, - focusListRoot: function () {}, - getSelectedSiblingOfItemAtIndex: function () { - return -1; - }, - isSelectableItemAtIndex: function () { - return !1; - }, - }; - }, - enumerable: !1, - configurable: !0, - }), - (b.prototype.destroy = function () { - this.closeAnimationEndTimerId && - clearTimeout(this.closeAnimationEndTimerId), - this.adapter.closeSurface(); - }), - (b.prototype.handleKeydown = function (a) { - var b = a.key, - c = a.keyCode; - ("Tab" === b || 9 === c) && this.adapter.closeSurface(!0); - }), - (b.prototype.handleItemAction = function (a) { - var b = this, - c = this.adapter.getElementIndex(a); - if (!(0 > c)) { - this.adapter.notifySelected({ index: c }); - var d = - "true" === - this.adapter.getAttributeFromElementAtIndex( - c, - qd.SKIP_RESTORE_FOCUS - ); - this.adapter.closeSurface(d), - (this.closeAnimationEndTimerId = setTimeout(function () { - var c = b.adapter.getElementIndex(a); - 0 <= c && - b.adapter.isSelectableItemAtIndex(c) && - b.setSelectedIndex(c); - }, sd.numbers.TRANSITION_CLOSE_DURATION)); - } - }), - (b.prototype.handleMenuSurfaceOpened = function () { - switch (this.defaultFocusState) { - case nd.FIRST_ITEM: - this.adapter.focusItemAtIndex(0); - break; - case nd.LAST_ITEM: - this.adapter.focusItemAtIndex( - this.adapter.getMenuItemCount() - 1 - ); - break; - case nd.NONE: - break; - default: - this.adapter.focusListRoot(); - } - }), - (b.prototype.setDefaultFocusState = function (a) { - this.defaultFocusState = a; - }), - (b.prototype.getSelectedIndex = function () { - return this.selectedIndex; - }), - (b.prototype.setSelectedIndex = function (a) { - if ( - (this.validatedIndex(a), !this.adapter.isSelectableItemAtIndex(a)) - ) - throw new Error( - "MDCMenuFoundation: No selection group at specified index." - ); - var b = this.adapter.getSelectedSiblingOfItemAtIndex(a); - 0 <= b && - (this.adapter.removeAttributeFromElementAtIndex( - b, - qd.ARIA_CHECKED_ATTR - ), - this.adapter.removeClassFromElementAtIndex( - b, - pd.MENU_SELECTED_LIST_ITEM - )), - this.adapter.addClassToElementAtIndex( - a, - pd.MENU_SELECTED_LIST_ITEM - ), - this.adapter.addAttributeToElementAtIndex( - a, - qd.ARIA_CHECKED_ATTR, - "true" - ), - (this.selectedIndex = a); - }), - (b.prototype.setEnabled = function (a, b) { - this.validatedIndex(a), - b - ? (this.adapter.removeClassFromElementAtIndex( - a, - Mc.LIST_ITEM_DISABLED_CLASS - ), - this.adapter.addAttributeToElementAtIndex( - a, - qd.ARIA_DISABLED_ATTR, - "false" - )) - : (this.adapter.addClassToElementAtIndex( - a, - Mc.LIST_ITEM_DISABLED_CLASS - ), - this.adapter.addAttributeToElementAtIndex( - a, - qd.ARIA_DISABLED_ATTR, - "true" - )); - }), - (b.prototype.validatedIndex = function (a) { - var b = this.adapter.getMenuItemCount(); - if (!(0 <= a && a < b)) - throw new Error( - "MDCMenuFoundation: No list item at specified index." - ); - }), - b - ); - })(qc), - ud = (c, a) => c - a, - vd = (a, b) => { - for ( - var c = Array.from(a), - d = Array.from(b), - e = { added: [], removed: [] }, - f = c.sort(ud), - g = d.sort(ud), - h = 0, - k = 0; - h < f.length || k < g.length; +
+ + + +
- ) { - var l = f[h], - m = g[k]; - if (l === m) { - h++, k++; - continue; - } - if (void 0 !== l && (void 0 === m || l < m)) { - e.removed.push(l), h++; - continue; - } - if (void 0 !== m && (void 0 === l || m < l)) { - e.added.push(m), k++; - continue; - } - } - return e; - }, - wd = ["input", "button", "textarea", "select"], - xd = (a) => { - var b = a === Qc.UNSET_INDEX ? new Set() : a; - return fb(b) ? new Set(b) : new Set([b]); - }; - class yd extends qc { - constructor(a) { - super(Object.assign(Object.assign({}, yd.defaultAdapter), a)), - (this.isMulti_ = !1), - (this.wrapFocus_ = !1), - (this.isVertical_ = !0), - (this.selectedIndex_ = Qc.UNSET_INDEX), - (this.focusedItemIndex_ = Qc.UNSET_INDEX), - (this.useActivatedClass_ = !1), - (this.ariaCurrentAttrValue_ = null); - } - static get strings() { - return Pc; - } - static get numbers() { - return Qc; - } - static get defaultAdapter() { - return { - focusItemAtIndex: () => void 0, - getFocusedElementIndex: () => 0, - getListItemCount: () => 0, - isFocusInsideList: () => !1, - isRootFocused: () => !1, - notifyAction: () => void 0, - notifySelected: () => void 0, - getSelectedStateForElementIndex: () => !1, - setDisabledStateForElementIndex: () => void 0, - getDisabledStateForElementIndex: () => !1, - setSelectedStateForElementIndex: () => void 0, - setActivatedStateForElementIndex: () => void 0, - setTabIndexForElementIndex: () => void 0, - setAttributeForElementIndex: () => void 0, - getAttributeForElementIndex: () => null, - }; - } - setWrapFocus(a) { - this.wrapFocus_ = a; - } - setMulti(a) { - this.isMulti_ = a; - var b = this.selectedIndex_; - if (a) { - if (!fb(b)) { - var c = b === Qc.UNSET_INDEX; - this.selectedIndex_ = c ? new Set() : new Set([b]); - } - } else if (fb(b)) - if (b.size) { - var d = Array.from(b).sort(ud); - this.selectedIndex_ = d[0]; - } else this.selectedIndex_ = Qc.UNSET_INDEX; - } - setVerticalOrientation(a) { - this.isVertical_ = a; - } - setUseActivatedClass(a) { - this.useActivatedClass_ = a; - } - getSelectedIndex() { - return this.selectedIndex_; - } - setSelectedIndex(a) { - this.isIndexValid_(a) && - (this.isMulti_ - ? this.setMultiSelectionAtIndex_(xd(a)) - : this.setSingleSelectionAtIndex_(a)); - } - handleFocusIn(a, b) { - 0 <= b && this.adapter.setTabIndexForElementIndex(b, 0); - } - handleFocusOut(a, b) { - 0 <= b && this.adapter.setTabIndexForElementIndex(b, -1), - setTimeout(() => { - this.adapter.isFocusInsideList() || - this.setTabindexToFirstSelectedItem_(); - }, 0); - } - handleKeydown(a, b, c) { - var d = "ArrowLeft" === Xa(a), - e = "ArrowUp" === Xa(a), - f = "ArrowRight" === Xa(a), - g = "ArrowDown" === Xa(a), - h = "Home" === Xa(a), - i = "End" === Xa(a), - j = "Enter" === Xa(a), - k = "Spacebar" === Xa(a); - if (this.adapter.isRootFocused()) - return void (e || i - ? (a.preventDefault(), this.focusLastElement()) - : (g || h) && (a.preventDefault(), this.focusFirstElement())); - var l = this.adapter.getFocusedElementIndex(); - if (!(-1 === l && ((l = c), 0 > l))) { - var m; - if ((this.isVertical_ && g) || (!this.isVertical_ && f)) - this.preventDefaultEvent(a), (m = this.focusNextElement(l)); - else if ((this.isVertical_ && e) || (!this.isVertical_ && d)) - this.preventDefaultEvent(a), (m = this.focusPrevElement(l)); - else if (h) - this.preventDefaultEvent(a), (m = this.focusFirstElement()); - else if (i) - this.preventDefaultEvent(a), (m = this.focusLastElement()); - else if ((j || k) && b) { - var n = a.target; - if (n && "A" === n.tagName && j) return; - this.preventDefaultEvent(a), this.setSelectedIndexOnAction_(l, !0); - } - (this.focusedItemIndex_ = l), - void 0 !== m && - (this.setTabindexAtIndex_(m), (this.focusedItemIndex_ = m)); - } - } - handleSingleSelection(a, b, c) { - a === Qc.UNSET_INDEX || - (this.setSelectedIndexOnAction_(a, b, c), - this.setTabindexAtIndex_(a), - (this.focusedItemIndex_ = a)); - } - focusNextElement(a) { - var b = this.adapter.getListItemCount(), - c = a + 1; - if (c >= b) - if (this.wrapFocus_) c = 0; - else return a; - return this.adapter.focusItemAtIndex(c), c; - } - focusPrevElement(a) { - var b = a - 1; - if (0 > b) - if (this.wrapFocus_) b = this.adapter.getListItemCount() - 1; - else return a; - return this.adapter.focusItemAtIndex(b), b; - } - focusFirstElement() { - return this.adapter.focusItemAtIndex(0), 0; - } - focusLastElement() { - var a = this.adapter.getListItemCount() - 1; - return this.adapter.focusItemAtIndex(a), a; - } - setEnabled(a, b) { - this.isIndexValid_(a) && - this.adapter.setDisabledStateForElementIndex(a, !b); - } - preventDefaultEvent(a) { - var b = a.target, - c = "".concat(b.tagName).toLowerCase(); - -1 === wd.indexOf(c) && a.preventDefault(); - } - setSingleSelectionAtIndex_(a) { - var b = - !(1 < arguments.length && arguments[1] !== void 0) || arguments[1]; - this.selectedIndex_ === a || - (this.selectedIndex_ !== Qc.UNSET_INDEX && - (this.adapter.setSelectedStateForElementIndex( - this.selectedIndex_, - !1 - ), - this.useActivatedClass_ && - this.adapter.setActivatedStateForElementIndex( - this.selectedIndex_, - !1 - )), - b && this.adapter.setSelectedStateForElementIndex(a, !0), - this.useActivatedClass_ && - this.adapter.setActivatedStateForElementIndex(a, !0), - this.setAriaForSingleSelectionAtIndex_(a), - (this.selectedIndex_ = a), - this.adapter.notifySelected(a)); - } - setMultiSelectionAtIndex_(a) { - var b = - !(1 < arguments.length && arguments[1] !== void 0) || arguments[1], - c = xd(this.selectedIndex_), - d = vd(c, a); - if (d.removed.length || d.added.length) { - for (var e of d.removed) - b && this.adapter.setSelectedStateForElementIndex(e, !1), - this.useActivatedClass_ && - this.adapter.setActivatedStateForElementIndex(e, !1); - for (var f of d.added) - b && this.adapter.setSelectedStateForElementIndex(f, !0), - this.useActivatedClass_ && - this.adapter.setActivatedStateForElementIndex(f, !0); - (this.selectedIndex_ = a), this.adapter.notifySelected(a, d); - } - } - setAriaForSingleSelectionAtIndex_(a) { - this.selectedIndex_ === Qc.UNSET_INDEX && - (this.ariaCurrentAttrValue_ = - this.adapter.getAttributeForElementIndex(a, Pc.ARIA_CURRENT)); - var b = null !== this.ariaCurrentAttrValue_, - c = b ? Pc.ARIA_CURRENT : Pc.ARIA_SELECTED; - this.selectedIndex_ !== Qc.UNSET_INDEX && - this.adapter.setAttributeForElementIndex( - this.selectedIndex_, - c, - "false" - ); - var d = b ? this.ariaCurrentAttrValue_ : "true"; - this.adapter.setAttributeForElementIndex(a, c, d); - } - setTabindexAtIndex_(a) { - this.focusedItemIndex_ === Qc.UNSET_INDEX && 0 !== a - ? this.adapter.setTabIndexForElementIndex(0, -1) - : 0 <= this.focusedItemIndex_ && - this.focusedItemIndex_ !== a && - this.adapter.setTabIndexForElementIndex(this.focusedItemIndex_, -1), - this.adapter.setTabIndexForElementIndex(a, 0); - } - setTabindexToFirstSelectedItem_() { - var a = 0; - "number" == typeof this.selectedIndex_ && - this.selectedIndex_ !== Qc.UNSET_INDEX - ? (a = this.selectedIndex_) - : fb(this.selectedIndex_) && - 0 < this.selectedIndex_.size && - (a = Math.min(...this.selectedIndex_)), - this.setTabindexAtIndex_(a); - } - isIndexValid_(a) { - if (a instanceof Set) { - if (!this.isMulti_) - throw new Error( - "MDCListFoundation: Array of index is only supported for checkbox based list" - ); - if (0 === a.size) return !0; - var b = !1; - for (var c of a) if (((b = this.isIndexInRange_(c)), b)) break; - return b; - } - if ("number" == typeof a) { - if (this.isMulti_) - throw new Error( - "MDCListFoundation: Expected array of index for checkbox based list but got number: " + - a - ); - return a === Qc.UNSET_INDEX || this.isIndexInRange_(a); - } - return !1; - } - isIndexInRange_(a) { - var b = this.adapter.getListItemCount(); - return 0 <= a && a < b; - } - setSelectedIndexOnAction_(a, b, c) { - if (!this.adapter.getDisabledStateForElementIndex(a)) { - var d = a; - if ((this.isMulti_ && (d = new Set([a])), !!this.isIndexValid_(d))) { - if (this.isMulti_) this.toggleMultiAtIndex(a, c, b); - else if (b || c) this.setSingleSelectionAtIndex_(a, b); - else { - var e = this.selectedIndex_ === a; - e && this.setSingleSelectionAtIndex_(Qc.UNSET_INDEX); - } - b && this.adapter.notifyAction(a); - } - } - } - toggleMultiAtIndex(a, b) { - var c = - !(2 < arguments.length && arguments[2] !== void 0) || arguments[2], - d = !1; - d = void 0 === b ? !this.adapter.getSelectedStateForElementIndex(a) : b; - var e = xd(this.selectedIndex_); - d ? e.add(a) : e.delete(a), this.setMultiSelectionAtIndex_(e, c); - } - } - class zd extends pc { - constructor() { - super(...arguments), - (this.mdcFoundationClass = td), - (this.listElement_ = null), - (this.anchor = null), - (this.open = !1), - (this.quick = !1), - (this.wrapFocus = !1), - (this.innerRole = "menu"), - (this.innerAriaLabel = null), - (this.corner = "TOP_START"), - (this.x = null), - (this.y = null), - (this.absolute = !1), - (this.multi = !1), - (this.activatable = !1), - (this.fixed = !1), - (this.forceGroupSelection = !1), - (this.fullwidth = !1), - (this.menuCorner = "START"), - (this.stayOpenOnBodyClick = !1), - (this.defaultFocus = "LIST_ROOT"), - (this._listUpdateComplete = null); - } - get listElement() { - return this.listElement_ - ? this.listElement_ - : ((this.listElement_ = this.renderRoot.querySelector("mwc-list")), - this.listElement_); - } - get items() { - var a = this.listElement; - return a ? a.items : []; - } - get index() { - var a = this.listElement; - return a ? a.index : -1; - } - get selected() { - var a = this.listElement; - return a ? a.selected : null; - } - render() { - var a = "menu" === this.innerRole ? "menuitem" : "option"; - return g( - P || - (P = j([ - "\n this.mdcRoot.classList.add(a), - removeClass: (a) => this.mdcRoot.classList.remove(a), - setNotchWidthProperty: (a) => - this.notchElement.style.setProperty("width", "".concat(a, "px")), - removeNotchWidthProperty: () => - this.notchElement.style.removeProperty("width"), - }; - } - openOrClose(a, b) { - this.mdcFoundation && - (a && b !== void 0 - ? this.mdcFoundation.notch(b) - : this.mdcFoundation.closeNotch()); - } - render() { - this.openOrClose(this.open, this.width); - var a = hc({ "mdc-notched-outline--notched": this.open }); - return g( - Y || - (Y = j([ - '\n \n \n \n \n \n \n ', - ])), - a - ); - } - } - Na([Ra(".mdc-notched-outline")], Od.prototype, "mdcRoot", void 0), - Na([Pa({ type: Number })], Od.prototype, "width", void 0), - Na([Pa({ type: Boolean, reflect: !0 })], Od.prototype, "open", void 0), - Na( - [Ra(".mdc-notched-outline__notch")], - Od.prototype, - "notchElement", - void 0 - ); - var Pd = mb( - Z || - (Z = j([ - ".mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}:host{display:block;position:absolute;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] :host,:host([dir=rtl]){text-align:right}::slotted(.mdc-floating-label){display:inline-block;position:relative;top:17px;bottom:auto;max-width:100%}::slotted(.mdc-floating-label--float-above){text-overflow:clip}.mdc-notched-outline--upgraded ::slotted(.mdc-floating-label--float-above){max-width:calc(100% / 0.75)}.mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__leading,.mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{border-color:var(--mdc-notched-outline-border-color, var(--mdc-theme-primary, #6200ee));border-width:1px;border-width:var(--mdc-notched-outline-stroke-width, 1px)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0;padding-top:var(--mdc-notched-outline-notch-offset, 0)}", - ])) - ); - class Qd extends La(Od) { - static get defineId() { - return "mwc-notched-outline"; - } - static get elementDefinitions() { - return Vb([], Qd); - } - static get styles() { - return Pd; - } - } - var Rd = mb( - aa || - (aa = j([ - ':host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}', - ])) - ); - class Sd extends La(Qb) { - static get defineId() { - return "mwc-icon"; - } - static get elementDefinitions() { - return Vb([], Sd); - } - render() { - return g(ba || (ba = j([""]))); - } - static get styles() { - return Rd; - } - } - class Td extends La(md) { - static get defineId() { - return "mwc-select"; - } - static get elementDefinitions() { - return Vb([Jd, Sd, Qd], Td); - } - static get styles() { - return od; - } - } - var Ud = function (a, b) { - var c = - 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {}, - d = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {}, - e = new Event(b, { - bubbles: void 0 === d.bubbles || d.bubbles, - cancelable: !!d.cancelable, - composed: void 0 === d.composed || d.composed, - }); - return (e.detail = c), a.dispatchEvent(e), e; - }; - class Vd extends La(Qb) { - static get elementDefinitions() { - return Vb( - [Wb("ha-checkbox"), Wb("ha-formfield"), Wb("ha-form-string"), Cc, Td], - Vd - ); - } - static get styles() { - return Ub; - } - static get properties() { - return { hass: {}, _config: {} }; - } - setConfig(a) { - this._config = l(l({}, Tb), a); - } - get entityOptions() { - var a = Object.keys(this.hass.states).filter((a) => - ["switch", "light", "group"].includes(a.substr(0, a.indexOf("."))) - ); - return a.sort(), a; - } - firstUpdated() { - this._firstRendered = !0; - } - render() { - if (!this.hass) return g(ca || (ca = j([""]))); - var { header: a } = this._config; - if (!a && this._config.entity) { - var c = this._config.entity.split(".")[1] || ""; - c && ((c = c.charAt(0).toUpperCase() + c.slice(1)), (a = c)); - } - var b = this.entityOptions.map((a) => - g( - da || - (da = j([ - '\n\n
\n \n
\n\n
\n \n ', - "\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n \n \n \n \n
\n\n
\n \n \n \n \n \n \n
\n\n
\n \n \n \n \n \n \n
\n\n
\n \n \n \n \n \n \n
\n\n
\n \n \n \n \n \n \n
\n\n
\n \n \n \n \n \n \n
\n\n
\n \n \n \n \n \n \n
\n\n
\n \n \n \n \n \n \n
\n\n
\n \n \n \n
\n
\n
\n ', - ])), - { name: "header", type: "string" }, - a, - "header", - this.configChanged, - !0, - this.configChanged, - (a) => a.stopPropagation(), - "entity", - b, - { name: "brightness_icon", type: "string" }, - this._config.brightness_icon, - "brightness_icon", - this.configChanged, - { name: "white_icon", type: "string" }, - this._config.white_icon, - "white_icon", - this.configChanged, - { name: "temperature_icon", type: "string" }, - this._config.temperature_icon, - "temperature_icon", - this.configChanged, - this.checkboxConfigChanged, - this._config.color_wheel, - "color_wheel", - this.checkboxConfigChanged, - this._config.shorten_cards, - "shorten_cards", - this.checkboxConfigChanged, - this._config.persist_features, - "persist_features", - this.checkboxConfigChanged, - this._config.brightness, - "brightness", - this.checkboxConfigChanged, - this._config.color_temp, - "color_temp", - this.checkboxConfigChanged, - this._config.white_value, - "white_value", - this.checkboxConfigChanged, - this._config.speed, - "speed", - this.checkboxConfigChanged, - this._config.intensity, - "intensity", - this.checkboxConfigChanged, - this._config.color_picker, - "color_picker", - this.checkboxConfigChanged, - this._config.effects_list, - "effects_list", - this.checkboxConfigChanged, - this._config.full_width_sliders, - "full_width_sliders", - this.checkboxConfigChanged, - this._config.show_slider_percent, - "show_slider_percent", - this.checkboxConfigChanged, - this._config.smooth_color_wheel, - "smooth_color_wheel", - this.checkboxConfigChanged, - this._config.consolidate_entities, - "consolidate_entities", - this.checkboxConfigChanged, - this._config.hide_header, - "hide_header", - this.checkboxConfigChanged, - this._config.child_card, - "child_card", - this.checkboxConfigChanged, - this._config.force_features, - "force_features" - ); - } - configChanged(a) { - if (this._config && this.hass && this._firstRendered) { - var { - target: { configValue: b, value: c }, - detail: { value: d }, - } = a; - (this._config = - void 0 !== d && null !== d - ? l(l({}, this._config), {}, { [b]: d }) - : l(l({}, this._config), {}, { [b]: c })), - Ud(this, "config-changed", { config: this._config }); - } - } - checkboxConfigChanged(a) { - if (this._config && this.hass && this._firstRendered) { - var { - target: { value: b, checked: c }, - } = a; - (this._config = l(l({}, this._config), {}, { [b]: c })), - Ud(this, "config-changed", { config: this._config }); - } - } - } - var Wd = "light-entity-card-editor"; - customElements.define(Wd, Vd), - console.info( - "%c LIGHT-ENTITY-CARD \n%c Version ".concat( - { - name: "light-entity-card", - version: "5.0.0", - description: "A light-entity card for Home Assistant Lovelace UI", - keywords: [ - "home-assistant", - "homeassistant", - "hass", - "automation", - "lovelace", - "custom-cards", - "light-entity", - ], - repository: "git@github.com:ljmerza/light-entity-card.git", - author: "Leonardo Merza ", - license: "MIT", - dependencies: { - "@lit-labs/scoped-registry-mixin": "^1.0.0", - "@material/mwc-icon": "^0.25.3", - "@material/mwc-list": "^0.25.3", - "@material/mwc-menu": "^0.25.3", - "@material/mwc-notched-outline": "^0.25.3", - "@material/mwc-ripple": "^0.25.3", - "@material/mwc-select": "^0.25.3", - "core-js": "^2.6.5", - lit: "^2.1.2", - }, - devDependencies: { - "@babel/cli": "^7.4.3", - "@babel/core": "^7.4.3", - "@babel/plugin-proposal-class-properties": "^7.3.3", - "@babel/plugin-proposal-decorators": "^7.3.0", - "@babel/plugin-transform-template-literals": "^7.2.0", - "@babel/preset-env": "^7.3.1", - "@rollup/plugin-json": "^4.0.3", - "babel-plugin-iife-wrap": "^1.1.0", - "babel-preset-minify": "^0.5.0", - eslint: "^5.16.0", - "eslint-config-airbnb-base": "^13.1.0", - "eslint-plugin-import": "2.16.0", - rollup: "^0.66.6", - "rollup-plugin-node-resolve": "^3.4.0", - }, - resolutions: { - lit: "^2.1.2", - "lit-html": "2.1.2", - "lit-element": "3.1.2", - "@lit/reactive-element": "1.2.1", - }, - scripts: { - build: "npm run rollup && npm run babel", - rollup: "rollup -c", - babel: - "babel dist/light-entity-card.js --out-file dist/light-entity-card.js", - lint: "eslint src/* --ext .js", - watch: "rollup -c --watch", - start: "rollup -c --watch", - }, - }.version, - " " - ), - "color: orange; font-weight: bold; background: black", - "color: white; font-weight: bold; background: dimgray" - ); - class Xd extends La(Qb) { - static get elementDefinitions() { - return Vb( - [ - Wb("ha-card"), - Wb("more-info-light"), - Wb("ha-switch"), - Wb("ha-icon"), - Wb("ha-slider"), - Wb("ha-color-picker"), - Td, - Cc, - ], - Xd - ); - } - firstUpdated() { - return o(function* () { - if (window.loadCardHelpers) { - var a = yield window.loadCardHelpers(); - a.importMoreInfoControl("light"); - } - })(); - } - static get properties() { - return { hass: Object, config: Object }; - } - setConfig(a) { - if (!a.entity) throw Error("entity required."); - (this.config = l(l({}, Tb), a)), - (this._hueSegments = this.config.smooth_color_wheel ? 0 : 24), - (this._saturationSegments = this.config.smooth_color_wheel ? 0 : 8); - } - static getConfigElement() { - return o(function* () { - return document.createElement(Wd); - })(); - } - static get featureNames() { - return { - brightness: 1, - colorTemp: 2, - effectList: 4, - color: 16, - whiteValue: 128, - }; - } - static get cmdToggle() { - return { on: "turn_on", off: "turn_off" }; - } - static get entityLength() { - return { light: 10, switch: 1 }; - } - getCardSize() { - if ( - !this.config || - !this.__hass || - !this.__hass.states[this.config.entity] - ) - return 1; - var a = 0, - b = this.__hass.states[this.config.entity]; - return ( - Array.isArray(b.attributes.entity_id) - ? b.attributes.entity_id.forEach( - (b) => (a += this.getEntityLength(b)) - ) - : (a += this.getEntityLength(b.attributes.entity_id)), - this.config.group && (a *= 0.8), - parseInt(a, 1) - ); - } - getEntityLength(a) { - return /^light\./.test(a) - ? Xd.entityLength.light - : /^switch\./.test(a) - ? Xd.entityLength.switch - : 0; - } - get styles() { - return Sb; - } - get language() { - return this.__hass.resources[this.__hass.language]; - } - isEntityOn(a) { - return "on" === a.state; - } - updated() { - (this._isUpdating = !1), - this._shownStateObjects.forEach((a) => { - var b = this.generateColorPickerId(a), - c = this.shadowRoot.querySelectorAll("#".concat(b)); - if (c.length) { - var d = (a.attributes.hs_color && a.attributes.hs_color[0]) || 0, - e = - (a.attributes.hs_color && a.attributes.hs_color[1] / 100) || - 0; - c[0].desiredHsColor = { h: d, s: e }; - } - }); - } - render() { - var a = this.__hass.states[this.config.entity]; - if (!a) - return g( - fa || - (fa = j([ - "\n \n ", - " \n ", - ])), - this.styles, - "Invalid entity: ".concat(this.config.entity) - ); - (this._isUpdating = !0), - (this._stateObjects = this.getEntitiesToShow(a)), - (this._shownStateObjects = this.config.consolidate_entities - ? [a] - : [...this._stateObjects]); - var b = this._shownStateObjects.reduce( - (a, b) => - g(ga || (ga = j(["", "", ""])), a, this.createEntityTemplate(b)), - "" - ), - c = "light-entity-card " - .concat(this.config.shorten_cards ? " group" : "", " ") - .concat(this.config.child_card ? " light-entity-child-card" : ""); - return g( - ha || - (ha = j([ - "\n \n \n \n ', - " ", - "\n ", - " ", - "\n ", - "\n
\n ", - " ", - "\n ", - ])), - this.createHeader(a), - b, - this.createBrightnessSlider(a), - this.createSpeedSlider(a), - this.createIntensitySlider(a), - this.createColorTemperature(a), - this.createWhiteValue(a), - this.createColorPicker(a), - this.createEffectList(a) - ); - } - createHeader(a) { - if (this.config.hide_header) return g(ja || (ja = j([""]))); - var b = this.config.header || a.attributes.friendly_name || a.entity_id; - return g( - ka || - (ka = j([ - '\n
\n
', - '
\n
\n \n
\n \n
\n \n ', - "\n
\n ", - ])), - this.config.brightness_icon, - a.attributes.brightness, - (b) => this._setValue(b, a, "brightness"), - this.showPercent(a.attributes.brightness, 0, 254) - ); - } - createSpeedSlider(a) { - return !1 === this.config.speed - ? g(oa || (oa = j([""]))) - : this.dontShowFeature("speed", a) - ? g(pa || (pa = j([""]))) - : g( - qa || - (qa = j([ - '\n
\n
\n \n
\n \n ', - "\n
\n ", - ])), - this.config.speed_icon, - a.attributes.speed, - (b) => this._setValue(b, a, "speed"), - this.showPercent(a.attributes.speed, 0, 254) - ); - } - createIntensitySlider(a) { - return !1 === this.config.speed - ? g(ra || (ra = j([""]))) - : this.dontShowFeature("intensity", a) - ? g(sa || (sa = j([""]))) - : g( - ta || - (ta = j([ - '\n
\n
\n \n
\n \n ', - "\n
\n ", - ])), - this.config.intensity_icon, - a.attributes.intensity, - (b) => this._setValue(b, a, "intensity"), - this.showPercent(a.attributes.intensity, 0, 254) - ); - } - showPercent(a, b, c) { - if (!this.config.show_slider_percent) return g(ua || (ua = j([""]))); - var d = parseInt((100 * (a - b)) / (c - b), 0); - return ( - isNaN(d) && (d = 0), - g(va || (va = j(['
', "%
"])), d) - ); - } - createColorTemperature(a) { - if (!1 === this.config.color_temp) return g(wa || (wa = j([""]))); - if (this.dontShowFeature("colorTemp", a)) - return g(xa || (xa = j([""]))); - var b = this.showPercent( - a.attributes.color_temp, - a.attributes.min_mireds - 1, - a.attributes.max_mireds - 1 - ); - return g( - ya || - (ya = j([ - '\n
\n \n \n \n ', - "\n
\n ", - ])), - this.config.temperature_icon, - a.attributes.min_mireds, - a.attributes.max_mireds, - a.attributes.color_temp, - (b) => this._setValue(b, a, "color_temp"), - b - ); - } - createWhiteValue(a) { - return !1 === this.config.white_value - ? g(za || (za = j([""]))) - : this.dontShowFeature("whiteValue", a) - ? g(Aa || (Aa = j([""]))) - : g( - Ba || - (Ba = j([ - '\n
\n
\n \n
\n \n \n ', - "\n
\n ", - ])), - this.config.white_icon, - a.attributes.white_value, - (b) => this._setValue(b, a, "white_value"), - this.showPercent(a.attributes.white_value, 0, 254) - ); - } - createEffectList(a) { - if (!1 === this.config.effects_list) return g(Ca || (Ca = j([""]))); - if (!this.config.persist_features && !this.isEntityOn(a)) - return g(Da || (Da = j([""]))); - var b = a.attributes.effect_list || []; - if (this.config.effects_list && Array.isArray(this.config.effects_list)) - b = this.config.effects_list; - else if ( - this.config.effects_list && - this.hass.states[this.config.effects_list] - ) { - var e = this.hass.states[this.config.effects_list]; - b = (e.attributes && e.attributes.options) || []; - } else if (this.dontShowFeature("effectList", a)) - return g(Ea || (Ea = j([""]))); - var c = b.map((b) => this.createListItem(a, b)), - d = this.language["ui.card.light.effect"]; - return g( - Fa || - (Fa = j([ - '\n
\n ', - " \n
\n ", - ])), - (b) => this.setEffect(b, a), - d, - c - ); - } - createListItem(a, b) { - return g( - Ga || - (Ga = j([ - '\n + + + +
+
+
+ `}configChanged(t){if(!this._config||!this.hass||!this._firstRendered)return;const{target:{configValue:e,value:i},detail:{value:n}}=t;this._config=null!=n?{...this._config,[e]:n}:{...this._config,[e]:i},ai(this,"config-changed",{config:this._config})}checkboxConfigChanged(t){if(!this._config||!this.hass||!this._firstRendered)return;const{target:{value:e,checked:i}}=t;this._config={...this._config,[e]:i},ai(this,"config-changed",{config:this._config})}}var ci=i(0);customElements.define("light-entity-card-editor",li),console.info("light-entity-card v"+ci.version);class hi extends(ei(Ct)){static get elementDefinitions(){return oi([si("ha-card"),si("more-info-light"),si("ha-switch"),si("ha-icon"),si("state-badge"),si("ha-slider"),si("ha-color-picker"),si("ha-select"),si("mwc-list-item")],hi)}static get properties(){return{hass:{},config:{}}}async firstUpdated(){this.setColorWheels(),this._firstUpdate=!0}async updated(){this.setColorWheels()}setColorWheels(){if(!this._shownStateObjects)return;const t=this.getColorPickerWidth();for(const e of this._shownStateObjects){const i=this.renderRoot.getElementById("picker-"+e.entity_id);if(!i)continue;i.innerHTML="";let n={h:0,s:0,l:50};if(e.attributes.hs_color){n={h:parseInt(e.attributes.hs_color[0]),s:parseInt(e.attributes.hs_color[1]),l:50}}new Ye.ColorPicker(i,{sliderSize:0,color:n,width:t,wheelLightness:!1}).on("input:end",t=>this.setColorPicker(t.hsl,e))}}getColorPickerWidth(){const t=this.shadowRoot.querySelector(".light-entity-card").offsetWidth,e=this.config.shorten_cards,i=t-(e?100:50),n=e?200:300;return n>i?i:n}setConfig(t){if(!t.entity)throw Error("entity required.");this.config={...ni,...t}}static async getConfigElement(){return document.createElement("light-entity-card-editor")}static get featureNames(){return{brightness:1,colorTemp:2,effectList:4,color:16,whiteValue:128}}static get cmdToggle(){return{on:"turn_on",off:"turn_off"}}static get entityLength(){return{light:10,switch:1}}getCardSize(){if(!this.config||!this.__hass||!this.__hass.states[this.config.entity])return 1;let t=0;const e=this.__hass.states[this.config.entity];return Array.isArray(e.attributes.entity_id)?e.attributes.entity_id.forEach(e=>t+=this.getEntityLength(e)):t+=this.getEntityLength(e.attributes.entity_id),this.config.group&&(t*=.8),parseInt(t,1)}getEntityLength(t){return/^light\./.test(t)?hi.entityLength.light:/^switch\./.test(t)?hi.entityLength.switch:0}get styles(){return ii}get language(){return this.__hass.resources[this.__hass.language]}isEntityOn(t){return"on"===t.state}render(){const t=this.hass.states[this.config.entity];if(!t)return Q` + + ${"Invalid entity: "+this.config.entity} + `;this._stateObjects=this.getEntitiesToShow(t),this.config.consolidate_entities?this._shownStateObjects=[t]:this._shownStateObjects=[...this._stateObjects];const e=this._shownStateObjects.reduce((t,e)=>Q`${t}${this.createEntityTemplate(e)}`,""),i=`light-entity-card ${this.config.shorten_cards?" group":""} ${this.config.child_card?" light-entity-child-card":""}`;return setTimeout(()=>{this.setColorWheels()},100),Q` + + + ${e} + + `}getEntitiesToShow(t){return t.attributes.entity_id&&Array.isArray(t.attributes.entity_id)?t.attributes.entity_id.map(t=>this.hass.states[t]).filter(Boolean):[t]}createEntityTemplate(t){const e=this.config.full_width_sliders?"ha-slider-full-width":"";return Q` + ${this.createHeader(t)} +
+ ${this.createBrightnessSlider(t)} ${this.createSpeedSlider(t)} + ${this.createIntensitySlider(t)} ${this.createColorTemperature(t)} + ${this.createWhiteValue(t)} +
+ ${this.createColorPicker(t)} ${this.createEffectList(t)} + `}createHeader(t){if(this.config.hide_header)return Q``;const e=this.config.header||t.attributes.friendly_name||t.entity_id;return Q` +
+ ${this.showHeaderIcon(t)} +
${e}
+
+ this.setToggle(e,t)}> +
+
+ `}showHeaderIcon(t){return this.config.show_header_icon?Q` +
+ +
+ `:Q``}createBrightnessSlider(t){return!1===this.config.brightness||this.dontShowFeature("brightness",t)?Q``:Q` +
+
+ +
+ + ${this.showPercent(t.attributes.brightness,0,254)} +
+ `}createSpeedSlider(t){return!1===this.config.speed||this.dontShowFeature("speed",t)?Q``:Q` +
+
+ +
+ + ${this.showPercent(t.attributes.speed,0,254)} +
+ `}createIntensitySlider(t){return!1===this.config.speed||this.dontShowFeature("intensity",t)?Q``:Q` +
+
+ +
+ + ${this.showPercent(t.attributes.intensity,0,254)} +
+ `}showPercent(t,e,i){if(!this.config.show_slider_percent)return Q``;let n=parseInt(100*(t-e)/(i-e),0);return isNaN(n)&&(n=0),Q`
${n}%
`}createColorTemperature(t){if(!1===this.config.color_temp)return Q``;if(this.dontShowFeature("colorTemp",t))return Q``;const e=this.showPercent(t.attributes.color_temp,t.attributes.min_mireds-1,t.attributes.max_mireds-1);return Q` +
+
+ +
+ + + ${e} +
+ `}createWhiteValue(t){return!1===this.config.white_value||this.dontShowFeature("whiteValue",t)?Q``:Q` +
+
+ +
+ + + ${this.showPercent(t.attributes.white_value,0,254)} +
+ `}createEffectList(t){if(!1===this.config.effects_list)return Q``;if(!this.config.persist_features&&!this.isEntityOn(t))return Q``;let e=t.attributes.effect_list||[];if(this.config.effects_list&&Array.isArray(this.config.effects_list))e=this.config.effects_list;else if(this.config.effects_list&&this.hass.states[this.config.effects_list]){const t=this.hass.states[this.config.effects_list];e=t.attributes&&t.attributes.options||[]}else if(this.dontShowFeature("effectList",t))return Q``;const i=e.map(e=>this.createListItem(t,e)),n=this.language["ui.card.light.effect"];return Q` +
+ this.setEffect(e,t)} + label="${n}" + > + ${i} + +
+ `}createListItem(t,e){return Q`${e}`}createColorPicker(t){return!1===this.config.color_picker||this.dontShowFeature("color",t)?Q``:Q` +
+
+
+ `}dontShowFeature(t,e){if(this.config.force_features)return!1;if("speed"===t&&"speed"in e.attributes)return!0;if("intensity"===t&&"intensity"in e.attributes)return!0;let i=hi.featureNames[t]&e.attributes.supported_features;const n=e.attributes.supported_color_modes||[];if(!i)switch(t){case"brightness":if(i=Object.prototype.hasOwnProperty.call(e.attributes,"brightness"),!i){const t=["hs","rgb","rgbw","rgbww","white","brightness","color_temp","xy"];i=[...new Set(n.filter(e=>t.includes(e)))].length>0}break;case"colorTemp":if(n){const t=["color_temp"];i=[...new Set(n.filter(e=>t.includes(e)))].length>0}break;case"effectList":i=e.attributes.effect_list&&e.attributes.effect_list.length;break;case"color":if(!i){const t=["hs","rgb","rgbw","rgbww","xy"];i=[...new Set(n.filter(e=>t.includes(e)))].length>0}break;case"whiteValue":i=Object.prototype.hasOwnProperty.call(e.attributes,"white_value");break;default:i=!1}return!i||(!this.config.persist_features&&!this.isEntityOn(e)||void 0)}setColorPicker(t,e){this.callEntityService({hs_color:[t.h,t.s]},e)}_setValue(t,e,i){const n=parseInt(t.target.value,0);isNaN(n)||parseInt(e.attributes[i],0)===n||this.callEntityService({[i]:n},e)}setToggle(t,e){const i=this.isEntityOn(e)?hi.cmdToggle.off:hi.cmdToggle.on;this.callEntityService({},e,i)}setEffect(t,e){t.target.value&&this.callEntityService({effect:t.target.value},e)}callEntityService(t,e,i){if(!this._firstUpdate)return;let n=e.entity_id.split(".")[0];"group"===n&&(n="homeassistant"),this.hass.callService(n,i||hi.cmdToggle.on,{entity_id:e.entity_id,...t})}}customElements.define("light-entity-card",hi),window.customCards=window.customCards||[],window.customCards.push({type:"light-entity-card",name:"Light Entity Card",description:"Control lights and switches"})}]); +//# sourceMappingURL=light-entity-card.js.map diff --git a/custom_components/ui_lovelace_minimalist/cards/lovelace-auto-entities/lovelace-auto-entities.js b/custom_components/ui_lovelace_minimalist/cards/lovelace-auto-entities/lovelace-auto-entities.js index 75507c9a2..84a74b4b6 100644 --- a/custom_components/ui_lovelace_minimalist/cards/lovelace-auto-entities/lovelace-auto-entities.js +++ b/custom_components/ui_lovelace_minimalist/cards/lovelace-auto-entities/lovelace-auto-entities.js @@ -1,4 +1,4 @@ -function t(t,e,i,n){var s,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,i,r):s(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),s=new WeakMap;let o=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)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(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}};const r=(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 o(i,t,n)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,n))(e)})(t):t;var l;const d=window,c=d.trustedTypes,h=c?c.emptyScript:"",u=d.reactiveElementPolyfillSupport,v={toAttribute(t,e){switch(e){case Boolean:t=t?h: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}},f=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:f};let g=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}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=p){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 s=this[t];this[e]=n,this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!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(a(t))}else void 0!==t&&e.push(a(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}u(){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 n=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{i?t.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((i=>{const n=document.createElement("style"),s=e.litNonce;void 0!==s&&n.setAttribute("nonce",s),n.textContent=i.cssText,t.appendChild(n)}))})(n,this.constructor.elementStyles),n}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=p){var n;const s=this.constructor._$Ep(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:v).toAttribute(e,i.type);this._$El=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,s=n._$Ev.get(t);if(void 0!==s&&this._$El!==s){const t=n.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:v;this._$El=s,this[s]=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||f)(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 _;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:g}),(null!==(l=d.reactiveElementVersions)&&void 0!==l?l:d.reactiveElementVersions=[]).push("1.5.0");const m=window,y=m.trustedTypes,b=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,$=`lit$${(Math.random()+"").slice(9)}$`,w="?"+$,E=`<${w}>`,A=document,C=(t="")=>A.createComment(t),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,k=/-->/g,x=/>/g,T=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),U=/'/g,P=/"/g,M=/^(?:script|style|textarea|title)$/i,N=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),I=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),H=new WeakMap,D=A.createTreeWalker(A,129,null,!1),F=(t,e)=>{const i=t.length-1,n=[];let s,o=2===e?"":"",r=j;for(let e=0;e"===l[0]?(r=null!=s?s:j,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?T:'"'===l[3]?P:U):r===P||r===U?r=T:r===k||r===x?r=j:(r=T,s=void 0);const h=r===T&&t[e+1].startsWith("/>")?" ":"";o+=r===j?i+E:d>=0?(n.push(a),i.slice(0,d)+"$lit$"+i.slice(d)+$+h):i+$+(-2===d?(n.push(void 0),e):h)}const a=o+(t[i]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==b?b.createHTML(a):a,n]};class L{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let s=0,o=0;const r=t.length-1,a=this.parts,[l,d]=F(t,e);if(this.el=L.createElement(l,i),D.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=D.nextNode())&&a.length0){n.textContent=y?y.emptyScript:"";for(let i=0;iO(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==R&&S(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,s="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=L.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.p(i);else{const t=new W(s,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=H.get(t.strings);return void 0===e&&H.set(t.strings,e=new L(t)),e}k(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const s of t)n===e.length?e.push(i=new z(this.O(C()),this.O(C()),this,this.options)):i=e[n],i._$AI(s),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const s=this.strings;let o=!1;if(void 0===s)t=G(this,t,e,0),o=!S(t)||t!==this._$AH&&t!==I,o&&(this._$AH=t);else{const n=t;let r,a;for(t=s[0],r=0;r{var n,s;const o=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let r=o._$litPart$;if(void 0===r){const t=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:null;o._$litPart$=r=new z(e.insertBefore(C(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(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 I}}tt.finalized=!0,tt._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:tt});const et=globalThis.litElementPolyfillSupport;null==et||et({LitElement:tt}),(null!==(X=globalThis.litElementVersions)&&void 0!==X?X:globalThis.litElementVersions=[]).push("3.2.2");const it=(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)}};function nt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):it(t,e)}function st(t){return nt({...t,state:!0})}var ot;function rt(){return document.querySelector("hc-main")?document.querySelector("hc-main").hass:document.querySelector("home-assistant")?document.querySelector("home-assistant").hass:void 0}null===(ot=window.HTMLSlotElement)||void 0===ot||ot.prototype.assignedElements;const at="lovelace-player-device-id";function lt(){if(!localStorage[at]){const t=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);window.fully&&"function"==typeof fully.getDeviceId?localStorage[at]=fully.getDeviceId():localStorage[at]=`${t()}${t()}-${t()}${t()}`}return localStorage[at]}let dt=lt();const ct=new URLSearchParams(window.location.search);var ht;function ut(t){return!!String(t).includes("{%")||(!!String(t).includes("{{")||void 0)}ct.get("deviceID")&&null!==(ht=ct.get("deviceID"))&&("clear"===ht?localStorage.removeItem(at):localStorage[at]=ht,dt=lt()),window.cardMod_template_cache=window.cardMod_template_cache||{};const vt=window.cardMod_template_cache;async function ft(t,e,i){const n=rt().connection,s=JSON.stringify([e,i]);let o=vt[s];o?(o.callbacks.has(t)||pt(t),t(o.value),o.callbacks.add(t)):(pt(t),t(""),i=Object.assign({user:rt().user.name,browser:dt,hash:location.hash.substr(1)||""},i),vt[s]=o={template:e,variables:i,value:"",callbacks:new Set([t]),unsubscribe:n.subscribeMessage((t=>function(t,e){const i=vt[t];i&&(i.value=e.result,i.callbacks.forEach((t=>t(e.result))))}(s,t)),{type:"render_template",template:e,variables:i})})}async function pt(t){let e;for(const[i,n]of Object.entries(vt))if(n.callbacks.has(t)){n.callbacks.delete(t),0==n.callbacks.size&&(e=n.unsubscribe,delete vt[i]);break}e&&await(await e)()}var gt;const _t=(t,e)=>{if(t===e)return!0;if(typeof t!=typeof e)return!1;if(!(t instanceof Object&&e instanceof Object))return!1;for(const i in t)if(t.hasOwnProperty(i)){if(!e.hasOwnProperty(i))return!1;if(t[i]!==e[i]){if("object"!=typeof t[i])return!1;if(!_t(t[i],e[i]))return!1}}for(const i in e)if(e.hasOwnProperty(i)&&!t.hasOwnProperty(i))return!1;return!0};window.autoEntities_cache=null!==(gt=window.autoEntities_cache)&&void 0!==gt?gt:{};const mt=window.autoEntities_cache;async function yt(t){var e;return mt.areas=null!==(e=mt.areas)&&void 0!==e?e:await t.callWS({type:"config/area_registry/list"}),mt.areas}function bt(){return mt.areas}async function $t(t){var e;return mt.devices=null!==(e=mt.devices)&&void 0!==e?e:await t.callWS({type:"config/device_registry/list"}),mt.devices}function wt(){return mt.devices}async function Et(t){var e;return mt.entities=null!==(e=mt.entities)&&void 0!==e?e:await t.callWS({type:"config/entity_registry/list"}),mt.entities}function At(){return mt.entities}const Ct=/([mhd])\s+ago\s*$/i,St="m ago";function Ot(t,e){if("string"==typeof t&&t.startsWith("$$")&&(t=t.substring(2),e=JSON.stringify(e)),"string"==typeof e&&"string"==typeof t&&(t.startsWith("/")&&t.endsWith("/")||-1!==t.indexOf("*"))){return t.startsWith("/")||(t=`/^${t=t.replace(/\./g,".").replace(/\*/g,".*")}$/`),new RegExp(t.slice(1,-1)).test(e)}if("string"==typeof t){const i=Ct.exec(t);if(i){t=t.replace(i[0],"");e=((new Date).getTime()-new Date(e).getTime())/6e4;const n=i[1];"h"===n?e/=60:"d"===n&&(e=e/60/24)}}if("string"==typeof t){if(t.startsWith("<="))return parseFloat(e)<=parseFloat(t.substring(2));if(t.startsWith(">="))return parseFloat(e)>=parseFloat(t.substring(2));if(t.startsWith("<"))return parseFloat(e)"))return parseFloat(e)>parseFloat(t.substring(1));if(t.startsWith("!"))return parseFloat(e)!=parseFloat(t.substring(1));if(t.startsWith("="))return parseFloat(e)==parseFloat(t.substring(1))}return t===e}const jt={options:async()=>!0,sort:async()=>!0,domain:async(t,e,i)=>Ot(e,i.entity_id.split(".")[0]),entity_id:async(t,e,i)=>Ot(e,i.entity_id),state:async(t,e,i)=>Ot(e,i.state),name:async(t,e,i)=>{var n;return Ot(e,null===(n=i.attributes)||void 0===n?void 0:n.friendly_name)},group:async(t,e,i)=>{var n,s,o;return null===(o=null===(s=null===(n=t.states[e])||void 0===n?void 0:n.attributes)||void 0===s?void 0:s.entity_id)||void 0===o?void 0:o.includes(i.entity_id)},attributes:async(t,e,i)=>{for(const[t,n]of Object.entries(e)){let e=t.split(" ")[0],s=i.attributes;for(const t of e.split(":"))s=s?s[t]:void 0;if(void 0===s||!Ot(n,s))return!1}return!0},not:async(t,e,i)=>!await kt(t,e,i.entity_id),and:async(t,e,i)=>{for(const n of e)if(!await kt(t,n,i.entity_id))return!1;return!0},or:async(t,e,i)=>{for(const n of e)if(await kt(t,n,i.entity_id))return!0;return!1},device:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));if(!n)return!1;const s=(await $t(t)).find((t=>t.id===n.device_id));return!!s&&(Ot(e,s.name_by_user)||Ot(e,s.name))},device_manufacturer:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));if(!n)return!1;const s=(await $t(t)).find((t=>t.id===n.device_id));return!!s&&Ot(e,s.manufacturer)},device_model:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));if(!n)return!1;const s=(await $t(t)).find((t=>t.id===n.device_id));return!!s&&Ot(e,s.model)},area:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));if(!n)return!1;let s=(await yt(t)).find((t=>t.area_id===n.area_id));if(s)return Ot(e,s.name)||Ot(e,s.area_id);const o=(await $t(t)).find((t=>t.id===n.device_id));return!!o&&(s=(await yt(t)).find((t=>t.area_id===o.area_id)),!!s&&(Ot(e,s.name)||Ot(e,s.area_id)))},entity_category:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));return!!n&&Ot(e,n.entity_category)},last_changed:async(t,e,i)=>(Ct.test(e)||(e+=St),Ot(e,i.last_changed)),last_updated:async(t,e,i)=>(Ct.test(e)||(e+=St),Ot(e,i.last_updated)),last_triggered:async(t,e,i)=>null!=i.attributes.last_triggered&&(Ct.test(e)||(e+=St),Ot(e,i.attributes.last_triggered)),integration:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));return!!n&&Ot(e,n.platform)},hidden_by:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));return!!n&&Ot(e,n.hidden_by)}};async function kt(t,e,i){var n;if(!t.states[i])return!1;for(let[s,o]of Object.entries(e))if(s=s.trim().split(" ")[0].trim(),!await(null===(n=jt[s])||void 0===n?void 0:n.call(jt,t,o,t.states[i])))return!1;return!0}function xt(t,e,i){var n,s,o,r;const[a,l]=i.reverse?[-1,1]:[1,-1];return i.ignore_case&&(t=null!==(s=null===(n=null==t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t))&&void 0!==s?s:t,e=null!==(r=null===(o=null==e?void 0:e.toLowerCase)||void 0===o?void 0:o.call(e))&&void 0!==r?r:e),i.numeric&&(isNaN(parseFloat(t))&&isNaN(parseFloat(e))||(t=isNaN(parseFloat(t))?void 0:parseFloat(t),e=isNaN(parseFloat(e))?void 0:parseFloat(e))),void 0===t&&void 0===e?0:void 0===t?a:void 0===e?l:i.numeric?t===e?0:(i.reverse?-1:1)*(t0,domain:(t,e,i)=>{var n,s;return xt(null===(n=null==t?void 0:t.entity_id)||void 0===n?void 0:n.split(".")[0],null===(s=null==e?void 0:e.entity_id)||void 0===s?void 0:s.split(".")[0],i)},entity_id:(t,e,i)=>xt(null==t?void 0:t.entity_id,null==e?void 0:e.entity_id,i),friendly_name:(t,e,i)=>{var n,s,o,r;return xt((null===(n=null==t?void 0:t.attributes)||void 0===n?void 0:n.friendly_name)||(null===(s=null==t?void 0:t.entity_id)||void 0===s?void 0:s.split(".")[1]),(null===(o=null==e?void 0:e.attributes)||void 0===o?void 0:o.friendly_name)||(null===(r=null==e?void 0:e.entity_id)||void 0===r?void 0:r.split(".")[1]),i)},name:(t,e,i)=>{var n,s,o,r;return xt((null===(n=null==t?void 0:t.attributes)||void 0===n?void 0:n.friendly_name)||(null===(s=null==t?void 0:t.entity_id)||void 0===s?void 0:s.split(".")[1]),(null===(o=null==e?void 0:e.attributes)||void 0===o?void 0:o.friendly_name)||(null===(r=null==e?void 0:e.entity_id)||void 0===r?void 0:r.split(".")[1]),i)},device:(t,e,i)=>{var n,s;const o=At().find((e=>e.entity_id===t.entity_id)),r=At().find((t=>t.entity_id===e.entity_id));if(!o||!r)return 0;const a=wt().find((t=>t.id===o.device_id)),l=wt().find((t=>t.id===r.device_id));return a&&l?xt(null!==(n=a.name_by_user)&&void 0!==n?n:a.name,null!==(s=l.name_by_user)&&void 0!==s?s:l.name,i):0},area:(t,e,i)=>{const n=At().find((e=>e.entity_id===t.entity_id)),s=At().find((t=>t.entity_id===e.entity_id));if(!n||!s)return 0;const o=wt().find((t=>t.id===n.device_id)),r=wt().find((t=>t.id===s.device_id));if(!o||!r)return 0;const a=bt().find((t=>t.area_id===o.area_id)),l=bt().find((t=>t.area_id===r.area_id));return a&&l?xt(a.name,l.name,i):0},state:(t,e,i)=>xt(null==t?void 0:t.state,null==e?void 0:e.state,i),attribute:(t,e,i)=>{var n;const[s,o]=(null==i?void 0:i.reverse)?[-1,1]:[1,-1];let r=null==t?void 0:t.attributes,a=null==e?void 0:e.attributes;for(const t of null===(n=null==i?void 0:i.attribute)||void 0===n?void 0:n.split(":")){if(void 0===r&&void 0===a)return 0;if(void 0===r)return s;if(void 0===a)return o;[r,a]=[r[t],a[t]]}return xt(r,a,i)},last_changed:(t,e,i)=>{const[n,s]=(null==i?void 0:i.reverse)?[-1,1]:[1,-1];return null==(null==t?void 0:t.last_changed)&&null==(null==e?void 0:e.last_changed)?0:null==(null==t?void 0:t.last_changed)?n:null==(null==e?void 0:e.last_changed)?s:(i.numeric=!0,xt(new Date(null==t?void 0:t.last_changed).getTime(),new Date(null==e?void 0:e.last_changed).getTime(),i))},last_updated:(t,e,i)=>{const[n,s]=(null==i?void 0:i.reverse)?[-1,1]:[1,-1];return null==(null==t?void 0:t.last_updated)&&null==(null==e?void 0:e.last_updated)?0:null==(null==t?void 0:t.last_updated)?n:null==(null==e?void 0:e.last_updated)?s:(i.numeric=!0,xt(new Date(null==t?void 0:t.last_updated).getTime(),new Date(null==e?void 0:e.last_updated).getTime(),i))},last_triggered:(t,e,i)=>{var n,s,o,r,a,l;const[d,c]=(null==i?void 0:i.reverse)?[-1,1]:[1,-1];return null==(null===(n=null==t?void 0:t.attributes)||void 0===n?void 0:n.last_triggered)&&null==(null===(s=null==e?void 0:e.attributes)||void 0===s?void 0:s.last_triggered)?0:null==(null===(o=null==t?void 0:t.attributes)||void 0===o?void 0:o.last_triggered)?d:null==(null===(r=null==e?void 0:e.attributes)||void 0===r?void 0:r.last_triggered)?c:(i.numeric=!0,xt(new Date(null===(a=null==t?void 0:t.attributes)||void 0===a?void 0:a.last_triggered).getTime(),new Date(null===(l=null==e?void 0:e.attributes)||void 0===l?void 0:l.last_triggered).getTime(),i))}};function Ut(t,e){return function(i,n){var s,o;return null!==(o=null===(s=Tt[e.method])||void 0===s?void 0:s.call(Tt,t.states[i.entity],t.states[n.entity],e))&&void 0!==o?o:0}}var Pt="1.12.1";const Mt=["none","domain","entity_id","state","name","group","area","device","device_manufacturer","device_model","attributes","last_changed","last_updated","last_triggered","entity_category","integration","hidden_by"],Nt={type:"select",options:[["domain","Entity Domain"],["entity_id","Entity ID"],["state","Entity State"],["name","Friendly Name"],["group","Member of Group"],["area","In area"],["device","Device"],["device_manufacturer","Device Manufacturer"],["device_model","Device Model"],["attributes","Attribute"],["last_changed","Last Change"],["last_updated","Last Update"],["last_triggered","Last Trigger"],["entity_category","Entity Category"],["integration","Governing integration"],["hidden_by","Hidden by"]]},It=([t,e],i)=>{var n;return Mt.includes(t)?{type:"grid",name:"",schema:[Object.assign(Object.assign({},Nt),{name:`key_${i}`,label:"Property"}),{name:`value_${i}`,selector:null!==(n={attributes:{object:{}}}[t])&&void 0!==n?n:{text:{}},label:"Value"}]}:{type:"Constant",name:"Some filters are not shown",value:"Please switch to the CODE EDITOR to access all options."}},Rt=[{name:"options",selector:{object:{}}}],Ht=[{name:"data",selector:{object:{}}}],Dt=[{name:"method",label:"Sort method",type:"select",options:[["domain","Entity Domain"],["entity_id","Entity ID"],["friendly_name","Friendly Name"],["state","Entity State"],["last_changed","Last Change"],["last_updated","Last Update"],["last_triggered","Last Trigger"]]},{type:"constant",name:"Sorting options:",value:""},{type:"grid",name:"",schema:[{name:"reverse",type:"boolean",label:"Reverse"},{name:"ignore_case",type:"boolean",label:"Ignore case"},{name:"numeric",type:"boolean",label:"Numeric sort"},{name:"ip",type:"boolean",label:"IP address short"}]}],Ft=[{type:"grid",name:"",schema:[{name:"show_empty",type:"boolean",label:"Show if empty"},{name:"card_param",type:"string",label:"Parameter to populate"}]}];class Lt extends tt{constructor(){super(...arguments),this._selectedTab=0,this._cardGUIMode=!0,this._cardGUIModeAvailable=!0}setConfig(t){this._config=t}connectedCallback(){super.connectedCallback(),(async()=>{var t,e;if(customElements.get("ha-form"))return;const i=await(null===(e=(t=window).loadCardHelpers)||void 0===e?void 0:e.call(t));if(!i)return;const n=await i.createCardElement({type:"entity"});n&&await n.getConfigElement()})()}_handleSwitchTab(t){this._selectedTab=parseInt(t.detail.index,10)}_addFilterGroup(){var t;if(!this._config)return;const e=[...null===(t=this._config.filter)||void 0===t?void 0:t.include];e.push({});const i=Object.assign(Object.assign({},this._config.filter),{include:e});this._config=Object.assign(Object.assign({},this._config),{filter:i}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_deleteFilterGroup(t){var e;if(!this._config)return;const i=[...null===(e=this._config.filter)||void 0===e?void 0:e.include];i.splice(t,1);const n=Object.assign(Object.assign({},this._config.filter),{include:i});this._config=Object.assign(Object.assign({},this._config),{filter:n}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_moveFilterGroup(t,e){var i;if(!this._config)return;const n=[...null===(i=this._config.filter)||void 0===i?void 0:i.include];[n[t],n[t+e]]=[n[t+e],n[t]];const s=Object.assign(Object.assign({},this._config.filter),{include:n});this._config=Object.assign(Object.assign({},this._config),{filter:s}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_addSpecialEntry(){var t;if(!this._config)return;const e=[...null===(t=this._config.filter)||void 0===t?void 0:t.include];e.push({type:""});const i=Object.assign(Object.assign({},this._config.filter),{include:e});this._config=Object.assign(Object.assign({},this._config),{filter:i}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}async _changeSpecialEntry(t,e){var i,n,s,o;if(!this._config)return;const r=null!==(n=Object.assign({},null===(i=e.detail.value)||void 0===i?void 0:i.data))&&void 0!==n?n:{type:""};r.type=null!==(s=r.type)&&void 0!==s?s:"";const a=[...null===(o=this._config.filter)||void 0===o?void 0:o.include];a[t]=r;const l=Object.assign(Object.assign({},this._config.filter),{include:a});this._config=Object.assign(Object.assign({},this._config),{filter:l}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}async _changeGroupOptions(t,e){var i;if(!this._config)return;const n=e.detail.value,s=[...null===(i=this._config.filter)||void 0===i?void 0:i.include];s[t]=Object.assign({},n);const o=Object.assign(Object.assign({},this._config.filter),{include:s});this._config=Object.assign(Object.assign({},this._config),{filter:o}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_changeFilter(t,e){var i;if(!this._config)return;const n=((t,e)=>{var i;const n={};for(let s=0;s<=t.filter.include.length+1;s++)void 0!==e[`key_${s}`]&&(n[e[`key_${s}`]]=null!==(i=e[`value_${s}`])&&void 0!==i?i:"");return void 0!==e.key_new&&(n[e.key_new]=""),n})(this._config,e.detail.value),s=[...null===(i=this._config.filter)||void 0===i?void 0:i.include];s[t]=Object.assign(Object.assign({},n),{options:s[t].options}),this._config.filter=Object.assign(Object.assign({},this._config.filter),{include:s}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_changeSortOptions(t){if(!this._config)return;const e=t.detail.value;this._config=Object.assign(Object.assign({},this._config),{sort:e}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_changeCardOptions(t){if(!this._config)return;const e=t.detail.value;this._config=Object.assign(Object.assign({},this._config),e),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_showEmptyToggle(){if(!this._config)return;const t=!1===this._config.show_empty;this._config=Object.assign(Object.assign({},this._config),{show_empty:t}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_changeCardParam(t){if(!this._config)return;const e=""===t.target.value||"entities"===t.target.value?void 0:t.target.value;this._config=Object.assign(Object.assign({},this._config),{card_param:e}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_getCardConfig(){const t=Object.assign({},this._config.card);return t[this._config.card_param||"entities"]=[],t}_handleCardConfigChanged(t){if(t.stopPropagation(),!this._config)return;const e=Object.assign({},t.detail.config);delete e[this._config.card_param||"entities"],this._config=Object.assign(Object.assign({},this._config),{card:e}),this._cardGUIModeAvailable=t.detail.guiModeAvailable,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_deleteCard(t){this._config&&(this._config=Object.assign({},this._config),delete this._config.card,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}})))}_toggleCardMode(t){var e;null===(e=this._cardEditorEl)||void 0===e||e.toggleMode()}_cardGUIModeChanged(t){t.stopPropagation(),this._cardGUIMode=t.detail.guiMode,this._cardGUIModeAvailable=t.detail.guiModeAvailable}render(){return this.hass&&this._config?N` +function t(t,e,i,n){var s,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,i,r):s(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),s=new WeakMap;let o=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)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(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}};const r=(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 o(i,t,n)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,n))(e)})(t):t;var l;const d=window,c=d.trustedTypes,h=c?c.emptyScript:"",u=d.reactiveElementPolyfillSupport,v={toAttribute(t,e){switch(e){case Boolean:t=t?h: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}},f=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:f};let g=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}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=p){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 s=this[t];this[e]=n,this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!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(a(t))}else void 0!==t&&e.push(a(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}u(){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 n=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{i?t.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((i=>{const n=document.createElement("style"),s=e.litNonce;void 0!==s&&n.setAttribute("nonce",s),n.textContent=i.cssText,t.appendChild(n)}))})(n,this.constructor.elementStyles),n}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=p){var n;const s=this.constructor._$Ep(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:v).toAttribute(e,i.type);this._$El=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,s=n._$Ev.get(t);if(void 0!==s&&this._$El!==s){const t=n.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:v;this._$El=s,this[s]=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||f)(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 _;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:g}),(null!==(l=d.reactiveElementVersions)&&void 0!==l?l:d.reactiveElementVersions=[]).push("1.5.0");const m=window,y=m.trustedTypes,b=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,$=`lit$${(Math.random()+"").slice(9)}$`,w="?"+$,E=`<${w}>`,A=document,C=(t="")=>A.createComment(t),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,k=/-->/g,x=/>/g,T=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),U=/'/g,P=/"/g,M=/^(?:script|style|textarea|title)$/i,N=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),I=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),H=new WeakMap,D=A.createTreeWalker(A,129,null,!1),F=(t,e)=>{const i=t.length-1,n=[];let s,o=2===e?"":"",r=j;for(let e=0;e"===l[0]?(r=null!=s?s:j,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?T:'"'===l[3]?P:U):r===P||r===U?r=T:r===k||r===x?r=j:(r=T,s=void 0);const h=r===T&&t[e+1].startsWith("/>")?" ":"";o+=r===j?i+E:d>=0?(n.push(a),i.slice(0,d)+"$lit$"+i.slice(d)+$+h):i+$+(-2===d?(n.push(void 0),e):h)}const a=o+(t[i]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==b?b.createHTML(a):a,n]};class L{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let s=0,o=0;const r=t.length-1,a=this.parts,[l,d]=F(t,e);if(this.el=L.createElement(l,i),D.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=D.nextNode())&&a.length0){n.textContent=y?y.emptyScript:"";for(let i=0;iO(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==R&&S(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,s="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=L.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.p(i);else{const t=new G(s,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=H.get(t.strings);return void 0===e&&H.set(t.strings,e=new L(t)),e}k(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const s of t)n===e.length?e.push(i=new z(this.O(C()),this.O(C()),this,this.options)):i=e[n],i._$AI(s),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const s=this.strings;let o=!1;if(void 0===s)t=W(this,t,e,0),o=!S(t)||t!==this._$AH&&t!==I,o&&(this._$AH=t);else{const n=t;let r,a;for(t=s[0],r=0;r{var n,s;const o=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let r=o._$litPart$;if(void 0===r){const t=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:null;o._$litPart$=r=new z(e.insertBefore(C(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(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 I}}tt.finalized=!0,tt._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:tt});const et=globalThis.litElementPolyfillSupport;null==et||et({LitElement:tt}),(null!==(X=globalThis.litElementVersions)&&void 0!==X?X:globalThis.litElementVersions=[]).push("3.2.2");const it=(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)}};function nt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):it(t,e)}function st(t){return nt({...t,state:!0})}var ot;function rt(){return document.querySelector("hc-main")?document.querySelector("hc-main").hass:document.querySelector("home-assistant")?document.querySelector("home-assistant").hass:void 0}null===(ot=window.HTMLSlotElement)||void 0===ot||ot.prototype.assignedElements;const at="lovelace-player-device-id";function lt(){if(!localStorage[at]){const t=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);window.fully&&"function"==typeof fully.getDeviceId?localStorage[at]=fully.getDeviceId():localStorage[at]=`${t()}${t()}-${t()}${t()}`}return localStorage[at]}let dt=lt();const ct=new URLSearchParams(window.location.search);var ht;function ut(t){return!!String(t).includes("{%")||(!!String(t).includes("{{")||void 0)}ct.get("deviceID")&&null!==(ht=ct.get("deviceID"))&&("clear"===ht?localStorage.removeItem(at):localStorage[at]=ht,dt=lt()),window.cardMod_template_cache=window.cardMod_template_cache||{};const vt=window.cardMod_template_cache;async function ft(t,e,i){const n=rt().connection,s=JSON.stringify([e,i]);let o=vt[s];o?(o.callbacks.has(t)||pt(t),t(o.value),o.callbacks.add(t)):(pt(t),t(""),i=Object.assign({user:rt().user.name,browser:dt,hash:location.hash.substr(1)||""},i),vt[s]=o={template:e,variables:i,value:"",callbacks:new Set([t]),unsubscribe:n.subscribeMessage((t=>function(t,e){const i=vt[t];i&&(i.value=e.result,i.callbacks.forEach((t=>t(e.result))))}(s,t)),{type:"render_template",template:e,variables:i})})}async function pt(t){let e;for(const[i,n]of Object.entries(vt))if(n.callbacks.has(t)){n.callbacks.delete(t),0==n.callbacks.size&&(e=n.unsubscribe,delete vt[i]);break}e&&await(await e)()}var gt;const _t=(t,e)=>{if(t===e)return!0;if(typeof t!=typeof e)return!1;if(!(t instanceof Object&&e instanceof Object))return!1;for(const i in t)if(t.hasOwnProperty(i)){if(!e.hasOwnProperty(i))return!1;if(t[i]!==e[i]){if("object"!=typeof t[i])return!1;if(!_t(t[i],e[i]))return!1}}for(const i in e)if(e.hasOwnProperty(i)&&!t.hasOwnProperty(i))return!1;return!0};window.autoEntities_cache=null!==(gt=window.autoEntities_cache)&&void 0!==gt?gt:{};const mt=window.autoEntities_cache;async function yt(t){var e;return mt.areas=null!==(e=mt.areas)&&void 0!==e?e:await t.callWS({type:"config/area_registry/list"}),mt.areas}function bt(){return mt.areas}async function $t(t){var e;return mt.devices=null!==(e=mt.devices)&&void 0!==e?e:await t.callWS({type:"config/device_registry/list"}),mt.devices}function wt(){return mt.devices}async function Et(t){var e;return mt.entities=null!==(e=mt.entities)&&void 0!==e?e:await t.callWS({type:"config/entity_registry/list"}),mt.entities}function At(){return mt.entities}const Ct=/([mhd])\s+ago\s*$/i,St="m ago";function Ot(t,e){if("string"==typeof t&&t.startsWith("$$")&&(t=t.substring(2),e=JSON.stringify(e)),"string"==typeof e&&"string"==typeof t&&(t.startsWith("/")&&t.endsWith("/")||-1!==t.indexOf("*"))){return t.startsWith("/")||(t=`/^${t=t.replace(/\./g,".").replace(/\*/g,".*")}$/`),new RegExp(t.slice(1,-1)).test(e)}if("string"==typeof t){const i=Ct.exec(t);if(i){t=t.replace(i[0],"");e=((new Date).getTime()-new Date(e).getTime())/6e4;const n=i[1];"h"===n?e/=60:"d"===n&&(e=e/60/24)}}if("string"==typeof t){if(t.startsWith("<="))return parseFloat(e)<=parseFloat(t.substring(2));if(t.startsWith(">="))return parseFloat(e)>=parseFloat(t.substring(2));if(t.startsWith("<"))return parseFloat(e)"))return parseFloat(e)>parseFloat(t.substring(1));if(t.startsWith("!"))return parseFloat(e)!=parseFloat(t.substring(1));if(t.startsWith("="))return parseFloat(e)==parseFloat(t.substring(1))}return t===e}const jt={options:async()=>!0,sort:async()=>!0,domain:async(t,e,i)=>Ot(e,i.entity_id.split(".")[0]),entity_id:async(t,e,i)=>Ot(e,i.entity_id),state:async(t,e,i)=>Ot(e,i.state),name:async(t,e,i)=>{var n;return Ot(e,null===(n=i.attributes)||void 0===n?void 0:n.friendly_name)},group:async(t,e,i)=>{var n,s,o;return null===(o=null===(s=null===(n=t.states[e])||void 0===n?void 0:n.attributes)||void 0===s?void 0:s.entity_id)||void 0===o?void 0:o.includes(i.entity_id)},attributes:async(t,e,i)=>{for(const[t,n]of Object.entries(e)){let e=t.split(" ")[0],s=i.attributes;for(const t of e.split(":"))s=s?s[t]:void 0;if(void 0===s||!Ot(n,s))return!1}return!0},not:async(t,e,i)=>!await kt(t,e,i.entity_id),and:async(t,e,i)=>{for(const n of e)if(!await kt(t,n,i.entity_id))return!1;return!0},or:async(t,e,i)=>{for(const n of e)if(await kt(t,n,i.entity_id))return!0;return!1},device:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));if(!n)return!1;const s=(await $t(t)).find((t=>t.id===n.device_id));return!!s&&(Ot(e,s.name_by_user)||Ot(e,s.name))},device_manufacturer:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));if(!n)return!1;const s=(await $t(t)).find((t=>t.id===n.device_id));return!!s&&Ot(e,s.manufacturer)},device_model:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));if(!n)return!1;const s=(await $t(t)).find((t=>t.id===n.device_id));return!!s&&Ot(e,s.model)},area:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));if(!n)return!1;let s=(await yt(t)).find((t=>t.area_id===n.area_id));if(s)return Ot(e,s.name)||Ot(e,s.area_id);const o=(await $t(t)).find((t=>t.id===n.device_id));return!!o&&(s=(await yt(t)).find((t=>t.area_id===o.area_id)),!!s&&(Ot(e,s.name)||Ot(e,s.area_id)))},entity_category:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));return!!n&&Ot(e,n.entity_category)},last_changed:async(t,e,i)=>(Ct.test(e)||(e+=St),Ot(e,i.last_changed)),last_updated:async(t,e,i)=>(Ct.test(e)||(e+=St),Ot(e,i.last_updated)),last_triggered:async(t,e,i)=>null!=i.attributes.last_triggered&&(Ct.test(e)||(e+=St),Ot(e,i.attributes.last_triggered)),integration:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));return!!n&&Ot(e,n.platform)},hidden_by:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id));return!!n&&Ot(e,n.hidden_by)},label:async(t,e,i)=>{const n=(await Et(t)).find((t=>t.entity_id===i.entity_id)),s=await async function(t){var e;return mt.labels=null!==(e=mt.labels)&&void 0!==e?e:await t.callWS({type:"config/label_registry/list"}),mt.labels}(t),o=(t,e)=>{if(Ot(t,e))return!0;const i=s.find((t=>t.label_id===e));if(!i)return!1;return Ot(t,i.name)};if(!n)return!1;if(!n.labels)return!1;const r=n.labels.some((t=>o(e,t)));if(r)return r;const a=(await $t(t)).find((t=>t.id===n.device_id));if(!a)return!1;return a.labels.some((t=>o(e,t)))}};async function kt(t,e,i){var n;if(!t.states[i])return!1;for(let[s,o]of Object.entries(e))if(s=s.trim().split(" ")[0].trim(),!await(null===(n=jt[s])||void 0===n?void 0:n.call(jt,t,o,t.states[i])))return!1;return!0}function xt(t,e,i){var n,s,o,r;const[a,l]=i.reverse?[-1,1]:[1,-1];return i.ignore_case&&(t=null!==(s=null===(n=null==t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t))&&void 0!==s?s:t,e=null!==(r=null===(o=null==e?void 0:e.toLowerCase)||void 0===o?void 0:o.call(e))&&void 0!==r?r:e),i.numeric&&(isNaN(parseFloat(t))&&isNaN(parseFloat(e))||(t=isNaN(parseFloat(t))?void 0:parseFloat(t),e=isNaN(parseFloat(e))?void 0:parseFloat(e))),void 0===t&&void 0===e?0:void 0===t?a:void 0===e?l:i.numeric?t===e?0:(i.reverse?-1:1)*(t0,domain:(t,e,i)=>{var n,s;return xt(null===(n=null==t?void 0:t.entity_id)||void 0===n?void 0:n.split(".")[0],null===(s=null==e?void 0:e.entity_id)||void 0===s?void 0:s.split(".")[0],i)},entity_id:(t,e,i)=>xt(null==t?void 0:t.entity_id,null==e?void 0:e.entity_id,i),friendly_name:(t,e,i)=>{var n,s,o,r;return xt((null===(n=null==t?void 0:t.attributes)||void 0===n?void 0:n.friendly_name)||(null===(s=null==t?void 0:t.entity_id)||void 0===s?void 0:s.split(".")[1]),(null===(o=null==e?void 0:e.attributes)||void 0===o?void 0:o.friendly_name)||(null===(r=null==e?void 0:e.entity_id)||void 0===r?void 0:r.split(".")[1]),i)},name:(t,e,i)=>{var n,s,o,r;return xt((null===(n=null==t?void 0:t.attributes)||void 0===n?void 0:n.friendly_name)||(null===(s=null==t?void 0:t.entity_id)||void 0===s?void 0:s.split(".")[1]),(null===(o=null==e?void 0:e.attributes)||void 0===o?void 0:o.friendly_name)||(null===(r=null==e?void 0:e.entity_id)||void 0===r?void 0:r.split(".")[1]),i)},device:(t,e,i)=>{var n,s;const o=At().find((e=>e.entity_id===t.entity_id)),r=At().find((t=>t.entity_id===e.entity_id));if(!o||!r)return 0;const a=wt().find((t=>t.id===o.device_id)),l=wt().find((t=>t.id===r.device_id));return a&&l?xt(null!==(n=a.name_by_user)&&void 0!==n?n:a.name,null!==(s=l.name_by_user)&&void 0!==s?s:l.name,i):0},area:(t,e,i)=>{const n=At().find((e=>e.entity_id===t.entity_id)),s=At().find((t=>t.entity_id===e.entity_id));if(!n||!s)return 0;const o=wt().find((t=>t.id===n.device_id)),r=wt().find((t=>t.id===s.device_id));if(!o||!r)return 0;const a=bt().find((t=>t.area_id===o.area_id)),l=bt().find((t=>t.area_id===r.area_id));return a&&l?xt(a.name,l.name,i):0},state:(t,e,i)=>xt(null==t?void 0:t.state,null==e?void 0:e.state,i),attribute:(t,e,i)=>{var n;const[s,o]=(null==i?void 0:i.reverse)?[-1,1]:[1,-1];let r=null==t?void 0:t.attributes,a=null==e?void 0:e.attributes;for(const t of null===(n=null==i?void 0:i.attribute)||void 0===n?void 0:n.split(":")){if(void 0===r&&void 0===a)return 0;if(void 0===r)return s;if(void 0===a)return o;[r,a]=[r[t],a[t]]}return xt(r,a,i)},last_changed:(t,e,i)=>{const[n,s]=(null==i?void 0:i.reverse)?[-1,1]:[1,-1];return null==(null==t?void 0:t.last_changed)&&null==(null==e?void 0:e.last_changed)?0:null==(null==t?void 0:t.last_changed)?n:null==(null==e?void 0:e.last_changed)?s:(i.numeric=!0,xt(new Date(null==t?void 0:t.last_changed).getTime(),new Date(null==e?void 0:e.last_changed).getTime(),i))},last_updated:(t,e,i)=>{const[n,s]=(null==i?void 0:i.reverse)?[-1,1]:[1,-1];return null==(null==t?void 0:t.last_updated)&&null==(null==e?void 0:e.last_updated)?0:null==(null==t?void 0:t.last_updated)?n:null==(null==e?void 0:e.last_updated)?s:(i.numeric=!0,xt(new Date(null==t?void 0:t.last_updated).getTime(),new Date(null==e?void 0:e.last_updated).getTime(),i))},last_triggered:(t,e,i)=>{var n,s,o,r,a,l;const[d,c]=(null==i?void 0:i.reverse)?[-1,1]:[1,-1];return null==(null===(n=null==t?void 0:t.attributes)||void 0===n?void 0:n.last_triggered)&&null==(null===(s=null==e?void 0:e.attributes)||void 0===s?void 0:s.last_triggered)?0:null==(null===(o=null==t?void 0:t.attributes)||void 0===o?void 0:o.last_triggered)?d:null==(null===(r=null==e?void 0:e.attributes)||void 0===r?void 0:r.last_triggered)?c:(i.numeric=!0,xt(new Date(null===(a=null==t?void 0:t.attributes)||void 0===a?void 0:a.last_triggered).getTime(),new Date(null===(l=null==e?void 0:e.attributes)||void 0===l?void 0:l.last_triggered).getTime(),i))}};function Ut(t,e){return function(i,n){var s,o;return null!==(o=null===(s=Tt[e.method])||void 0===s?void 0:s.call(Tt,t.states[i.entity],t.states[n.entity],e))&&void 0!==o?o:0}}var Pt="1.13.0";const Mt=["none","domain","entity_id","state","name","group","area","device","device_manufacturer","device_model","attributes","last_changed","last_updated","last_triggered","entity_category","integration","hidden_by","label"],Nt={type:"select",options:[["domain","Entity Domain"],["entity_id","Entity ID"],["state","Entity State"],["name","Friendly Name"],["group","Member of Group"],["area","In area"],["device","Device"],["label","Label"],["device_manufacturer","Device Manufacturer"],["device_model","Device Model"],["attributes","Attribute"],["last_changed","Last Change"],["last_updated","Last Update"],["last_triggered","Last Trigger"],["entity_category","Entity Category"],["integration","Governing integration"],["hidden_by","Hidden by"]]},It=([t,e],i)=>{var n;return Mt.includes(t)?{type:"grid",name:"",schema:[Object.assign(Object.assign({},Nt),{name:`key_${i}`,label:"Property"}),{name:`value_${i}`,selector:null!==(n={attributes:{object:{}}}[t])&&void 0!==n?n:{text:{}},label:"Value"}]}:{type:"Constant",name:"Some filters are not shown",value:"Please switch to the CODE EDITOR to access all options."}},Rt=[{name:"options",selector:{object:{}}}],Ht=[{name:"data",selector:{object:{}}}],Dt=[{name:"method",label:"Sort method",type:"select",options:[["domain","Entity Domain"],["entity_id","Entity ID"],["friendly_name","Friendly Name"],["state","Entity State"],["last_changed","Last Change"],["last_updated","Last Update"],["last_triggered","Last Trigger"]]},{type:"constant",name:"Sorting options:",value:""},{type:"grid",name:"",schema:[{name:"reverse",type:"boolean",label:"Reverse"},{name:"ignore_case",type:"boolean",label:"Ignore case"},{name:"numeric",type:"boolean",label:"Numeric sort"},{name:"ip",type:"boolean",label:"IP address short"}]}],Ft=[{type:"grid",name:"",schema:[{name:"show_empty",type:"boolean",label:"Show if empty"},{name:"card_param",type:"string",label:"Parameter to populate"}]}];class Lt extends tt{constructor(){super(...arguments),this._selectedTab=0,this._cardGUIMode=!0,this._cardGUIModeAvailable=!0}setConfig(t){this._config=t}connectedCallback(){super.connectedCallback(),(async()=>{var t,e;if(customElements.get("ha-form"))return;const i=await(null===(e=(t=window).loadCardHelpers)||void 0===e?void 0:e.call(t));if(!i)return;const n=await i.createCardElement({type:"entity"});n&&await n.getConfigElement()})()}_handleSwitchTab(t){this._selectedTab=parseInt(t.detail.index,10)}_addFilterGroup(){var t;if(!this._config)return;const e=[...null===(t=this._config.filter)||void 0===t?void 0:t.include];e.push({});const i=Object.assign(Object.assign({},this._config.filter),{include:e});this._config=Object.assign(Object.assign({},this._config),{filter:i}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_deleteFilterGroup(t){var e;if(!this._config)return;const i=[...null===(e=this._config.filter)||void 0===e?void 0:e.include];i.splice(t,1);const n=Object.assign(Object.assign({},this._config.filter),{include:i});this._config=Object.assign(Object.assign({},this._config),{filter:n}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_moveFilterGroup(t,e){var i;if(!this._config)return;const n=[...null===(i=this._config.filter)||void 0===i?void 0:i.include];[n[t],n[t+e]]=[n[t+e],n[t]];const s=Object.assign(Object.assign({},this._config.filter),{include:n});this._config=Object.assign(Object.assign({},this._config),{filter:s}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_addSpecialEntry(){var t;if(!this._config)return;const e=[...null===(t=this._config.filter)||void 0===t?void 0:t.include];e.push({type:""});const i=Object.assign(Object.assign({},this._config.filter),{include:e});this._config=Object.assign(Object.assign({},this._config),{filter:i}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}async _changeSpecialEntry(t,e){var i,n,s,o;if(!this._config)return;const r=null!==(n=Object.assign({},null===(i=e.detail.value)||void 0===i?void 0:i.data))&&void 0!==n?n:{type:""};r.type=null!==(s=r.type)&&void 0!==s?s:"";const a=[...null===(o=this._config.filter)||void 0===o?void 0:o.include];a[t]=r;const l=Object.assign(Object.assign({},this._config.filter),{include:a});this._config=Object.assign(Object.assign({},this._config),{filter:l}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}async _changeGroupOptions(t,e){var i;if(!this._config)return;const n=e.detail.value,s=[...null===(i=this._config.filter)||void 0===i?void 0:i.include];s[t]=Object.assign({},n);const o=Object.assign(Object.assign({},this._config.filter),{include:s});this._config=Object.assign(Object.assign({},this._config),{filter:o}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_changeFilter(t,e){var i;if(!this._config)return;const n=((t,e)=>{var i;const n={};for(let s=0;s<=t.filter.include.length+1;s++)void 0!==e[`key_${s}`]&&(n[e[`key_${s}`]]=null!==(i=e[`value_${s}`])&&void 0!==i?i:"");return void 0!==e.key_new&&(n[e.key_new]=""),n})(this._config,e.detail.value),s=[...null===(i=this._config.filter)||void 0===i?void 0:i.include];s[t]=Object.assign(Object.assign({},n),{options:s[t].options}),this._config.filter=Object.assign(Object.assign({},this._config.filter),{include:s}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_changeSortOptions(t){if(!this._config)return;const e=t.detail.value;this._config=Object.assign(Object.assign({},this._config),{sort:e}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_changeCardOptions(t){if(!this._config)return;const e=t.detail.value;this._config=Object.assign(Object.assign({},this._config),e),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_showEmptyToggle(){if(!this._config)return;const t=!1===this._config.show_empty;this._config=Object.assign(Object.assign({},this._config),{show_empty:t}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_changeCardParam(t){if(!this._config)return;const e=""===t.target.value||"entities"===t.target.value?void 0:t.target.value;this._config=Object.assign(Object.assign({},this._config),{card_param:e}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_getCardConfig(){const t=Object.assign({},this._config.card);return t[this._config.card_param||"entities"]=[],t}_handleCardConfigChanged(t){if(t.stopPropagation(),!this._config)return;const e=Object.assign({},t.detail.config);delete e[this._config.card_param||"entities"],this._config=Object.assign(Object.assign({},this._config),{card:e}),this._cardGUIModeAvailable=t.detail.guiModeAvailable,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_deleteCard(t){this._config&&(this._config=Object.assign({},this._config),delete this._config.card,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}})))}_toggleCardMode(t){var e;null===(e=this._cardEditorEl)||void 0===e||e.toggleMode()}_cardGUIModeChanged(t){t.stopPropagation(),this._cardGUIMode=t.detail.guiMode,this._cardGUIModeAvailable=t.detail.guiModeAvailable}render(){return this.hass&&this._config?N`
(i,n)=>{var s;if(void 0===n){const n=null!==(s=i.originalKey)&&void 0!==s?s: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 s=i.constructor;void 0!==e&&Object.defineProperty(i,n,e(n)),null==t||t(s,n)}})({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}})}("hui-card-element-editor")],Lt.prototype,"_cardEditorEl",void 0),customElements.define("auto-entities-editor",Lt),window.customCards=window.customCards||[],window.customCards.push({type:"auto-entities",name:"Auto Entities",preview:!1,description:"Entity Filter on Steroids. Auto Entities allows you to fill other cards with entities automatically, based on a number of attributes."}),window.queueMicrotask=window.queueMicrotask||(t=>window.setTimeout(t,1));const Gt=["section","divider"];class Wt extends tt{constructor(){super(...arguments),this.empty=!1,this._updateCooldown={timer:void 0,rerun:!1},this._renderer=t=>{this._template="string"==typeof t?t.split(/[\s,]+/):t}}static getConfigElement(){return document.createElement("auto-entities-editor")}static getStubConfig(){return{card:{type:"entities"},filter:{include:[],exclude:[]}}}setConfig(t){var e,i;if(!t)throw new Error("No configuration.");if(!(null===(e=t.card)||void 0===e?void 0:e.type))throw new Error("No card type specified.");if(!t.filter&&!t.entities)throw new Error("No filters specified.");t=JSON.parse(JSON.stringify(t)),this._config=t,(null===(i=this._config.filter)||void 0===i?void 0:i.template)&&ut(this._config.filter.template)&&ft(this._renderer,this._config.filter.template,{config:t}),this._cardBuilt=new Promise((t=>this._cardBuiltResolve=t)),queueMicrotask((()=>this.build_else())),queueMicrotask((()=>this.update_all()))}connectedCallback(){var t,e;super.connectedCallback(),(null===(e=null===(t=this._config)||void 0===t?void 0:t.filter)||void 0===e?void 0:e.template)&&ut(this._config.filter.template)&&ft(this._renderer,this._config.filter.template,{config:this._config})}disconnectedCallback(){super.disconnectedCallback(),pt(this._renderer)}async update_all(){if(this.card&&(this.card.hass=this.hass),this.else&&(this.else.hass=this.hass),this._updateCooldown.timer)return void(this._updateCooldown.rerun=!0);this._updateCooldown.rerun=!1,this._updateCooldown.timer=window.setTimeout((()=>{this._updateCooldown.timer=void 0,this._updateCooldown.rerun&&this.update_all()}),500);const t=await this.update_entities();this.update_card(t)}async build_else(){if(void 0===this._config.else)return;const t=await window.loadCardHelpers();this.else=await t.createCardElement(this._config.else),this.else.hass=this.hass}async update_card(t){var e,i,n,s,o,r,a,l,d,c,h,u;if(this._entities&&_t(t,this._entities)&&_t(this._cardConfig,this._config.card))return;const v=(null===(e=this._cardConfig)||void 0===e?void 0:e.type)!==this._config.card.type;this._entities=t,this._cardConfig=JSON.parse(JSON.stringify(this._config.card));const f=Object.assign({[this._config.card_param||"entities"]:t},this._config.card);if(!this.card||v){const t=await window.loadCardHelpers();console.oldError=console.oldError||[];const e=console.error;console.oldError.push(e),console.error=(...t)=>{var i,n,s,o,r,a;3===t.length&&t[2].message&&((null===(n=(i=t[2].message).startsWith)||void 0===n?void 0:n.call(i,"Entities"))||(null===(o=(s=t[2].message).startsWith)||void 0===o?void 0:o.call(s,"Either entities"))||(null===(a=(r=t[2].message).endsWith)||void 0===a?void 0:a.call(r,"entity")))||e(...t)};try{if(this.card=await t.createCardElement(f),"hui-error-card"===this.card.localName){const t=this.card;await customElements.whenDefined("hui-error-card");let e=10;for(;!t._config&&e;)await new Promise((t=>window.setTimeout(t,100))),e--;if((null===(s=null===(n=null===(i=t._config)||void 0===i?void 0:i.error)||void 0===n?void 0:n.startsWith)||void 0===s?void 0:s.call(n,"Entities"))||(null===(a=null===(r=null===(o=t._config)||void 0===o?void 0:o.error)||void 0===r?void 0:r.startsWith)||void 0===a?void 0:a.call(r,"Either entities"))||(null===(c=null===(d=null===(l=t._config)||void 0===l?void 0:l.error)||void 0===d?void 0:d.endsWith)||void 0===c?void 0:c.call(d,"entity")))return this.card=void 0,this._entities=void 0,this._cardConfig=void 0,void(null===(h=this._cardBuiltResolve)||void 0===h||h.call(this))}}finally{console.error=console.oldError.pop()}}else this.card.setConfig(f);null===(u=this._cardBuiltResolve)||void 0===u||u.call(this),this.card.hass=this.hass,this.empty=0===t.length||t.every((t=>Gt.includes(t.type)));const p=this.empty&&!1===this._config.show_empty&&void 0===this._config.else;this.style.display=p?"none":null,this.style.margin=p?"0":null,this.card.requestUpdate&&(await this.updateComplete,this.card.requestUpdate())}async update_entities(){var t,e,i,n,s,o,r,a;const l=t=>t?"string"==typeof t?{entity:t.trim()}:t:null;let d=[...(null===(e=null===(t=this._config)||void 0===t?void 0:t.entities)||void 0===e?void 0:e.map(l))||[]];if(!this.hass)return d;if(this._template&&(d=d.concat(this._template.map(l))),d=d.filter(Boolean),null===(i=this._config.filter)||void 0===i?void 0:i.include){const t=Object.keys(this.hass.states).map(l);for(const e of this._config.filter.include){if(e.type){d.push(e);continue}let i=[];for(const n of t)await kt(this.hass,e,n.entity)&&i.push(JSON.parse(JSON.stringify(Object.assign(Object.assign({},n),e.options)).replace(/this.entity_id/g,n.entity)));if(e.sort&&(await Et(this.hass),await $t(this.hass),await yt(this.hass),i=i.sort(Ut(this.hass,e.sort)),null!==(n=e.sort.count)&&void 0!==n?n:e.sort.first)){const t=null!==(s=e.sort.first)&&void 0!==s?s:0;i=i.slice(t,t+(null!==(o=e.sort.count)&&void 0!==o?o:1/0))}d=d.concat(i)}}if(null===(r=this._config.filter)||void 0===r?void 0:r.exclude)for(const t of this._config.filter.exclude){const e=[];for(const i of d)void 0!==i.entity&&await kt(this.hass,t,i.entity)||e.push(i);d=e}if(this._config.sort&&(d=d.sort(Ut(this.hass,this._config.sort)),this._config.sort.count)){const t=null!==(a=this._config.sort.first)&&void 0!==a?a:0;d=d.slice(t,t+this._config.sort.count)}if(this._config.unique){let t=[];for(const e of d)"entity"===this._config.unique&&e.entity&&t.some((t=>t.entity===e.entity))||t.some((t=>_t(t,e)))||t.push(e);d=t}return d}async updated(t){(t.has("_template")||t.has("hass")&&this.hass)&&queueMicrotask((()=>this.update_all()))}createRenderRoot(){return this}render(){return N`${this.empty&&(!1===this._config.show_empty||this._config.else)?this.else:this.card}`}async getCardSize(){var t,e;let i=0;return await this._cardBuilt,this.card&&this.card.getCardSize&&(i=await this.card.getCardSize()),1===i&&(null===(t=this._entities)||void 0===t?void 0:t.length)&&(i=this._entities.length),0===i&&(null===(e=this._config.filter)||void 0===e?void 0:e.include)&&(i=Object.keys(this._config.filter.include).length),i||5}}t([nt()],Wt.prototype,"_config",void 0),t([nt()],Wt.prototype,"hass",void 0),t([nt()],Wt.prototype,"card",void 0),t([nt()],Wt.prototype,"else",void 0),t([nt()],Wt.prototype,"_template",void 0),t([st()],Wt.prototype,"empty",void 0),customElements.get("auto-entities")||(customElements.define("auto-entities",Wt),console.groupCollapsed(`%cAUTO-ENTITIES ${Pt} IS INSTALLED`,"color: green; font-weight: bold"),console.log("Readme:","https://github.com/thomasloven/lovelace-auto-entities"),console.groupEnd()); + `]}}t([st()],Lt.prototype,"_config",void 0),t([nt()],Lt.prototype,"lovelace",void 0),t([nt()],Lt.prototype,"hass",void 0),t([st()],Lt.prototype,"_selectedTab",void 0),t([st()],Lt.prototype,"_cardGUIMode",void 0),t([st()],Lt.prototype,"_cardGUIModeAvailable",void 0),t([function(t,e){return(({finisher:t,descriptor:e})=>(i,n)=>{var s;if(void 0===n){const n=null!==(s=i.originalKey)&&void 0!==s?s: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 s=i.constructor;void 0!==e&&Object.defineProperty(i,n,e(n)),null==t||t(s,n)}})({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}})}("hui-card-element-editor")],Lt.prototype,"_cardEditorEl",void 0),customElements.define("auto-entities-editor",Lt),window.customCards=window.customCards||[],window.customCards.push({type:"auto-entities",name:"Auto Entities",preview:!1,description:"Entity Filter on Steroids. Auto Entities allows you to fill other cards with entities automatically, based on a number of attributes."}),window.queueMicrotask=window.queueMicrotask||(t=>window.setTimeout(t,1));const Wt=["section","divider"];class Gt extends tt{constructor(){super(...arguments),this.empty=!1,this._updateCooldown={timer:void 0,rerun:!1},this._renderer=t=>{this._template="string"==typeof t?t.split(/[\s,]+/):t}}static getConfigElement(){return document.createElement("auto-entities-editor")}static getStubConfig(){return{card:{type:"entities"},filter:{include:[],exclude:[]}}}setConfig(t){var e,i;if(!t)throw new Error("No configuration.");if(!(null===(e=t.card)||void 0===e?void 0:e.type))throw new Error("No card type specified.");if(!t.filter&&!t.entities)throw new Error("No filters specified.");t=JSON.parse(JSON.stringify(t)),this._config=t,(null===(i=this._config.filter)||void 0===i?void 0:i.template)&&ut(this._config.filter.template)&&ft(this._renderer,this._config.filter.template,{config:t}),this._cardBuilt=new Promise((t=>this._cardBuiltResolve=t)),queueMicrotask((()=>this.build_else())),queueMicrotask((()=>this.update_all()))}connectedCallback(){var t,e;super.connectedCallback(),(null===(e=null===(t=this._config)||void 0===t?void 0:t.filter)||void 0===e?void 0:e.template)&&ut(this._config.filter.template)&&ft(this._renderer,this._config.filter.template,{config:this._config})}disconnectedCallback(){super.disconnectedCallback(),pt(this._renderer)}async update_all(){if(this.card&&(this.card.hass=this.hass),this.else&&(this.else.hass=this.hass),this._updateCooldown.timer)return void(this._updateCooldown.rerun=!0);this._updateCooldown.rerun=!1,this._updateCooldown.timer=window.setTimeout((()=>{this._updateCooldown.timer=void 0,this._updateCooldown.rerun&&this.update_all()}),500);const t=await this.update_entities();this.update_card(t)}async build_else(){if(void 0===this._config.else)return;const t=await window.loadCardHelpers();this.else=await t.createCardElement(this._config.else),this.else.hass=this.hass}async update_card(t){var e,i,n,s,o,r,a,l,d,c,h,u;if(this._entities&&_t(t,this._entities)&&_t(this._cardConfig,this._config.card))return;const v=(null===(e=this._cardConfig)||void 0===e?void 0:e.type)!==this._config.card.type;this._entities=t,this._cardConfig=JSON.parse(JSON.stringify(this._config.card));const f=Object.assign({[this._config.card_param||"entities"]:t},this._config.card);if(!this.card||v){const t=await window.loadCardHelpers();console.oldError=console.oldError||[];const e=console.error;console.oldError.push(e),console.error=(...t)=>{var i,n,s,o,r,a;3===t.length&&t[2].message&&((null===(n=(i=t[2].message).startsWith)||void 0===n?void 0:n.call(i,"Entities"))||(null===(o=(s=t[2].message).startsWith)||void 0===o?void 0:o.call(s,"Either entities"))||(null===(a=(r=t[2].message).endsWith)||void 0===a?void 0:a.call(r,"entity")))||e(...t)};try{if(this.card=await t.createCardElement(f),"hui-error-card"===this.card.localName){const t=this.card;await customElements.whenDefined("hui-error-card");let e=10;for(;!t._config&&e;)await new Promise((t=>window.setTimeout(t,100))),e--;if((null===(s=null===(n=null===(i=t._config)||void 0===i?void 0:i.error)||void 0===n?void 0:n.startsWith)||void 0===s?void 0:s.call(n,"Entities"))||(null===(a=null===(r=null===(o=t._config)||void 0===o?void 0:o.error)||void 0===r?void 0:r.startsWith)||void 0===a?void 0:a.call(r,"Either entities"))||(null===(c=null===(d=null===(l=t._config)||void 0===l?void 0:l.error)||void 0===d?void 0:d.endsWith)||void 0===c?void 0:c.call(d,"entity")))return this.card=void 0,this._entities=void 0,this._cardConfig=void 0,void(null===(h=this._cardBuiltResolve)||void 0===h||h.call(this))}}finally{console.error=console.oldError.pop()}}else this.card.setConfig(f);null===(u=this._cardBuiltResolve)||void 0===u||u.call(this),this.card.hass=this.hass,this.empty=0===t.length||t.every((t=>Wt.includes(t.type)));const p=this.empty&&!1===this._config.show_empty&&void 0===this._config.else;this.style.display=p?"none":null,this.style.margin=p?"0":null,this.card.requestUpdate&&(await this.updateComplete,this.card.requestUpdate())}async update_entities(){var t,e,i,n,s,o,r,a;const l=t=>t?"string"==typeof t?{entity:t.trim()}:t:null;let d=[...(null===(e=null===(t=this._config)||void 0===t?void 0:t.entities)||void 0===e?void 0:e.map(l))||[]];if(!this.hass)return d;if(this._template&&(d=d.concat(this._template.map(l))),d=d.filter(Boolean),null===(i=this._config.filter)||void 0===i?void 0:i.include){const t=Object.keys(this.hass.states).map(l);for(const e of this._config.filter.include){if(e.type){d.push(e);continue}let i=[];for(const n of t)await kt(this.hass,e,n.entity)&&i.push(JSON.parse(JSON.stringify(Object.assign(Object.assign({},n),e.options)).replace(/this.entity_id/g,n.entity)));if(e.sort&&(await Et(this.hass),await $t(this.hass),await yt(this.hass),i=i.sort(Ut(this.hass,e.sort)),null!==(n=e.sort.count)&&void 0!==n?n:e.sort.first)){const t=null!==(s=e.sort.first)&&void 0!==s?s:0;i=i.slice(t,t+(null!==(o=e.sort.count)&&void 0!==o?o:1/0))}d=d.concat(i)}}if(null===(r=this._config.filter)||void 0===r?void 0:r.exclude)for(const t of this._config.filter.exclude){const e=[];for(const i of d)void 0!==i.entity&&await kt(this.hass,t,i.entity)||e.push(i);d=e}if(this._config.sort&&(d=d.sort(Ut(this.hass,this._config.sort)),this._config.sort.count)){const t=null!==(a=this._config.sort.first)&&void 0!==a?a:0;d=d.slice(t,t+this._config.sort.count)}if(this._config.unique){let t=[];for(const e of d)"entity"===this._config.unique&&e.entity&&t.some((t=>t.entity===e.entity))||t.some((t=>_t(t,e)))||t.push(e);d=t}return d}async updated(t){(t.has("_template")||t.has("hass")&&this.hass)&&queueMicrotask((()=>this.update_all()))}createRenderRoot(){return this}render(){return N`${this.empty&&(!1===this._config.show_empty||this._config.else)?this.else:this.card}`}async getCardSize(){var t,e;let i=0;return await this._cardBuilt,this.card&&this.card.getCardSize&&(i=await this.card.getCardSize()),1===i&&(null===(t=this._entities)||void 0===t?void 0:t.length)&&(i=this._entities.length),0===i&&(null===(e=this._config.filter)||void 0===e?void 0:e.include)&&(i=Object.keys(this._config.filter.include).length),i||5}}t([nt()],Gt.prototype,"_config",void 0),t([nt()],Gt.prototype,"hass",void 0),t([nt()],Gt.prototype,"card",void 0),t([nt()],Gt.prototype,"else",void 0),t([nt()],Gt.prototype,"_template",void 0),t([st()],Gt.prototype,"empty",void 0),customElements.get("auto-entities")||(customElements.define("auto-entities",Gt),console.groupCollapsed(`%cAUTO-ENTITIES ${Pt} IS INSTALLED`,"color: green; font-weight: bold"),console.log("Readme:","https://github.com/thomasloven/lovelace-auto-entities"),console.groupEnd()); diff --git a/custom_components/ui_lovelace_minimalist/cards/lovelace-card-mod/lovelace-card-mod.js b/custom_components/ui_lovelace_minimalist/cards/lovelace-card-mod/lovelace-card-mod.js index bbf7d76ab..d46e2b89c 100644 --- a/custom_components/ui_lovelace_minimalist/cards/lovelace-card-mod/lovelace-card-mod.js +++ b/custom_components/ui_lovelace_minimalist/cards/lovelace-card-mod/lovelace-card-mod.js @@ -1,5 +1 @@ -function t(t,e,o,s){var i,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,o,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(n<3?i(r):n>3?i(e,o,r):i(e,o))||r);return n>3&&r&&Object.defineProperty(e,o,r),r}const e=window,o=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;const n=t=>new class{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)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(o&&void 0===t){const o=void 0!==e&&1===e.length;o&&(t=i.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&i.set(e,t))}return t}toString(){return this.cssText}}("string"==typeof t?t:t+"",void 0,s),r=o?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const o of t.cssRules)e+=o.cssText;return n(e)})(t):t;var a;const d=window,l=d.trustedTypes,c=l?l.emptyScript:"",h=d.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=null!==t;break;case Number:o=null===t?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(t){o=null}}return o}},p=(t,e)=>e!==t&&(e==e||t==t),m={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:p};let f=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}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,o)=>{const s=this._$Ep(o,e);void 0!==s&&(this._$Ev.set(s,o),t.push(s))})),t}static createProperty(t,e=m){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const o="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,o,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,o){return{get(){return this[e]},set(s){const i=this[t];this[e]=s,this.requestUpdate(t,i,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||m}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!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 o of e)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const o=new Set(t.flat(1/0).reverse());for(const t of o)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const o=e.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof t?t.toLowerCase():void 0}u(){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,o;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(o=t.hostConnected)||void 0===o||o.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 s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,s)=>{o?t.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((o=>{const s=document.createElement("style"),i=e.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=o.cssText,t.appendChild(s)}))})(s,this.constructor.elementStyles),s}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,o){this._$AK(t,o)}_$EO(t,e,o=m){var s;const i=this.constructor._$Ep(t,o);if(void 0!==i&&!0===o.reflect){const n=(void 0!==(null===(s=o.converter)||void 0===s?void 0:s.toAttribute)?o.converter:u).toAttribute(e,o.type);this._$El=t,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$El=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=s.getPropertyOptions(i),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(o=t.converter)||void 0===o?void 0:o.fromAttribute)?t.converter:u;this._$El=i,this[i]=n.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,o){let s=!0;void 0!==t&&(((o=o||this.constructor.getPropertyOptions(t)).hasChanged||p)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===o.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,o))):s=!1),!this.isUpdatePending&&s&&(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 o=this._$AL;try{e=this.shouldUpdate(o),e?(this.willUpdate(o),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(o)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(o)}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 v;f.finalized=!0,f.elementProperties=new Map,f.elementStyles=[],f.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:f}),(null!==(a=d.reactiveElementVersions)&&void 0!==a?a:d.reactiveElementVersions=[]).push("1.4.2");const _=window,y=_.trustedTypes,g=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,$=`lit$${(Math.random()+"").slice(9)}$`,w="?"+$,E=`<${w}>`,b=document,A=(t="")=>b.createComment(t),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,O=/>/g,T=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),U=/'/g,M=/"/g,x=/^(?:script|style|textarea|title)$/i,D=(t=>(e,...o)=>({_$litType$:t,strings:e,values:o}))(1),R=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),H=new WeakMap,L=b.createTreeWalker(b,129,null,!1),j=(t,e)=>{const o=t.length-1,s=[];let i,n=2===e?"":"",r=P;for(let e=0;e"===d[0]?(r=null!=i?i:P,l=-1):void 0===d[1]?l=-2:(l=r.lastIndex-d[2].length,a=d[1],r=void 0===d[3]?T:'"'===d[3]?M:U):r===M||r===U?r=T:r===N||r===O?r=P:(r=T,i=void 0);const h=r===T&&t[e+1].startsWith("/>")?" ":"";n+=r===P?o+E:l>=0?(s.push(a),o.slice(0,l)+"$lit$"+o.slice(l)+$+h):o+$+(-2===l?(s.push(void 0),e):h)}const a=n+(t[o]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==g?g.createHTML(a):a,s]};class I{constructor({strings:t,_$litType$:e},o){let s;this.parts=[];let i=0,n=0;const r=t.length-1,a=this.parts,[d,l]=j(t,e);if(this.el=I.createElement(d,o),L.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=L.nextNode())&&a.length0){s.textContent=y?y.emptyScript:"";for(let o=0;oC(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==k&&S(this._$AH)?this._$AA.nextSibling.data=t:this.T(b.createTextNode(t)),this._$AH=t}$(t){var e;const{values:o,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=I.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.p(o);else{const t=new q(i,this),e=t.v(this.options);t.p(o),this.T(e),this._$AH=t}}_$AC(t){let e=H.get(t.strings);return void 0===e&&H.set(t.strings,e=new I(t)),e}k(t){C(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let o,s=0;for(const i of t)s===e.length?e.push(o=new B(this.O(A()),this.O(A()),this,this.options)):o=e[s],o._$AI(i),s++;s2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=k}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,o,s){const i=this.strings;let n=!1;if(void 0===i)t=z(this,t,e,0),n=!S(t)||t!==this._$AH&&t!==R,n&&(this._$AH=t);else{const s=t;let r,a;for(t=i[0],r=0;r{var s,i;const n=null!==(s=null==o?void 0:o.renderBefore)&&void 0!==s?s:e;let r=n._$litPart$;if(void 0===r){const t=null!==(i=null==o?void 0:o.renderBefore)&&void 0!==i?i:null;n._$litPart$=r=new B(e.insertBefore(A(),t),t,void 0,null!=o?o:{})}return r._$AI(t),r})(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 R}}X.finalized=!0,X._$litElement$=!0,null===(G=globalThis.litElementHydrateSupport)||void 0===G||G.call(globalThis,{LitElement:X});const tt=globalThis.litElementPolyfillSupport;null==tt||tt({LitElement:X}),(null!==(Q=globalThis.litElementVersions)&&void 0!==Q?Q:globalThis.litElementVersions=[]).push("3.2.2");const et=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(o){o.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(o){o.createProperty(e.key,t)}};function ot(t){return(e,o)=>void 0!==o?((t,e,o)=>{e.constructor.createProperty(o,t)})(t,e,o):et(t,e)}var st;async function it(){const t=await async function(){await Promise.race([customElements.whenDefined("home-assistant"),customElements.whenDefined("hc-main")]);const t=customElements.get("home-assistant")?"home-assistant":"hc-main";for(;!document.querySelector(t);)await new Promise((t=>window.setTimeout(t,100)));return document.querySelector(t)}();for(;!t.hass;)await new Promise((t=>window.setTimeout(t,100)));return t.hass}null===(st=window.HTMLSlotElement)||void 0===st||st.prototype.assignedElements;window.cardMod_template_cache=window.cardMod_template_cache||{};const nt=window.cardMod_template_cache;async function rt(t,e,o){const s=await it(),i=s.connection,n=JSON.stringify([e,o]);let r=nt[n];r?(r.callbacks.has(t)||at(t),t(r.value),r.callbacks.add(t)):(at(t),t(""),o=Object.assign({user:s.user.name,browser:document.querySelector("hc-main")?"CAST":localStorage["browser_mod-browser-id"]?localStorage["browser_mod-browser-id"]:"",hash:location.hash.substr(1)||""},o),nt[n]=r={template:e,variables:o,value:"",callbacks:new Set([t]),unsubscribe:i.subscribeMessage((t=>function(t,e){const o=nt[t];o&&(o.value=e.result,o.callbacks.forEach((t=>t(e.result))))}(n,t)),{type:"render_template",template:e,variables:o})})}async function at(t){let e;for(const[o,s]of Object.entries(nt))if(s.callbacks.has(t)){s.callbacks.delete(t),0==s.callbacks.size&&(e=s.unsubscribe,delete nt[o]);break}e&&await(await e)()}var dt="3.2.2";const lt=async t=>{await(async()=>{if(customElements.get("developer-tools-event"))return;await customElements.whenDefined("partial-panel-resolver");const t=document.createElement("partial-panel-resolver");t.hass={panels:[{url_path:"tmp",component_name:"developer-tools"}]},t._updateRoutes(),await t.routerOptions.routes.tmp.load(),await customElements.whenDefined("developer-tools-router");const e=document.createElement("developer-tools-router");await e.routerOptions.routes.event.load()})();return document.createElement("developer-tools-event")._computeParsedEventData(t)};async function ct(t,e,o="",s={},i=null,n=!0){var r;if(!t)return;let a;(null===(r=t.localName)||void 0===r?void 0:r.includes("-"))&&await customElements.whenDefined(t.localName),t.updateComplete&&await t.updateComplete,void 0===t._cardMod&&(t._cardMod=[]);for(const o of t._cardMod)if(o.type===e){a=o;break}return a||(a=document.createElement("card-mod"),a.type=e,t._cardMod.push(a)),queueMicrotask((async()=>{const e=t.modElement?t.modElement:n&&t.shadowRoot||t;e.contains(a)||e.appendChild(a),a.variables=s,a.styles=o})),a}function ht(t,e){const o=t=>t&&"object"==typeof t&&!Array.isArray(t);if(o(t)&&o(e))for(const s in e)o(e[s])?(t[s]||Object.assign(t,{[s]:{}}),"string"==typeof t[s]&&(t[s]={".":t[s]}),ht(t[s],e[s])):t[s]?t[s]=e[s]+t[s]:t[s]=e[s];return t}function ut(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(!(t instanceof Object&&e instanceof Object))return!1;for(const o in t)if(t.hasOwnProperty(o)){if(!e.hasOwnProperty(o))return!1;if(t[o]!==e[o]){if("object"!=typeof t[o])return!1;if(!ut(t[o],e[o]))return!1}}for(const o in e)if(e.hasOwnProperty(o)&&!t.hasOwnProperty(o))return!1;return!0}function pt(t){return t.config?t.config:t._config?t._config:t.host?pt(t.host):t.parentElement?pt(t.parentElement):t.parentNode?pt(t.parentNode):null}function mt(t,e){for(const o of e)t.add(o)}async function ft(t,e=0){let o=new Set;if(10==e)return o;if(!t)return o;if(t._cardMod)for(const e of t._cardMod)e.styles&&o.add(e);return t.updateComplete&&await t.updateComplete,t.parentElement?mt(o,await ft(t.parentElement,e+1)):t.parentNode&&mt(o,await ft(t.parentNode,e+1)),t.host&&mt(o,await ft(t.host,e+1)),o}async function vt(t,e=!1){var o;if((null===(o=t.localName)||void 0===o?void 0:o.includes("-"))&&await customElements.whenDefined(t.localName),t.updateComplete&&await t.updateComplete,e&&(t.pageRendered&&await t.pageRendered,t._panelState)){let e=0;for(;"loaded"!==t._panelState&&e++<5;)await new Promise((t=>setTimeout(t,100)))}}async function _t(t,e,o=!1){let s=[t];for("string"==typeof e&&(e=e.split(/(\$| )/));""===e[e.length-1];)e.pop();for(const[t,o]of e.entries()){const t=s[0];if(!t)return null;o.trim().length&&(vt(t),s="$"===o?[t.shadowRoot]:t.querySelectorAll(o))}return o?s:s[0]}async function yt(t,e,o=!1,s=1e4){return Promise.race([_t(t,e,o),new Promise(((t,e)=>setTimeout((()=>e(new Error("SELECTTREE-TIMEOUT"))),s)))]).catch((t=>{if(!t.message||"SELECTTREE-TIMEOUT"!==t.message)throw t;return null}))}class gt extends X{static get applyToElement(){return ct}constructor(){super(),this._rendered_styles="",this._styleChildren=new Set,this._observer=new MutationObserver((t=>{for(const e of t){if("card-mod"===e.target.localName)return;e.addedNodes.length&&e.addedNodes.forEach((t=>{t.localName})),e.removedNodes.length&&e.removedNodes.forEach((t=>{t.localName}))}stop||this.refresh()})),document.addEventListener("cm_update",(()=>{this.refresh()}))}connectedCallback(){super.connectedCallback(),this._connect(),this.setAttribute("slot","none")}disconnectedCallback(){super.disconnectedCallback(),this._disconnect()}set styles(t){ut(t,this._input_styles)||(this._input_styles=t,(async()=>{let e=JSON.parse(JSON.stringify(t||{}));"string"==typeof e&&(e={".":e});ht(e,await async function(t){var e;if(!t.type)return null;const o=t.parentElement?t.parentElement:t,s=window.getComputedStyle(o).getPropertyValue("--card-mod-theme"),i=await it();if(!i)return{};const n=null!==(e=null==i?void 0:i.themes.themes)&&void 0!==e?e:{};return n[s]?n[s][`card-mod-${t.type}-yaml`]?lt(n[s][`card-mod-${t.type}-yaml`]):n[s][`card-mod-${t.type}`]?{".":n[s][`card-mod-${t.type}`]}:{}:{}}(this)),this._fixed_styles=e,this._connect()})())}get styles(){return this._styles}refresh(){this._connect()}async _styleChildEl(t,e){if(void 0===e){const o=this._fixed_styles;for(const[s,i]of Object.entries(o)){if("."===s)continue;if((await yt(this.parentElement||this.parentNode,s,!0)).forEach((o=>{o===t&&(e=i)})),void 0!==e)break}if(void 0===e)return}if(!t)return;const o=await ct(t,`${this.type}-child`,e,this.variables,null,!1);return o.refresh,o}async _connect(){var t;const e=null!==(t=this._fixed_styles)&&void 0!==t?t:{},o=new Set;let s="",i=!1;const n=this.parentElement||this.parentNode;for(const[t,r]of Object.entries(e))if("."===t)s=r;else{i=!0;const e=await yt(n,t,!0);if(!e)continue;for(const t of e){const e=await this._styleChildEl(t,r);e&&o.add(e)}}for(const t of this._styleChildren)o.has(t)||t&&(t.styles="");var r;(this._styleChildren=o,this._styles!==s)&&(this._styles=s,this._styles&&(r=this._styles,String(r).includes("{%")||String(r).includes("{{"))?(this._renderer=this._renderer||this._style_rendered.bind(this),rt(this._renderer,this._styles,this.variables)):this._style_rendered(this._styles||""),i&&(this._observer.disconnect(),this._observer.observe(function(t){if(!t)return;const e=t.parentElement||t.parentNode;return e?e.host?e.host:e:void 0}(this),{childList:!0})))}async _disconnect(){this._observer.disconnect(),this._styles="",await at(this._renderer)}_style_rendered(t){this._rendered_styles!==t&&(this._rendered_styles=t),this.dispatchEvent(new Event("card-mod-update"))}createRenderRoot(){return this}render(){return D` - - `}}t([ot()],gt.prototype,"_rendered_styles",void 0),(async()=>{for(;void 0===customElements.get("home-assistant");)await new Promise((t=>window.setTimeout(t,100)));customElements.get("card-mod")||(customElements.define("card-mod",gt),console.info(`%cCARD-MOD ${dt} IS INSTALLED`,"color: green; font-weight: bold"))})(),customElements.whenDefined("ha-card").then((()=>{const t=customElements.get("ha-card");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.firstUpdated;t.prototype.firstUpdated=function(...t){var o,s;null==e||e.bind(this)(...t);const i=pt(this);(null===(o=null==i?void 0:i.card_mod)||void 0===o?void 0:o.class)&&this.classList.add(i.card_mod.class),(null==i?void 0:i.type)&&this.classList.add(`type-${i.type.replace(":","-")}`),ct(this,"card",(null===(s=null==i?void 0:i.card_mod)||void 0===s?void 0:s.style)||(null==i?void 0:i.style)||"",{config:i},null,!1).then((t=>{var e;const o=null===(e=this.parentNode)||void 0===e?void 0:e.host;if(o){if(o.setConfig&&!o.setConfig.cm_patched){const e=o.setConfig;o.setConfig=function(o,...s){var i;e.bind(this)(o,...s),t.variables={config:o},t.styles=(null===(i=o.card_mod)||void 0===i?void 0:i.style)||{}},o.setConfig.cm_patched=!0}if(o.update&&!o.update.cm_patched){const e=o.update;o.update=function(...o){e.bind(this)(...o),this.updateComplete?this.updateComplete.then((()=>{t.refresh()})):t.refresh()},o.update.cm_patched=!0}}}))}})),customElements.whenDefined("hui-entities-card").then((()=>{const t=customElements.get("hui-entities-card");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.renderEntity;t.prototype.renderEntity=function(t,...o){var s;const i=e.bind(this)(t,...o);if(!i||!i.values)return i;const n=i.values[0];if(!n)return i;if("custom:mod-card"===(null==t?void 0:t.type))return i;(null===(s=null==t?void 0:t.card_mod)||void 0===s?void 0:s.class)&&n.classList.add(t.card_mod.class),(null==t?void 0:t.type)&&n.classList.add(`type-${t.type.replace(":","-")}`);const r=async()=>{var e;return ct(n,"row",(null===(e=null==t?void 0:t.card_mod)||void 0===e?void 0:e.style)||(null==t?void 0:t.style)||"",{config:t})};return(async()=>{const t=await r();if(n.update&&!n.update.cm_patched){const e=n.update;n.update=function(...o){e.bind(this)(...o),this.updateComplete?this.updateComplete.then((()=>{t.refresh()})):t.refresh()}}})(),this.updateComplete.then((()=>r())),i.values[0]&&i.values[0].addEventListener("ll-rebuild",r),i}}));customElements.whenDefined("hui-glance-card").then((()=>{const t=customElements.get("hui-glance-card");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.updated;t.prototype.updated=function(...t){var o,s;null==e||e.bind(this)(...t);for(const t of this.shadowRoot.querySelectorAll("ha-card div.entity")){if(!t.cardmod_patched){t.cardmod_patched=!0;const e=t.attachShadow({mode:"open"});for(;t.firstChild;)e.append(t.firstChild);const o=document.createElement("style");e.appendChild(o),o.innerHTML="\ndiv {\n width: 100%;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.name {\n min-height: var(--paper-font-body1_-_line-height, 20px);\n}\nstate-badge {\n margin: 8px 0;\n}\n"}const e=t.config||t.entityConf;(null===(o=null==e?void 0:e.card_mod)||void 0===o?void 0:o.class)&&t.classList.add(e.card_mod.class),ct(t,"glance",(null===(s=null==e?void 0:e.card_mod)||void 0===s?void 0:s.style)||(null==e?void 0:e.style)||"",{config:e})}}})),customElements.whenDefined("hui-state-label-badge").then((()=>{const t=customElements.get("hui-state-label-badge");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.firstUpdated;t.prototype.firstUpdated=function(...t){var o,s;null==e||e.bind(this)(...t);const i=this._config;(null===(o=null==i?void 0:i.card_mod)||void 0===o?void 0:o.class)&&this.classList.add(i.card_mod.class),ct(this,"badge",(null===(s=null==i?void 0:i.card_mod)||void 0===s?void 0:s.style)||(null==i?void 0:i.style)||"",{config:i})}})),customElements.whenDefined("hui-view").then((()=>{const t=customElements.get("hui-view");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.updated;t.prototype.updated=function(...t){null==e||e.bind(this)(...t),ct(this,"view","",{},null,!1)}})),customElements.whenDefined("hui-root").then((()=>{const t=customElements.get("hui-root");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.firstUpdated;t.prototype.firstUpdated=async function(...t){null==e||e.bind(this)(...t),ct(this,"root")},yt(document,"home-assistant$home-assistant-main$partial-panel-resolver ha-panel-lovelace$hui-root",!1).then((t=>{null==t||t.firstUpdated()}))})),customElements.whenDefined("ha-more-info-dialog").then((()=>{const t=customElements.get("ha-more-info-dialog");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.showDialog;t.prototype.showDialog=function(t,...o){null==e||e.bind(this)(t,...o),this.requestUpdate(),this.updateComplete.then((async()=>{const e=this.shadowRoot.querySelector("ha-dialog");e&&ct(e,"more-info","",{config:t},null,!1)}))},yt(document,"home-assistant$ha-more-info-dialog",!1).then((e=>{e&&(e.showDialog=t.prototype.showDialog.bind(e),e.showDialog({entityId:e.entityId}))}))})),customElements.whenDefined("ha-sidebar").then((()=>{const t=customElements.get("ha-sidebar");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.firstUpdated;t.prototype.firstUpdated=async function(...t){null==e||e.bind(this)(...t),ct(this,"sidebar")},yt(document,"home-assistant$home-assistant-main$ ha-sidebar",!1).then((t=>{null==t||t.firstUpdated()}))})),customElements.whenDefined("hui-card-element-editor").then((()=>{const t=customElements.get("hui-card-element-editor");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.getConfigElement;t.prototype.getConfigElement=async function(){const t=await e.bind(this)();if(t){const e=t.setConfig;t.setConfig=function(t,...o){var s,i;const n=JSON.parse(JSON.stringify(t));if(this._cardModData={card:n.card_mod,entities:[]},n.entities)for(const[t,e]of null===(s=n.entities)||void 0===s?void 0:s.entries())this._cardModData.entities[t]=e.card_mod,delete e.card_mod;if(delete n.card_mod,e.bind(this)(n,...o),n.entities)for(const[t,e]of null===(i=n.entities)||void 0===i?void 0:i.entries())this._cardModData.entities[t]&&(e.card_mod=this._cardModData.entities[t])}}return t};const o=t.prototype._handleUIConfigChanged;t.prototype._handleUIConfigChanged=function(t,...e){if(this._configElement&&this._configElement._cardModData){const e=this._configElement._cardModData;e.card&&(t.detail.config.card_mod=e.card)}o.bind(this)(t,...e)}})),customElements.whenDefined("hui-dialog-edit-card").then((()=>{const t=customElements.get("hui-dialog-edit-card");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.updated;t.prototype.updated=function(...t){null==e||e.bind(this)(...t),this.updateComplete.then((async()=>{var t,e,o;this._cardModIcon||(this._cardModIcon=document.createElement("ha-icon"),this._cardModIcon.icon="mdi:brush");const s=this.shadowRoot.querySelector("mwc-button[slot=secondaryAction]");s&&(s.appendChild(this._cardModIcon),(null===(t=this._cardConfig)||void 0===t?void 0:t.card_mod)||(null===(o=null===(e=this._cardConfig)||void 0===e?void 0:e.entities)||void 0===o?void 0:o.some((t=>t.card_mod)))?this._cardModIcon.style.visibility="visible":this._cardModIcon.style.visibility="hidden")}))}})),customElements.whenDefined("hui-picture-elements-card").then((()=>{const t=customElements.get("hui-picture-elements-card");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.setConfig;t.prototype.setConfig=function(...t){var o,s;null==e||e.bind(this)(...t);for(const[t,e]of this._elements.entries()){const i=this._config.elements[t];(null===(o=null==i?void 0:i.card_mod)||void 0===o?void 0:o.class)&&e.classList.add(i.card_mod.class),(null==i?void 0:i.type)&&e.classList.add(`type-${i.type.replace(":","-")}`),ct(e,"element",null===(s=null==i?void 0:i.card_mod)||void 0===s?void 0:s.style,{config:i})}}}));const $t=t=>{const e=window.getComputedStyle(t);"none"===e.getPropertyValue("--card-mod-icon-dim")&&(t.style.filter="none");const o=e.getPropertyValue("--card-mod-icon");o&&(t.icon=o.trim());const s=e.getPropertyValue("--card-mod-icon-color");s&&(t.style.color=s)},wt=async t=>{if(t.cardmod_bound)return;t.cardmod_bound=!0;const e=async()=>{const e=await ft(t);for(const o of e)o.addEventListener("card-mod-update",(async()=>{await o.updateComplete,$t(t)}));return $t(t),e};0==(await e()).size&&window.setTimeout((()=>e()),1e3)};customElements.whenDefined("ha-state-icon").then((()=>{const t=customElements.get("ha-state-icon");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.updated;t.prototype.updated=function(...t){e.bind(this)(...t),wt(this),$t(this)}})),customElements.whenDefined("ha-icon").then((()=>{const t=customElements.get("ha-icon");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.updated;t.prototype.updated=function(...t){null==e||e.bind(this)(...t),wt(this)}})),customElements.whenDefined("ha-svg-icon").then((()=>{const t=customElements.get("ha-svg-icon");if(t.prototype.cardmod_patched)return;t.prototype.cardmod_patched=!0;const e=t.prototype.updated;t.prototype.updated=function(...t){var o,s;null==e||e.bind(this)(...t),"ha-icon"!==(null===(s=null===(o=this.parentNode)||void 0===o?void 0:o.host)||void 0===s?void 0:s.localName)&&wt(this)}}));const Et="\nha-card {\n background: none;\n box-shadow: none;\n border: none;\n transition: none;\n}";class bt extends X{setConfig(t){var e;this._config=JSON.parse(JSON.stringify(t));let o=(null===(e=this._config.card_mod)||void 0===e?void 0:e.style)||this._config.style;void 0===o?o=Et:"string"==typeof o?o=Et+o:o["."]?o["."]=Et+o["."]:o["."]=Et,this._config.card_mod={style:o},this.build_card(t.card)}async build_card(t){void 0===this._hass&&await new Promise((t=>this._hassResolve=t)),this._hassResolve=void 0;const e=await window.loadCardHelpers();this.card=await e.createCardElement(t),this.card.hass=this._hass}firstUpdated(){window.setTimeout((()=>{var t,e;if(null===(e=null===(t=this.card)||void 0===t?void 0:t.shadowRoot)||void 0===e?void 0:e.querySelector("ha-card")){console.info("%cYou are doing it wrong!","color: red; font-weight: bold");let t=this.card.localName.replace(/hui-(.*)-card/,"$1");console.info(`mod-card should NEVER be used with a card that already has a ha-card element, such as ${t}`)}}),3e3)}set hass(t){this._hass=t,this.card&&(this.card.hass=t),this._hassResolve&&this._hassResolve()}render(){return D` ${this.card} `}getCardSize(){if(this._config.report_size)return this._config.report_size;let t=this.shadowRoot;return t&&(t=t.querySelector("ha-card card-maker")),t&&(t=t.getCardSize),t&&(t=t()),t||1}}function At(){document.dispatchEvent(new Event("cm_update"))}t([ot()],bt.prototype,"card",void 0),(async()=>{for(;void 0===customElements.get("home-assistant");)await new Promise((t=>window.setTimeout(t,100)));customElements.get("mod-card")||customElements.define("mod-card",bt)})();const St=[customElements.whenDefined("home-assistant"),customElements.whenDefined("hc-main")];Promise.race(St).then((()=>{window.setTimeout((async()=>{var t,e;const o=await it();for(;!o;)await new Promise((t=>window.setTimeout(t,500)));o.connection.subscribeEvents((()=>{window.setTimeout(At,500)}),"themes_updated"),null===(t=document.querySelector("home-assistant"))||void 0===t||t.addEventListener("settheme",At),null===(e=document.querySelector("hc-main"))||void 0===e||e.addEventListener("settheme",At)}),1e3)}));const Ct=function(){var t,e,o;const s=document.querySelectorAll("script"),i=[];for(const n of s)if(null===(e=null===(t=null==n?void 0:n.innerText)||void 0===t?void 0:t.trim())||void 0===e?void 0:e.startsWith("import(")){const t=null===(o=n.innerText.split("\n"))||void 0===o?void 0:o.map((t=>t.trim()));for(const e of t)i.push(e.replace(/^import\(\"/,"").replace(/\"\);/,""))}return i}();Ct.some((t=>t.endsWith("card-mod.js")))||console.info("You may not be getting optimal performance out of card-mod.\nSee https://github.com/thomasloven/lovelace-card-mod#performance-improvements"); +var t,e,n,r,i,o,a,s;function u(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function y(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function m(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){y(o,r,i,a,s,"next",t)}function s(t){y(o,r,i,a,s,"throw",t)}a(void 0)}))}}function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$(t,e)}function b(t){var e=x();return function(){var n,r=E(t);if(e){var i=E(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===N(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _(t)}(this,n)}}function _(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t){var e="function"==typeof Map?new Map:void 0;return w=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return k(t,arguments,E(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),$(n,t)},w(t)}function k(t,e,n){return k=x()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&$(i,n.prototype),i},k.apply(null,arguments)}function x(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function $(t,e){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$(t,e)}function E(t){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(t)}function A(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=S(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function S(t,e){if(t){if("string"==typeof t)return O(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(t,e):void 0}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}"function"==typeof SuppressedError&&SuppressedError;var R=globalThis,L=R.ShadowRoot&&(void 0===R.ShadyCSS||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,U=Symbol(),D=new WeakMap,H=function(){function t(e,n,r){if(P(this,t),this._$cssResult$=!0,r!==U)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}return j(t,[{key:"styleSheet",get:function(){var t=this.o,e=this.t;if(L&&void 0===t){var n=void 0!==e&&1===e.length;n&&(t=D.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&D.set(e,t))}return t}},{key:"toString",value:function(){return this.cssText}}]),t}(),I=L?function(t){return t}:function(t){return t instanceof CSSStyleSheet?function(t){var e,n="",r=A(t.cssRules);try{for(r.s();!(e=r.n()).done;){n+=e.value.cssText}}catch(t){r.e(t)}finally{r.f()}return function(t){return new H("string"==typeof t?t:t+"",void 0,U)}(n)}(t):t},z=Object.is,q=Object.defineProperty,B=Object.getOwnPropertyDescriptor,V=Object.getOwnPropertyNames,J=Object.getOwnPropertySymbols,W=Object.getPrototypeOf,G=globalThis,F=G.trustedTypes,Y=F?F.emptyScript:"",K=G.reactiveElementPolyfillSupport,Z=function(t,e){return t},Q={toAttribute:function(t,e){switch(e){case Boolean:t=t?Y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute:function(t,e){var n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},X=function(t,e){return!z(t,e)},tt={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:X};null!==(t=Symbol.metadata)&&void 0!==t||(Symbol.metadata=Symbol("metadata")),null!==(e=G.litPropertyMetadata)&&void 0!==e||(G.litPropertyMetadata=new WeakMap);var et=function(t){g(r,w(HTMLElement));var e,n=b(r);function r(){var t;return P(this,r),(t=n.call(this))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return j(r,[{key:"_$Ev",value:function(){var t,e=this;this._$Eg=new Promise((function(t){return e.enableUpdating=t})),this._$AL=new Map,this._$ES(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((function(t){return t(e)}))}},{key:"addController",value:function(t){var e,n;(null!==(e=this._$E_)&&void 0!==e?e:this._$E_=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}},{key:"removeController",value:function(t){var e;null===(e=this._$E_)||void 0===e||e.delete(t)}},{key:"_$ES",value:function(){var t,e=new Map,n=A(this.constructor.elementProperties.keys());try{for(n.s();!(t=n.n()).done;){var r=t.value;this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r])}}catch(t){n.e(t)}finally{n.f()}e.size>0&&(this._$Ep=e)}},{key:"createRenderRoot",value:function(){var t,e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return function(t,e){if(L)t.adoptedStyleSheets=e.map((function(t){return t instanceof CSSStyleSheet?t:t.styleSheet}));else{var n,r=A(e);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=document.createElement("style"),a=R.litNonce;void 0!==a&&o.setAttribute("nonce",a),o.textContent=i.cssText,t.appendChild(o)}}catch(t){r.e(t)}finally{r.f()}}}(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function(){var t,e;null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$E_)||void 0===e||e.forEach((function(t){var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}},{key:"enableUpdating",value:function(t){}},{key:"disconnectedCallback",value:function(){var t;null===(t=this._$E_)||void 0===t||t.forEach((function(t){var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}},{key:"attributeChangedCallback",value:function(t,e,n){this._$AK(t,n)}},{key:"_$EO",value:function(t,e){var n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(void 0!==r&&!0===n.reflect){var i,o=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:Q).toAttribute(e,n.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}},{key:"_$AK",value:function(t,e){var n=this.constructor,r=n._$Eh.get(t);if(void 0!==r&&this._$Em!==r){var i,o=n.getPropertyOptions(r),a="function"==typeof o.converter?{fromAttribute:o.converter}:void 0!==(null===(i=o.converter)||void 0===i?void 0:i.fromAttribute)?o.converter:Q;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}},{key:"requestUpdate",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;if(void 0!==t){var o,a;if(null!==(o=n)&&void 0!==o||(n=this.constructor.getPropertyOptions(t)),!(null!==(a=n.hasChanged)&&void 0!==a?a:X)(r?i:this[t],e))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}},{key:"C",value:function(t,e,n){var r;this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(null!==(r=this._$Ej)&&void 0!==r?r:this._$Ej=new Set).add(t)}},{key:"_$EP",value:(e=m(p().mark((function t(){var e;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.isUpdatePending=!0,t.prev=1,t.next=4,this._$Eg;case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),Promise.reject(t.t0);case 9:if(e=this.scheduleUpdate(),t.t1=null!=e,!t.t1){t.next=14;break}return t.next=14,e;case 14:return t.abrupt("return",!this.isUpdatePending);case 15:case"end":return t.stop()}}),t,this,[[1,6]])}))),function(){return e.apply(this,arguments)})},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var t;if(null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this._$Ep){var e,n=A(this._$Ep);try{for(n.s();!(e=n.n()).done;){var r=v(e.value,2),i=r[0],o=r[1];this[i]=o}}catch(t){n.e(t)}finally{n.f()}this._$Ep=void 0}var a=this.constructor.elementProperties;if(a.size>0){var s,u=A(a);try{for(u.s();!(s=u.n()).done;){var c=v(s.value,2),l=c[0],d=c[1];!0!==d.wrapped||this._$AL.has(l)||void 0===this[l]||this.C(l,this[l],d)}}catch(t){u.e(t)}finally{u.f()}}}var h=!1,f=this._$AL;try{var p;(h=this.shouldUpdate(f))?(this.willUpdate(f),null!==(p=this._$E_)&&void 0!==p&&p.forEach((function(t){var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(f)):this._$ET()}catch(f){throw h=!1,this._$ET(),f}h&&this._$AE(f)}}},{key:"willUpdate",value:function(t){}},{key:"_$AE",value:function(t){var e;null!==(e=this._$E_)&&void 0!==e&&e.forEach((function(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)}},{key:"_$ET",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$Eg}},{key:"shouldUpdate",value:function(t){return!0}},{key:"update",value:function(t){var e=this;this._$Ej&&(this._$Ej=this._$Ej.forEach((function(t){return e._$EO(t,e[t])}))),this._$ET()}},{key:"updated",value:function(t){}},{key:"firstUpdated",value:function(t){}}],[{key:"addInitializer",value:function(t){var e;this._$Ei(),(null!==(e=this.l)&&void 0!==e?e:this.l=[]).push(t)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&f(this._$Eh.keys())}},{key:"createProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tt;if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(t,n,e);void 0!==r&&q(this.prototype,t,r)}}},{key:"getPropertyDescriptor",value:function(t,e,n){var r,i=null!==(r=B(this.prototype,t))&&void 0!==r?r:{get:function(){return this[e]},set:function(t){this[e]=t}},o=i.get,a=i.set;return{get:function(){return null==o?void 0:o.call(this)},set:function(e){var r=null==o?void 0:o.call(this);a.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(t){var e;return null!==(e=this.elementProperties.get(t))&&void 0!==e?e:tt}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Z("elementProperties"))){var t=W(this);t.finalize(),void 0!==t.l&&(this.l=f(t.l)),this.elementProperties=new Map(t.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Z("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Z("properties"))){var t,e=this.properties,n=A([].concat(f(V(e)),f(J(e))));try{for(n.s();!(t=n.n()).done;){var r=t.value;this.createProperty(r,e[r])}}catch(t){n.e(t)}finally{n.f()}}var i=this[Symbol.metadata];if(null!==i){var o=litPropertyMetadata.get(i);if(void 0!==o){var a,s=A(o);try{for(s.s();!(a=s.n()).done;){var u=v(a.value,2),c=u[0],l=u[1];this.elementProperties.set(c,l)}}catch(t){s.e(t)}finally{s.f()}}}this._$Eh=new Map;var d,h=A(this.elementProperties);try{for(h.s();!(d=h.n()).done;){var p=v(d.value,2),y=p[0],m=p[1],g=this._$Eu(y,m);void 0!==g&&this._$Eh.set(g,y)}}catch(t){h.e(t)}finally{h.f()}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(t){var e=[];if(Array.isArray(t)){var n,r=A(new Set(t.flat(1/0).reverse()));try{for(r.s();!(n=r.n()).done;){var i=n.value;e.unshift(I(i))}}catch(t){r.e(t)}finally{r.f()}}else void 0!==t&&e.push(I(t));return e}},{key:"_$Eu",value:function(t,e){var n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}}]),r}();et.elementStyles=[],et.shadowRootOptions={mode:"open"},et[Z("elementProperties")]=new Map,et[Z("finalized")]=new Map,null!=K&&K({ReactiveElement:et}),(null!==(n=G.reactiveElementVersions)&&void 0!==n?n:G.reactiveElementVersions=[]).push("2.0.2");var nt=globalThis,rt=nt.trustedTypes,it=rt?rt.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,ot="$lit$",at="lit$".concat((Math.random()+"").slice(9),"$"),st="?"+at,ut="<".concat(st,">"),ct=document,lt=function(){return ct.createComment("")},dt=function(t){return null===t||"object"!=N(t)&&"function"!=typeof t},ht=Array.isArray,ft="[ \t\n\f\r]",vt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pt=/-->/g,yt=/>/g,mt=RegExp(">|".concat(ft,"(?:([^\\s\"'>=/]+)(").concat(ft,"*=").concat(ft,"*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),gt=/'/g,bt=/"/g,_t=/^(?:script|style|textarea|title)$/i,wt=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i":"",a=vt,s=0;s"===l[0]?(a=null!==(f=n)&&void 0!==f?f:vt,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,c=l[1],a=void 0===l[3]?mt:'"'===l[3]?bt:gt):a===bt||a===gt?a=mt:a===pt||a===yt?a=vt:(a=mt,n=void 0)}var v=a===mt&&t[s+1].startsWith("/>")?" ":"";o+=a===vt?u+ut:d>=0?(i.push(c),u.slice(0,d)+ot+u.slice(d)+at+v):u+at+(-2===d?s:v)}return[At(t,o+(t[r]||"")+(2===e?"":"")),i]},Ot=function(){function t(e,n){var r,i=e.strings,o=e._$litType$;P(this,t),this.parts=[];var a=0,s=0,u=i.length-1,c=this.parts,l=v(St(i,o),2),d=l[0],h=l[1];if(this.el=t.createElement(d,n),Et.currentNode=this.el.content,2===o){var p=this.el.content.firstChild;p.replaceWith.apply(p,f(p.childNodes))}for(;null!==(r=Et.nextNode())&&c.length0){r.textContent=rt?rt.emptyScript:"";for(var $=0;$2&&void 0!==arguments[2]?arguments[2]:t,u=arguments.length>3?arguments[3]:void 0;if(e===kt)return e;var c=void 0!==u?null===(n=s._$Co)||void 0===n?void 0:n[u]:s._$Cl,l=dt(e)?void 0:e._$litDirective$;return(null===(r=c)||void 0===r?void 0:r.constructor)!==l&&(null!==(i=c)&&void 0!==i&&null!==(o=i._$AO)&&void 0!==o&&o.call(i,!1),void 0===l?c=void 0:(c=new l(t))._$AT(t,s,u),void 0!==u?(null!==(a=s._$Co)&&void 0!==a?a:s._$Co=[])[u]=c:s._$Cl=c),void 0!==c&&(e=Pt(t,c._$AS(t,e.values),c,u)),e}var Ct=function(){function t(e,n){P(this,t),this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}return j(t,[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"u",value:function(t){var e,n=this._$AD,r=n.el.content,i=n.parts,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:ct).importNode(r,!0);Et.currentNode=o;for(var a=Et.nextNode(),s=0,u=0,c=i[0];void 0!==c;){var l;if(s===c.index){var d=void 0;2===c.type?d=new jt(a,a.nextSibling,this,t):1===c.type?d=new c.ctor(a,c.name,c.strings,this,t):6===c.type&&(d=new Lt(a,this,t)),this._$AV.push(d),c=i[++u]}s!==(null===(l=c)||void 0===l?void 0:l.index)&&(a=Et.nextNode(),s++)}return Et.currentNode=ct,o}},{key:"p",value:function(t){var e,n=0,r=A(this._$AV);try{for(r.s();!(e=r.n()).done;){var i=e.value;void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,n),n+=i.strings.length-2):i._$AI(t[n])),n++}}catch(t){r.e(t)}finally{r.f()}}}]),t}(),jt=function(){function t(e,n,r,i){var o;P(this,t),this.type=2,this._$AH=xt,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=null===(o=null==i?void 0:i.isConnected)||void 0===o||o}return j(t,[{key:"_$AU",get:function(){var t,e;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cv}},{key:"parentNode",get:function(){var t,e=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===(null===(t=e)||void 0===t?void 0:t.nodeType)&&(e=n.parentNode),e}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(t){t=Pt(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),dt(t)?t===xt||null==t||""===t?(this._$AH!==xt&&this._$AR(),this._$AH=xt):t!==this._$AH&&t!==kt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):function(t){return ht(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator])}(t)?this.T(t):this._(t)}},{key:"k",value:function(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}},{key:"$",value:function(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}},{key:"_",value:function(t){this._$AH!==xt&&dt(this._$AH)?this._$AA.nextSibling.data=t:this.$(ct.createTextNode(t)),this._$AH=t}},{key:"g",value:function(t){var e,n=t.values,r=t._$litType$,i="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Ot.createElement(At(r.h,r.h[0]),this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.p(n);else{var o=new Ct(i,this),a=o.u(this.options);o.p(n),this.$(a),this._$AH=o}}},{key:"_$AC",value:function(t){var e=$t.get(t.strings);return void 0===e&&$t.set(t.strings,e=new Ot(t)),e}},{key:"T",value:function(e){ht(this._$AH)||(this._$AH=[],this._$AR());var n,r,i=this._$AH,o=0,a=A(e);try{for(a.s();!(r=a.n()).done;){var s=r.value;o===i.length?i.push(n=new t(this.k(lt()),this.k(lt()),this,this.options)):n=i[o],n._$AI(s),o++}}catch(t){a.e(t)}finally{a.f()}o0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t&&t!==this._$AB;){var n,r=t.nextSibling;t.remove(),t=r}}},{key:"setConnected",value:function(t){var e;void 0===this._$AM&&(this._$Cv=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}]),t}(),Tt=function(){function t(e,n,r,i,o){P(this,t),this.type=1,this._$AH=xt,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=o,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=xt}return j(t,[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=this.strings,o=!1;if(void 0===i)t=Pt(this,t,e,0),(o=!dt(t)||t!==this._$AH&&t!==kt)&&(this._$AH=t);else{var a,s,u=t;for(t=i[0],a=0;a1&&void 0!==arguments[1]?arguments[1]:this,0))&&void 0!==e?e:xt)!==kt){var n=this._$AH,r=t===xt&&n!==xt||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==xt&&(n===xt||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}}},{key:"handleEvent",value:function(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(n=this.options)||void 0===n?void 0:n.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}]),n}(),Lt=function(){function t(e,n,r){P(this,t),this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}return j(t,[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){Pt(this,t)}}]),t}(),Ut=nt.litHtmlPolyfillSupport;null!=Ut&&Ut(Ot,jt),(null!==(r=nt.litHtmlVersions)&&void 0!==r?r:nt.litHtmlVersions=[]).push("3.1.0");var Dt=function(t){g(n,et);var e=b(n);function n(){var t;return P(this,n),(t=e.apply(this,arguments)).renderOptions={host:_(t)},t._$Do=void 0,t}return j(n,[{key:"createRenderRoot",value:function(){var t,e,r=h(E(n.prototype),"createRenderRoot",this).call(this);return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=r.firstChild),r}},{key:"update",value:function(t){var e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),h(E(n.prototype),"update",this).call(this,t),this._$Do=function(t,e,n){var r,i=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:e,o=i._$litPart$;if(void 0===o){var a,s=null!==(a=null==n?void 0:n.renderBefore)&&void 0!==a?a:null;i._$litPart$=o=new jt(e.insertBefore(lt(),s),s,void 0,null!=n?n:{})}return o._$AI(t),o}(e,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var t;h(E(n.prototype),"connectedCallback",this).call(this),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var t;h(E(n.prototype),"disconnectedCallback",this).call(this),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}},{key:"render",value:function(){return kt}}]),n}();Dt._$litElement$=!0,Dt.finalized=!0,null===(i=globalThis.litElementHydrateSupport)||void 0===i||i.call(globalThis,{LitElement:Dt});var Ht=globalThis.litElementPolyfillSupport;null==Ht||Ht({LitElement:Dt}),(null!==(o=globalThis.litElementVersions)&&void 0!==o?o:globalThis.litElementVersions=[]).push("4.0.2");var It={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:X},zt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:It,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=n.kind,i=n.metadata,o=globalThis.litPropertyMetadata.get(i);if(void 0===o&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(n.name,t),"accessor"===r){var a=n.name;return{set:function(n){var r=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,r,t)},init:function(e){return void 0!==e&&this.C(a,void 0,t),e}}}if("setter"===r){var s=n.name;return function(n){var r=this[s];e.call(this,n),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+r)};function qt(t){return function(e,n){return"object"==N(n)?zt(t,e,n):function(t,e,n){var r=e.hasOwnProperty(n);return e.constructor.createProperty(n,r?l(l({},t),{},{wrapped:!0}):t),r?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}}function Bt(){return Vt.apply(this,arguments)}function Vt(){return Vt=m(p().mark((function t(){var e;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.race([customElements.whenDefined("home-assistant"),customElements.whenDefined("hc-main")]);case 2:e=customElements.get("home-assistant")?"home-assistant":"hc-main";case 3:if(document.querySelector(e)){t.next=8;break}return t.next=6,new Promise((function(t){return window.setTimeout(t,100)}));case 6:t.next=3;break;case 8:return t.abrupt("return",document.querySelector(e));case 9:case"end":return t.stop()}}),t)}))),Vt.apply(this,arguments)}function Jt(){return Wt.apply(this,arguments)}function Wt(){return Wt=m(p().mark((function t(){var e;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Bt();case 2:e=t.sent;case 3:if(e.hass){t.next=8;break}return t.next=6,new Promise((function(t){return window.setTimeout(t,100)}));case 6:t.next=3;break;case 8:return t.abrupt("return",e.hass);case 9:case"end":return t.stop()}}),t)}))),Wt.apply(this,arguments)}var Gt="browser_mod-browser-id";window.cardMod_template_cache=window.cardMod_template_cache||{};var Ft=window.cardMod_template_cache;function Yt(t,e){var n=Ft[t];n&&(n.value=e.result,n.callbacks.forEach((function(t){return t(e.result)})))}function Kt(t,e,n){return Zt.apply(this,arguments)}function Zt(){return(Zt=m(p().mark((function t(e,n,r){var i,o,a,s;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Jt();case 2:i=t.sent,o=i.connection,a=JSON.stringify([n,r]),(s=Ft[a])?(s.callbacks.has(e)||Qt(e),e(s.value),s.callbacks.add(e)):(Qt(e),e(""),r=Object.assign({user:i.user.name,browser:document.querySelector("hc-main")?"CAST":localStorage[Gt]?localStorage[Gt]:"",hash:location.hash.substr(1)||""},r),Ft[a]=s={template:n,variables:r,value:"",callbacks:new Set([e]),unsubscribe:o.subscribeMessage((function(t){return Yt(a,t)}),{type:"render_template",template:n,variables:r})});case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Qt(t){return Xt.apply(this,arguments)}function Xt(){return(Xt=m(p().mark((function t(e){var n,r,i,o,a,s;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0,i=Object.entries(Ft);case 1:if(!(r1&&void 0!==o[1]&&o[1],!(null===(r=e.localName)||void 0===r?void 0:r.includes("-"))){t.next=4;break}return t.next=4,customElements.whenDefined(e.localName);case 4:if(!e.updateComplete){t.next=7;break}return t.next=7,e.updateComplete;case 7:if(!n){t.next=18;break}if(!e.pageRendered){t.next=11;break}return t.next=11,e.pageRendered;case 11:if(!e._panelState){t.next=18;break}i=0;case 13:if(!("loaded"!==e._panelState&&i++<5)){t.next=18;break}return t.next=16,new Promise((function(t){return setTimeout(t,100)}));case 16:t.next=13;break;case 18:case"end":return t.stop()}}),t)}))),se.apply(this,arguments)}function ue(t,e){return ce.apply(this,arguments)}function ce(){return ce=m(p().mark((function t(e,n){var r,i,o,a,s,u,c,l=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=l.length>2&&void 0!==l[2]&&l[2],i=[e],"string"==typeof n&&(n=n.split(/(\$| )/));""===n[n.length-1];)n.pop();o=A(n.entries()),t.prev=5,o.s();case 7:if((a=o.n()).done){t.next=21;break}if(s=v(a.value,2),s[0],"$"!==(u=s[1])){t.next=12;break}return i=f(i).map((function(t){return t.shadowRoot})),t.abrupt("continue",19);case 12:if(c=i[0]){t.next=15;break}return t.abrupt("return",null);case 15:if(u.trim().length){t.next=17;break}return t.abrupt("continue",19);case 17:ae(c),i=c.querySelectorAll(u);case 19:t.next=7;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(5),o.e(t.t0);case 26:return t.prev=26,o.f(),t.finish(26);case 29:return t.abrupt("return",r?i:i[0]);case 30:case"end":return t.stop()}}),t,null,[[5,23,26,29]])}))),ce.apply(this,arguments)}function le(t,e){return de.apply(this,arguments)}function de(){return de=m(p().mark((function t(e,n){var r,i,o=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>2&&void 0!==o[2]&&o[2],i=o.length>3&&void 0!==o[3]?o[3]:1e4,t.abrupt("return",Promise.race([ue(e,n,r),new Promise((function(t,e){return setTimeout((function(){return e(new Error(oe))}),i)}))]).catch((function(t){if(!t.message||t.message!==oe)throw t;return null})));case 3:case"end":return t.stop()}}),t)}))),de.apply(this,arguments)}var he=function(t){g(n,Dt);var e=b(n);function n(){var t;return P(this,n),(t=e.apply(this,arguments))._cardMod=[],t}return j(n,[{key:"setConfig",value:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1?n-1:0),i=1;i3&&void 0!==l[3]?l[3]:{},o=!(l.length>4&&void 0!==l[4])||l[4],c=!1,void 0!==(a=l.length>5&&void 0!==l[5]?l[5]:void 0)&&"string"!=typeof a&&(c=!0,o=a,a=void 0),"boolean"!=typeof o&&(o=!0,c=!0),"string"==typeof(r=l.length>2&&void 0!==l[2]?l[2]:void 0)&&(r={style:r},c=!0),r&&0!==Object.keys(r).length&&void 0===(null!==(u=null!==(s=null==r?void 0:r.style)&&void 0!==s?s:null==r?void 0:r.class)&&void 0!==u?u:null==r?void 0:r.debug)&&(r={style:r},c=!0),c&&!window.cm_compatibility_warning&&(window.cm_compatibility_warning=!0,console.groupCollapsed("Card-mod warning"),console.info("You are using a custom card which relies on card-mod, and uses an outdated signature for applyToElement."),console.info("The outdated signature will be removed at some point in the future. Hopefully the developer of your card will have updated their card by then."),console.info("The card used card-mod to apply styles here:",e),console.groupEnd()),t.abrupt("return",pe(e,n,r,i,o,a));case 11:case"end":return t.stop()}}),t)}))),ve.apply(this,arguments)}function pe(t,e){return ye.apply(this,arguments)}function ye(){return ye=m(p().mark((function t(e,n){var r,i,o,a,s,u,c,l,d,h,v,y,g,b,_,w=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=w.length>3&&void 0!==w[3]?w[3]:{},a=!(w.length>4&&void 0!==w[4])||w[4],s=w.length>5&&void 0!==w[5]?w[5]:void 0,g=(null==(i=w.length>2&&void 0!==w[2]?w[2]:void 0)?void 0:i.debug)?function(){for(var t,e=arguments.length,n=new Array(e),r=0;r2&&void 0!==s[2]?s[2]:0,i=this.parentElement||this.parentNode,t.next=4,le(i,e,!0);case 4:if((o=t.sent)&&o.length){t.next=11;break}if(!(r>5)){t.next=8;break}throw new Error("NoElements");case 8:return t.next=10,new Promise((function(t){return setTimeout(t,100*r)}));case 10:return t.abrupt("return",this._style_child(e,n,r+1));case 11:return t.abrupt("return",f(o).map(function(){var t=m(p().mark((function t(e){var r;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,pe(e,"".concat(a.type,"-child"),{style:n,debug:a.debug},a.variables,!1);case 2:return(r=t.sent)&&(r.card_mod_parent=a),t.abrupt("return",r);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 12:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"_connect",value:(n=m(p().mark((function t(){var e,n,r,i,o,a,s,u,c,l,d,h,f,y=this;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=null!==(e=this._fixed_styles)&&void 0!==e?e:{},a={},s="",u=!1,this.parentElement||this.parentNode,this._debug("(Re)connecting",this),c=p().mark((function t(){var e,n,r;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=v(d[l],2),n=e[0],r=e[1],"."===n?"string"==typeof r?s=r:y._debug("Style of '.' must be a string: ",r):(u=!0,a[n]=y._style_child(n,r).catch((function(t){if("NoElements"!=t.message)throw t;y.debug&&(console.groupCollapsed("card-mod found no elements"),console.info("Looked for ".concat(n)),console.info(y),console.groupEnd())})));case 2:case"end":return t.stop()}}),t)})),l=0,d=Object.entries(o);case 8:if(!(l\n ","\n \n "])),this._rendered_styles)}}],[{key:"applyToElement",get:function(){return fe}}]),s}();M([qt({attribute:"card-mod-type",reflect:!0})],be.prototype,"type",void 0),M([qt()],be.prototype,"_rendered_styles",void 0),customElements.get("card-mod")||(customElements.define("card-mod",be),console.info("%cCARD-MOD ".concat(te," IS INSTALLED"),"color: green; font-weight: bold")),m(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==customElements.get("home-assistant")){t.next=5;break}return t.next=3,new Promise((function(t){return window.setTimeout(t,100)}));case 3:t.next=0;break;case 5:customElements.get("card-mod")||customElements.define("card-mod",be);case 6:case"end":return t.stop()}}),t)})))();var _e=function(t,e,n){if("constructor"!==e){var r=t[e];if(!(null==r?void 0:r.cm_patched)){var i=function(){for(var t=arguments.length,e=new Array(t),i=0;i1?o-1:0),s=1;s2?i-2:0),a=2;a1?i-1:0),a=1;a1?n-1:0),i=1;i1?e-1:0),r=1;r1?e-1:0),r=1;r2?r-2:0),o=2;o1?e-1:0),r=1;r2?f-2:0),y=2;y1?n-1:0),i=1;i2?i-2:0),a=2;a1?a-1:0),u=1;u1?r-1:0),o=1;o1?e-1:0),r=1;r1?e-1:0),r=1;r1?r-1:0),o=1;o1&&void 0!==s[1]?s[1]:0,r=new Set,10!=n){t.next=4;break}return t.abrupt("return",r);case 4:if(e){t.next=6;break}return t.abrupt("return",r);case 6:if(!e.updateComplete){t.next=9;break}return t.next=9,e.updateComplete;case 9:if(e._cardMod){i=A(e._cardMod);try{for(i.s();!(o=i.n()).done;)(a=o.value).styles&&r.add(a)}catch(t){i.e(t)}finally{i.f()}}if(!e.parentElement){t.next=19;break}return t.t0=qe,t.t1=r,t.next=15,Be(e.parentElement,n+1);case 15:t.t2=t.sent,(0,t.t0)(t.t1,t.t2),t.next=26;break;case 19:if(!e.parentNode){t.next=26;break}return t.t3=qe,t.t4=r,t.next=24,Be(e.parentNode,n+1);case 24:t.t5=t.sent,(0,t.t3)(t.t4,t.t5);case 26:if(!e.host){t.next=33;break}return t.t6=qe,t.t7=r,t.next=31,Be(e.host,n+1);case 31:t.t8=t.sent,(0,t.t6)(t.t7,t.t8);case 33:return t.abrupt("return",r);case 34:case"end":return t.stop()}}),t)}))),Ve.apply(this,arguments)}ze=M([xe("ha-svg-icon")],ze);var Je="\nha-card {\n background: none;\n box-shadow: none;\n border: none;\n transition: none;\n}",We=function(t){g(r,Dt);var e,n=b(r);function r(){return P(this,r),n.apply(this,arguments)}return j(r,[{key:"setConfig",value:function(t){var e;this._config=JSON.parse(JSON.stringify(t));var n=(null===(e=this._config.card_mod)||void 0===e?void 0:e.style)||this._config.style;void 0===n?n=Je:"string"==typeof n?n=Je+n:n["."]?n["."]=Je+n["."]:n["."]=Je,this._config.card_mod={style:n},this.build_card(t.card)}},{key:"build_card",value:(e=m(p().mark((function t(e){var n,r=this;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==this._hass){t.next=3;break}return t.next=3,new Promise((function(t){return r._hassResolve=t}));case 3:return this._hassResolve=void 0,t.next=6,window.loadCardHelpers();case 6:return n=t.sent,t.next=9,n.createCardElement(e);case 9:this.card=t.sent,this.card.hass=this._hass;case 11:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"firstUpdated",value:function(){var t=this;window.setTimeout((function(){var e,n;if(null===(n=null===(e=t.card)||void 0===e?void 0:e.shadowRoot)||void 0===n?void 0:n.querySelector("ha-card")){console.info("%cYou are doing it wrong!","color: red; font-weight: bold");var r=t.card.localName.replace(/hui-(.*)-card/,"$1");console.info("mod-card should NEVER be used with a card that already has a ha-card element, such as ".concat(r))}}),3e3)}},{key:"hass",set:function(t){this._hass=t,this.card&&(this.card.hass=t),this._hassResolve&&this._hassResolve()}},{key:"render",value:function(){return wt(s||(s=u([" "," "])),this.card)}},{key:"getCardSize",value:function(){if(this._config.report_size)return this._config.report_size;var t=this.shadowRoot;return t&&(t=t.querySelector("ha-card card-maker")),t&&(t=t.getCardSize),t&&(t=t()),t||1}}]),r}();function Ge(){document.dispatchEvent(new Event("cm_update"))}M([qt()],We.prototype,"card",void 0),customElements.get("mod-card")||customElements.define("mod-card",We),m(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==customElements.get("home-assistant")){t.next=5;break}return t.next=3,new Promise((function(t){return window.setTimeout(t,100)}));case 3:t.next=0;break;case 5:customElements.get("mod-card")||customElements.define("mod-card",We);case 6:case"end":return t.stop()}}),t)})))();var Fe,Ye,Ke,Ze=[customElements.whenDefined("home-assistant"),customElements.whenDefined("hc-main")];Promise.race(Ze).then((function(){window.setTimeout(m(p().mark((function t(){var e,n,r;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Jt();case 2:r=t.sent;case 3:if(r){t.next=8;break}return t.next=6,new Promise((function(t){return window.setTimeout(t,500)}));case 6:t.next=3;break;case 8:r.connection.subscribeEvents((function(){window.setTimeout(Ge,500)}),"themes_updated"),null===(e=document.querySelector("home-assistant"))||void 0===e||e.addEventListener("settheme",Ge),null===(n=document.querySelector("hc-main"))||void 0===n||n.addEventListener("settheme",Ge);case 11:case"end":return t.stop()}}),t)}))),1e3)}));var Qe,Xe=[],tn=A(document.querySelectorAll("script"));try{for(tn.s();!(Qe=tn.n()).done;){var en=Qe.value;if(null===(Ye=null===(Fe=null==en?void 0:en.innerText)||void 0===Fe?void 0:Fe.trim())||void 0===Ye?void 0:Ye.startsWith("import(")){var nn,rn=null===(Ke=en.innerText.split("\n"))||void 0===Ke?void 0:Ke.map((function(t){return t.trim()})),on=A(rn);try{for(on.s();!(nn=on.n()).done;){var an=nn.value;Xe.push(an.replace(/^import\(\"/,"").replace(/\"\);/,""))}}catch(t){on.e(t)}finally{on.f()}}}}catch(t){tn.e(t)}finally{tn.f()}Xe.some((function(t){return t.includes("/card-mod.js")}))||console.info("You may not be getting optimal performance out of card-mod.\nSee https://github.com/thomasloven/lovelace-card-mod#performance-improvements"); diff --git a/custom_components/ui_lovelace_minimalist/cards/lovelace-layout-card/lovelace-layout-card.js b/custom_components/ui_lovelace_minimalist/cards/lovelace-layout-card/lovelace-layout-card.js index 6788b8c1b..54560fc29 100644 --- a/custom_components/ui_lovelace_minimalist/cards/lovelace-layout-card/lovelace-layout-card.js +++ b/custom_components/ui_lovelace_minimalist/cards/lovelace-layout-card/lovelace-layout-card.js @@ -212,7 +212,7 @@ function t(t,e,i,o){var s,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPro a { color: var(--primary-color); } - `]}}t([tt()],Pt.prototype,"_config",void 0),t([tt()],Pt.prototype,"lovelace",void 0),t([tt()],Pt.prototype,"hass",void 0),t([et()],Pt.prototype,"_selectedTab",void 0),t([et()],Pt.prototype,"_selectedCard",void 0),t([et()],Pt.prototype,"_cardGUIMode",void 0),t([et()],Pt.prototype,"_cardGUIModeAvailable",void 0),t([function(t,e){return(({finisher:t,descriptor:e})=>(i,o)=>{var s;if(void 0===o){const o=null!==(s=i.originalKey)&&void 0!==s?s:i.key,n=null!=e?{kind:"method",placement:"prototype",key:o,descriptor:e(i.key)}:{...i,key:o};return null!=t&&(n.finisher=function(e){t(e,o)}),n}{const s=i.constructor;void 0!==e&&Object.defineProperty(i,o,e(o)),null==t||t(s,o)}})({descriptor:i=>{const o={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;o.get=function(){var i,o;return void 0===this[e]&&(this[e]=null!==(o=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==o?o:null),this[e]}}return o}})}("hui-card-element-editor")],Pt.prototype,"_cardEditorEl",void 0),customElements.define("layout-card-editor",Pt),customElements.whenDefined("hui-card-element-editor").then((()=>{const t=customElements.get("hui-card-element-editor"),e=t.prototype.getConfigElement;t.prototype.getConfigElement=async function(){const t=await e.bind(this)();if(t){const e=t.setConfig;t.setConfig=function(t){let i=JSON.parse(JSON.stringify(t));this._layoutData=i.view_layout,delete i.view_layout,e.bind(this)(i)}}return t};const i=t.prototype._handleUIConfigChanged;t.prototype._handleUIConfigChanged=function(t){this._configElement&&this._configElement._layoutData&&(t.detail.config.view_layout=this._configElement._layoutData),i.bind(this)(t)}})),customElements.whenDefined("hui-view-editor").then((()=>{const t=customElements.get("hui-view-editor"),e=t.prototype.firstUpdated;t.prototype.firstUpdated=function(){null==e||e.bind(this)(),this._oldSchema=this._schema,this._schema=t=>{const e=this._oldSchema(t),i=e.find((t=>"type"==t.name));return"layout"===i.name||(-1===i.selector.select.options.indexOf(Ut[0])&&i.selector.select.options.push(...Ut),void 0===e.find((t=>"layout"===t.name))&&e.push({name:"layout",selector:{object:{}}})),e};const t=document.createElement("p");t.innerHTML='\n You have layout-card installed which adds some options to this dialog.
\n Please see\n \n layout-card on github\n \n for usage instructions.\n \n ',this.shadowRoot.appendChild(t),this.requestUpdate()}}));class Rt extends HTMLElement{setConfig(t){var e,i;this.height=null!==(e=t.height)&&void 0!==e?e:50,this.size=null!==(i=t.size)&&void 0!==i?i:Math.ceil(this.height/50),this.style.cssText=`\n display: block;\n height: ${this.height}px;\n `}getCardSize(){return this.size}static getConfigElement(){return document.createElement("gap-card-editor")}static getStubConfig(){return{}}}customElements.define("gap-card",Rt),window.customCards=window.customCards||[],window.customCards.push({type:"gap-card",name:"Gap Card",preview:!1,description:"Add a customizable gap in the layout."});class zt extends Y{setConfig(t){this._config=t}heightChanged(t){const e=Object.assign({},this._config);delete e.height,t.detail.value&&(e.height=parseInt(t.detail.value)),this._config=e,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:e}}))}sizeChanged(t){const e=Object.assign({},this._config);delete e.size,t.detail.value&&(e.size=parseInt(t.detail.value)),this._config=e,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:e}}))}render(){return U` + `]}}t([tt()],Pt.prototype,"_config",void 0),t([tt()],Pt.prototype,"lovelace",void 0),t([tt()],Pt.prototype,"hass",void 0),t([et()],Pt.prototype,"_selectedTab",void 0),t([et()],Pt.prototype,"_selectedCard",void 0),t([et()],Pt.prototype,"_cardGUIMode",void 0),t([et()],Pt.prototype,"_cardGUIModeAvailable",void 0),t([function(t,e){return(({finisher:t,descriptor:e})=>(i,o)=>{var s;if(void 0===o){const o=null!==(s=i.originalKey)&&void 0!==s?s:i.key,n=null!=e?{kind:"method",placement:"prototype",key:o,descriptor:e(i.key)}:{...i,key:o};return null!=t&&(n.finisher=function(e){t(e,o)}),n}{const s=i.constructor;void 0!==e&&Object.defineProperty(i,o,e(o)),null==t||t(s,o)}})({descriptor:i=>{const o={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;o.get=function(){var i,o;return void 0===this[e]&&(this[e]=null!==(o=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==o?o:null),this[e]}}return o}})}("hui-card-element-editor")],Pt.prototype,"_cardEditorEl",void 0),customElements.define("layout-card-editor",Pt),customElements.whenDefined("hui-card-element-editor").then((()=>{const t=customElements.get("hui-card-element-editor"),e=t.prototype.getConfigElement;t.prototype.getConfigElement=async function(){const t=await e.bind(this)();if(t){const e=t.setConfig;t.setConfig=function(t){let i=JSON.parse(JSON.stringify(t));this._layoutData=i.view_layout,delete i.view_layout,e.bind(this)(i)}}return t};const i=t.prototype._handleUIConfigChanged;t.prototype._handleUIConfigChanged=function(t){this._configElement&&this._configElement._layoutData&&(t.detail.config.view_layout=this._configElement._layoutData),i.bind(this)(t)}})),customElements.whenDefined("hui-view-editor").then((()=>{const t=customElements.get("hui-view-editor"),e=t.prototype.firstUpdated;t.prototype.firstUpdated=function(){null==e||e.bind(this)(),this._oldSchema=this._schema,this._schema=(...t)=>{const[e,i,o]=t,s=this._oldSchema(...t),n=s.find((t=>"type"==t.name));if("layout"===n.name)return s;if(!n.selector.select.options.find((t=>t.value===Ut[0].value))){const t=Ut.map((t=>Object.assign(Object.assign({},t),{disabled:"sections"===i&&!1===o})));n.selector.select.options.push(...t)}return void 0===s.find((t=>"layout"===t.name))&&s.push({name:"layout",selector:{object:{}}}),s};const t=document.createElement("p");t.innerHTML='\n You have layout-card installed which adds some options to this dialog.
\n Please see\n \n layout-card on github\n \n for usage instructions.\n \n ',this.shadowRoot.appendChild(t),this.requestUpdate()}}));class Rt extends HTMLElement{setConfig(t){var e,i;this.height=null!==(e=t.height)&&void 0!==e?e:50,this.size=null!==(i=t.size)&&void 0!==i?i:Math.ceil(this.height/50),this.style.cssText=`\n display: block;\n height: ${this.height}px;\n `}getCardSize(){return this.size}static getConfigElement(){return document.createElement("gap-card-editor")}static getStubConfig(){return{}}}customElements.define("gap-card",Rt),window.customCards=window.customCards||[],window.customCards.push({type:"gap-card",name:"Gap Card",preview:!1,description:"Add a customizable gap in the layout."});class zt extends Y{setConfig(t){this._config=t}heightChanged(t){const e=Object.assign({},this._config);delete e.height,t.detail.value&&(e.height=parseInt(t.detail.value)),this._config=e,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:e}}))}sizeChanged(t){const e=Object.assign({},this._config);delete e.size,t.detail.value&&(e.size=parseInt(t.detail.value)),this._config=e,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:e}}))}render(){return U` - `}}t([tt()],zt.prototype,"_config",void 0),customElements.define("gap-card-editor",zt);var Ht="2.4.4";console.groupCollapsed(`%cLAYOUT-CARD ${Ht} IS INSTALLED`,"color: green; font-weight: bold"),console.log("Readme:","https://github.com/thomasloven/lovelace-layout-card"),console.groupEnd(); + `}}t([tt()],zt.prototype,"_config",void 0),customElements.define("gap-card-editor",zt);var Ht="2.4.5";console.groupCollapsed(`%cLAYOUT-CARD ${Ht} IS INSTALLED`,"color: green; font-weight: bold"),console.log("Readme:","https://github.com/thomasloven/lovelace-layout-card"),console.groupEnd(); diff --git a/custom_components/ui_lovelace_minimalist/cards/lovelace-state-switch/lovelace-state-switch.js b/custom_components/ui_lovelace_minimalist/cards/lovelace-state-switch/lovelace-state-switch.js index 363339aff..99cedd09e 100644 --- a/custom_components/ui_lovelace_minimalist/cards/lovelace-state-switch/lovelace-state-switch.js +++ b/custom_components/ui_lovelace_minimalist/cards/lovelace-state-switch/lovelace-state-switch.js @@ -1,4 +1,4 @@ -function t(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}const e=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new Map;class o{constructor(t,e){if(this._$cssResult$=!0,e!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=s.get(this.cssText);return e&&void 0===t&&(s.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const n=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,i,s)=>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[s+1]),t[0]);return new o(s,i)},r=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",i))(e)})(t):t;var a;const l=window.trustedTypes,h=l?l.emptyScript:"",d=window.reactiveElementPolyfillSupport,c={toAttribute(t,e){switch(e){case Boolean:t=t?h: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}},u=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:c,reflect:!1,hasChanged:u};class v extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Eh(i,e);void 0!==s&&(this._$Eu.set(s,i),t.push(s))})),t}static createProperty(t,e=p){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,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=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(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).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._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{e?t.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||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._$Eg)||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)}_$ES(t,e,i=p){var s,o;const n=this.constructor._$Eh(t,i);if(void 0!==n&&!0===i.reflect){const r=(null!==(o=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==o?o:c.toAttribute)(e,i.type);this._$Ei=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Ei=null}}_$AK(t,e){var i,s,o;const n=this.constructor,r=n._$Eu.get(t);if(void 0!==r&&this._$Ei!==r){const t=n.getPropertyOptions(r),a=t.converter,l=null!==(o=null!==(s=null===(i=a)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof a?a:null)&&void 0!==o?o:c.fromAttribute;this._$Ei=r,this[r]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}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._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||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._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||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)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}var f;v.finalized=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:v}),(null!==(a=globalThis.reactiveElementVersions)&&void 0!==a?a:globalThis.reactiveElementVersions=[]).push("1.3.0");const _=globalThis.trustedTypes,m=_?_.createPolicy("lit-html",{createHTML:t=>t}):void 0,g=`lit$${(Math.random()+"").slice(9)}$`,$="?"+g,y=`<${$}>`,b=document,A=(t="")=>b.createComment(t),w=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,E=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,x=/>/g,P=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,k=/'/g,U=/"/g,T=/^(?:script|style|textarea|title)$/i,H=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),M=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),O=new WeakMap,N=b.createTreeWalker(b,129,null,!1),L=(t,e)=>{const i=t.length-1,s=[];let o,n=2===e?"":"",r=E;for(let e=0;e"===l[0]?(r=null!=o?o:E,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?P:'"'===l[3]?U:k):r===U||r===k?r=P:r===C||r===x?r=E:(r=P,o=void 0);const c=r===P&&t[e+1].startsWith("/>")?" ":"";n+=r===E?i+y:h>=0?(s.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+g+c):i+g+(-2===h?(s.push(void 0),e):c)}const a=n+(t[i]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==m?m.createHTML(a):a,s]};class I{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const r=t.length-1,a=this.parts,[l,h]=L(t,e);if(this.el=I.createElement(l,i),N.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=N.nextNode())&&a.length0){s.textContent=_?_.emptyScript:"";for(let i=0;i{var e;return S(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==R&&w(this._$AH)?this._$AA.nextSibling.data=t:this.k(b.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=I.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(i);else{const t=new D(o,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new I(t)),e}S(t){S(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new j(this.A(A()),this.A(A()),this,this.options)):i=e[s],i._$AI(o),s++;s2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(void 0===o)t=z(this,t,e,0),n=!w(t)||t!==this._$AH&&t!==M,n&&(this._$AH=t);else{const s=t;let r,a;for(t=o[0],r=0;r{var s,o;const n=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let r=n._$litPart$;if(void 0===r){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;n._$litPart$=r=new j(e.insertBefore(A(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return M}}Q.finalized=!0,Q._$litElement$=!0,null===(F=globalThis.litElementHydrateSupport)||void 0===F||F.call(globalThis,{LitElement:Q});const X=globalThis.litElementPolyfillSupport;null==X||X({LitElement:Q}),(null!==(G=globalThis.litElementVersions)&&void 0!==G?G:globalThis.litElementVersions=[]).push("3.2.0");const Y=(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)}};function tt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):Y(t,e)}var et;null===(et=window.HTMLSlotElement)||void 0===et||et.prototype.assignedElements;const it="lovelace-player-device-id";function st(){if(!localStorage[it]){const t=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);window.fully&&"function"==typeof fully.getDeviceId?localStorage[it]=fully.getDeviceId():localStorage[it]=`${t()}${t()}-${t()}${t()}`}return localStorage[it]}let ot=st();const nt=new URLSearchParams(window.location.search);var rt;function at(){return document.querySelector("hc-main")?document.querySelector("hc-main").hass:document.querySelector("home-assistant")?document.querySelector("home-assistant").hass:void 0}function lt(t){return!!String(t).includes("{%")||(!!String(t).includes("{{")||void 0)}nt.get("deviceID")&&null!==(rt=nt.get("deviceID"))&&("clear"===rt?localStorage.removeItem(it):localStorage[it]=rt,ot=st()),window.cardMod_template_cache=window.cardMod_template_cache||{};const ht=window.cardMod_template_cache;async function dt(t,e,i){const s=at().connection,o=JSON.stringify([e,i]);let n=ht[o];n?(n.callbacks.has(t)||ct(t),t(n.value),n.callbacks.add(t)):(ct(t),t(""),i=Object.assign({user:at().user.name,browser:ot,hash:location.hash.substr(1)||""},i),ht[o]=n={template:e,variables:i,value:"",callbacks:new Set([t]),unsubscribe:s.subscribeMessage((t=>function(t,e){const i=ht[t];i&&(i.value=e.result,i.callbacks.forEach((t=>t(e.result))))}(o,t)),{type:"render_template",template:e,variables:i})})}async function ct(t){let e;for(const[i,s]of Object.entries(ht))if(s.callbacks.has(t)){s.callbacks.delete(t),0==s.callbacks.size&&(e=s.unsubscribe,delete ht[i]);break}e&&await(await e)()}var ut="1.9.3";class pt extends Q{constructor(){super(...arguments),this.cardsInitialized=!1,this.templateRenderer=t=>{this._tmpl=t}}async setConfig(t){if(window.deviceID=ot,this._config=t,this.state=void 0,this.classList.add("no-match"),this.cards={},this.buildCards(),"hash"===t.entity&&(window.addEventListener("location-changed",(()=>this.updated(new Map))),window.addEventListener("hashchange",(()=>this.updated(new Map)))),"mediaquery"===t.entity)for(const e in t.states){window.matchMedia(e).addEventListener("change",(()=>this.update_state()))}if("template"===t.entity||lt(t.entity)){const e=lt(t.entity)?t.entity:t.template;dt(this.templateRenderer,e,{config:t})}this.style.setProperty("display","none")}connectedCallback(){if(super.connectedCallback(),this._config){for(const t in this.cards)this.cards[t].hass=this._hass;("template"===this._config.entity||lt(this._config.entity))&&dt(this.templateRenderer,lt(this._config.entity)?this._config.entity:this._config.template,{config:this._config})}}disconnectedCallback(){super.disconnectedCallback(),ct(this.templateRenderer)}async buildCards(){const t=await window.loadCardHelpers();for(let e in this._config.states)this.cards[e]=await t.createCardElement(this._config.states[e]),this.cards[e].hass=this._hass;this.cardsInitialized=!0,this.update_state(),this._updateVisibility()}update_state(){var t,e,i,s,o,n;if(!this.cardsInitialized)return;let r;switch(this._config.entity){case"template":r=this._tmpl;break;case"user":r=null===(e=null===(t=this._hass)||void 0===t?void 0:t.user)||void 0===e?void 0:e.name;break;case"group":r=(null===(s=null===(i=this._hass)||void 0===i?void 0:i.user)||void 0===s?void 0:s.is_admin)?"admin":"user";break;case"deviceID":case"browser":r=ot;break;case"hash":r=location.hash.substring(1);break;case"mediaquery":for(const t in this.cards)if(window.matchMedia(t).matches){r=t;break}break;default:r=lt(this._config.entity)?this._tmpl:null===(n=null===(o=this._hass)||void 0===o?void 0:o.states[this._config.entity])||void 0===n?void 0:n.state}void 0!==r&&this.cards.hasOwnProperty(r)||(r=this._config.default),this.state=r}set hass(t){this._hass=t;for(const e in this.cards)this.cards[e].hass=t}_updateVisibility(){this.cards[this.state]?(this.classList.remove("no-match"),this.style.setProperty("display",""),this.removeAttribute("hidden")):(this.classList.add("no-match"),this.style.setProperty("display","none"),this.setAttribute("hidden",""))}updated(t){if(t.has("state")){const e=t.get("state");this.cards[e]&&(this.cards[e].classList.remove("visible"),this._config.transition&&(this.shadowRoot.querySelector("#root").classList.add("transition"),this.cards[e].classList.add("out"),window.setTimeout((()=>{this.cards[e].classList.remove("out"),window.setTimeout((()=>{this.shadowRoot.querySelector("#root").classList.remove("transition")}),this._config.transition_time||500)}),this._config.transition_time||500))),this.cards[this.state]&&this.cards[this.state].classList.add("visible"),this._updateVisibility()}else this.update_state()}render(){return H` +function t(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}const e=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new Map;class o{constructor(t,e){if(this._$cssResult$=!0,e!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=s.get(this.cssText);return e&&void 0===t&&(s.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const n=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,i,s)=>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[s+1]),t[0]);return new o(s,i)},r=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",i))(e)})(t):t;var a;const l=window.trustedTypes,h=l?l.emptyScript:"",d=window.reactiveElementPolyfillSupport,c={toAttribute(t,e){switch(e){case Boolean:t=t?h: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}},u=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:c,reflect:!1,hasChanged:u};class v extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Eh(i,e);void 0!==s&&(this._$Eu.set(s,i),t.push(s))})),t}static createProperty(t,e=p){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,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=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(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).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._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{e?t.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||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._$Eg)||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)}_$ES(t,e,i=p){var s,o;const n=this.constructor._$Eh(t,i);if(void 0!==n&&!0===i.reflect){const r=(null!==(o=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==o?o:c.toAttribute)(e,i.type);this._$Ei=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Ei=null}}_$AK(t,e){var i,s,o;const n=this.constructor,r=n._$Eu.get(t);if(void 0!==r&&this._$Ei!==r){const t=n.getPropertyOptions(r),a=t.converter,l=null!==(o=null!==(s=null===(i=a)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof a?a:null)&&void 0!==o?o:c.fromAttribute;this._$Ei=r,this[r]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}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._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||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._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||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)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}var f;v.finalized=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:v}),(null!==(a=globalThis.reactiveElementVersions)&&void 0!==a?a:globalThis.reactiveElementVersions=[]).push("1.3.2");const _=globalThis.trustedTypes,m=_?_.createPolicy("lit-html",{createHTML:t=>t}):void 0,g=`lit$${(Math.random()+"").slice(9)}$`,$="?"+g,y=`<${$}>`,b=document,w=(t="")=>b.createComment(t),A=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,E=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,x=/>/g,P=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,k=/'/g,U=/"/g,T=/^(?:script|style|textarea|title)$/i,M=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),H=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),O=new WeakMap,N=b.createTreeWalker(b,129,null,!1),L=(t,e)=>{const i=t.length-1,s=[];let o,n=2===e?"":"",r=E;for(let e=0;e"===l[0]?(r=null!=o?o:E,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?P:'"'===l[3]?U:k):r===U||r===k?r=P:r===C||r===x?r=E:(r=P,o=void 0);const c=r===P&&t[e+1].startsWith("/>")?" ":"";n+=r===E?i+y:h>=0?(s.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+g+c):i+g+(-2===h?(s.push(void 0),e):c)}const a=n+(t[i]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==m?m.createHTML(a):a,s]};class I{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const r=t.length-1,a=this.parts,[l,h]=L(t,e);if(this.el=I.createElement(l,i),N.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=N.nextNode())&&a.length0){s.textContent=_?_.emptyScript:"";for(let i=0;i{var e;return S(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==R&&A(this._$AH)?this._$AA.nextSibling.data=t:this.k(b.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=I.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(i);else{const t=new D(o,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new I(t)),e}S(t){S(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new j(this.M(w()),this.M(w()),this,this.options)):i=e[s],i._$AI(o),s++;s2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(void 0===o)t=z(this,t,e,0),n=!A(t)||t!==this._$AH&&t!==H,n&&(this._$AH=t);else{const s=t;let r,a;for(t=o[0],r=0;r{var s,o;const n=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let r=n._$litPart$;if(void 0===r){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;n._$litPart$=r=new j(e.insertBefore(w(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return H}}Q.finalized=!0,Q._$litElement$=!0,null===(F=globalThis.litElementHydrateSupport)||void 0===F||F.call(globalThis,{LitElement:Q});const X=globalThis.litElementPolyfillSupport;null==X||X({LitElement:Q}),(null!==(G=globalThis.litElementVersions)&&void 0!==G?G:globalThis.litElementVersions=[]).push("3.2.0");const Y=(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)}};function tt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):Y(t,e)}var et;null===(et=window.HTMLSlotElement)||void 0===et||et.prototype.assignedElements;const it="lovelace-player-device-id";function st(){if(!localStorage[it]){const t=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);window.fully&&"function"==typeof fully.getDeviceId?localStorage[it]=fully.getDeviceId():localStorage[it]=`${t()}${t()}-${t()}${t()}`}return localStorage[it]}let ot=st();const nt=new URLSearchParams(window.location.search);var rt;function at(){return document.querySelector("hc-main")?document.querySelector("hc-main").hass:document.querySelector("home-assistant")?document.querySelector("home-assistant").hass:void 0}function lt(t){return!!String(t).includes("{%")||(!!String(t).includes("{{")||void 0)}nt.get("deviceID")&&null!==(rt=nt.get("deviceID"))&&("clear"===rt?localStorage.removeItem(it):localStorage[it]=rt,ot=st()),window.cardMod_template_cache=window.cardMod_template_cache||{};const ht=window.cardMod_template_cache;async function dt(t,e,i){const s=at().connection,o=JSON.stringify([e,i]);let n=ht[o];n?(n.callbacks.has(t)||ct(t),t(n.value),n.callbacks.add(t)):(ct(t),t(""),i=Object.assign({user:at().user.name,browser:ot,hash:location.hash.substr(1)||""},i),ht[o]=n={template:e,variables:i,value:"",callbacks:new Set([t]),unsubscribe:s.subscribeMessage((t=>function(t,e){const i=ht[t];i&&(i.value=e.result,i.callbacks.forEach((t=>t(e.result))))}(o,t)),{type:"render_template",template:e,variables:i})})}async function ct(t){let e;for(const[i,s]of Object.entries(ht))if(s.callbacks.has(t)){s.callbacks.delete(t),0==s.callbacks.size&&(e=s.unsubscribe,delete ht[i]);break}e&&await(await e)()}var ut="1.9.5";class pt extends Q{constructor(){super(...arguments),this.cardsInitialized=!1,this.templateRenderer=t=>{this._tmpl=t}}async setConfig(t){if(window.deviceID=ot,this._config=t,this.state=void 0,this.classList.add("no-match"),this.cards={},this.buildCards(),"hash"===t.entity&&(window.addEventListener("location-changed",(()=>this.updated(new Map))),window.addEventListener("hashchange",(()=>this.updated(new Map)))),"mediaquery"===t.entity)for(const e in t.states){window.matchMedia(e).addEventListener("change",(()=>this.update_state()))}if("template"===t.entity||lt(t.entity)){const e=lt(t.entity)?t.entity:t.template;dt(this.templateRenderer,e,{config:t})}this.style.setProperty("display","none")}connectedCallback(){if(super.connectedCallback(),this._config){for(const t in this.cards)this.cards[t].hass=this._hass;("template"===this._config.entity||lt(this._config.entity))&&dt(this.templateRenderer,lt(this._config.entity)?this._config.entity:this._config.template,{config:this._config})}}disconnectedCallback(){super.disconnectedCallback(),ct(this.templateRenderer)}async buildCards(){const t=await window.loadCardHelpers();for(let e in this._config.states)this.cards[e]=await t.createCardElement(this._config.states[e]),this.cards[e].hass=this._hass;this.cardsInitialized=!0,this.update_state(),this._updateVisibility()}update_state(){var t,e,i,s,o,n;if(!this.cardsInitialized)return;let r;switch(this._config.entity){case"template":r=this._tmpl;break;case"user":r=null===(e=null===(t=this._hass)||void 0===t?void 0:t.user)||void 0===e?void 0:e.name;break;case"group":r=(null===(s=null===(i=this._hass)||void 0===i?void 0:i.user)||void 0===s?void 0:s.is_admin)?"admin":"user";break;case"deviceID":case"browser":r=ot;break;case"hash":r=location.hash.substring(1);break;case"mediaquery":for(const t in this.cards)if(window.matchMedia(t).matches){r=t;break}break;default:r=lt(this._config.entity)?this._tmpl:null===(n=null===(o=this._hass)||void 0===o?void 0:o.states[this._config.entity])||void 0===n?void 0:n.state}void 0!==r&&this.cards.hasOwnProperty(r)||(r=this._config.default),this.state=r}set hass(t){this._hass=t;for(const e in this.cards)this.cards[e].hass=t}_updateVisibility(){this.cards[this.state]?(this.classList.remove("no-match"),this.style.setProperty("display",""),this.removeAttribute("hidden")):(this.classList.add("no-match"),this.style.setProperty("display","none"),this.setAttribute("hidden",""))}updated(t){if(t.has("state")){const e=t.get("state");this.cards[e]&&(this.cards[e].parentElement.classList.remove("visible"),this._config.transition&&(this.shadowRoot.querySelector("#root").classList.add("transition"),this.cards[e].parentElement.classList.add("out"),window.setTimeout((()=>{this.cards[e].parentElement.classList.remove("out"),window.setTimeout((()=>{this.shadowRoot.querySelector("#root").classList.remove("transition")}),this._config.transition_time||500)}),this._config.transition_time||500))),this.cards[this.state]&&this.cards[this.state].parentElement.classList.add("visible"),this._updateVisibility()}else this.update_state()}render(){return M`
- ${Object.keys(this.cards).map((t=>H` ${this.cards[t]} `))} + ${Object.keys(this.cards).map((t=>M`
${this.cards[t]}
`))}
`}async getCardSize(){var t;let e=1;for(const i in this.cards)(null===(t=this.cards[i])||void 0===t?void 0:t.getCardSize)&&(e=Math.max(e,await this.cards[i].getCardSize()));return e}static get styles(){return n` :host { diff --git a/custom_components/ui_lovelace_minimalist/cards/mini-graph-card/mini-graph-card.js b/custom_components/ui_lovelace_minimalist/cards/mini-graph-card/mini-graph-card.js index cd1a94592..4d613db8b 100644 --- a/custom_components/ui_lovelace_minimalist/cards/mini-graph-card/mini-graph-card.js +++ b/custom_components/ui_lovelace_minimalist/cards/mini-graph-card/mini-graph-card.js @@ -1 +1 @@ -(function(){"use strict";function a(){var b=M([""]);return a=function(){return b},b}function b(){var a=M(["\n
\n ","\n \n "," ","\n \n \n ","\n \n
\n "]);return b=function(){return a},a}function c(){var a=M(["\n
\n ","\n
\n "]);return c=function(){return a},a}function d(){var a=M(["\n
\n ","\n ","\n
\n "]);return d=function(){return a},a}function e(){var a=M(["\n
\n ","\n ","\n
\n "]);return e=function(){return a},a}function f(){var a=M(["\n \n \n \n ","\n \n ","\n ","\n ","\n ","\n ","\n \n ","\n "]);return f=function(){return a},a}function g(){var a=M(["",""]);return g=function(){return a},a}function h(){var a=M(["\n \n ","\n "]);return h=function(){return a},a}function j(){var a=M(["\n \n "]);return j=function(){return a},a}function k(){var a=M(["\n "]);return k=function(){return a},a}function l(){var a=M(["\n "]);return l=function(){return a},a}function m(){var a=M(["",""]);return m=function(){return a},a}function n(){var a=M(["\n \n "]);return n=function(){return a},a}function o(){var a=M(["\n \n ","\n "]);return o=function(){return a},a}function p(){var a=M(["\n \n ","\n "]);return p=function(){return a},a}function q(){var a=M(["\n \n "]);return q=function(){return a},a}function r(){var a=M(["\n \n ","\n \n "]);return r=function(){return a},a}function s(){var a=M(["\n "]);return s=function(){return a},a}function t(){var a=M(["\n \n \n \n \n \n \n \n \n \n \n \n "]);return t=function(){return a},a}function u(){var a=M(["\n \n \n \n "]);return u=function(){return a},a}function v(){var a=M(["\n
\n ","\n ","\n
\n "]);return v=function(){return a},a}function w(){var a=M(["\n
\n ","\n
\n "]);return w=function(){return a},a}function x(){var a=M(["\n
\n
\n ","\n ","\n
\n ","\n
\n
\n ","\n
"]);return x=function(){return a},a}function y(){var a=M(["\n "," -\n ","\n "]);return y=function(){return a},a}function z(){var a=M(["\n ","\n "]);return z=function(){return a},a}function A(){var a=M(["\n
\n ","\n
\n "]);return A=function(){return a},a}function B(){var a=M(["\n \n ","\n \n ","\n \n \n ","\n \n ","\n
\n "]);return B=function(){return a},a}function C(){var a=M(["\n
\n ","\n
","
\n ","\n
\n "]);return C=function(){return a},a}function D(){var a=M(["\n
\n ","\n
\n "]);return D=function(){return a},a}function E(){var a=M(["\n
\n \n
\n "]);return E=function(){return a},a}function F(){var a=M(["\n
\n "," ","\n
\n "]);return F=function(){return a},a}function G(){var a=M([""]);return G=function(){return a},a}function H(){var a=M(["\n
\n Entity not available: ","\n
\n "]);return H=function(){return a},a}function I(){var a=M(["\n \n
mini-graph-card
\n ","\n
\n "]);return I=function(){return a},a}function J(){var a=M(["\n \n "," "," "," ","\n \n "]);return J=function(){return a},a}function K(){var a=M([""]);return K=function(){return a},a}function L(){var a=M(["\n :host {\n display: flex;\n flex-direction: column;\n }\n ha-card {\n flex-direction: column;\n flex: 1;\n padding: 16px 0;\n position: relative;\n overflow: hidden;\n }\n ha-card > div {\n padding: 0px 16px 16px 16px;\n }\n ha-card > div:last-child {\n padding-bottom: 0;\n }\n ha-card[points] .line--points,\n ha-card[labels] .graph__labels.--primary {\n opacity: 0;\n transition: opacity .25s;\n animation: none;\n }\n ha-card[labels-secondary] .graph__labels.--secondary {\n opacity: 0;\n transition: opacity .25s;\n animation: none;\n }\n ha-card[points]:hover .line--points,\n ha-card:hover .graph__labels.--primary,\n ha-card:hover .graph__labels.--secondary {\n opacity: 1;\n }\n ha-card[fill] {\n padding-bottom: 0;\n }\n ha-card[fill] .graph {\n padding: 0;\n order: 10;\n }\n ha-card[fill] path {\n stroke-linecap: initial;\n stroke-linejoin: initial;\n }\n ha-card[fill] .graph__legend {\n order: -1;\n padding: 0 16px 8px 16px;\n }\n ha-card[fill] .info {\n padding-bottom: 16px;\n }\n ha-card[group] {\n box-shadow: none;\n padding: 0;\n }\n ha-card[group] > div {\n padding-left: 0;\n padding-right: 0;\n }\n ha-card[group] .graph__legend {\n padding-left: 0;\n padding-right: 0;\n }\n ha-card[hover] {\n cursor: pointer;\n }\n .flex {\n display: flex;\n display: -webkit-flex;\n min-width: 0;\n }\n .header {\n justify-content: space-between;\n }\n .header[loc=\"center\"] {\n justify-content: space-around;\n }\n .header[loc=\"left\"] {\n align-self: flex-start;\n }\n .header[loc=\"right\"] {\n align-self: flex-end;\n }\n .name {\n align-items: center;\n min-width: 0;\n letter-spacing: var(--mcg-title-letter-spacing, normal);\n }\n .name > span {\n font-size: 1.2em;\n font-weight: var(--mcg-title-font-weight, 500);\n max-height: 1.4em;\n min-height: 1.4em;\n opacity: .65;\n }\n .icon {\n color: var(--paper-item-icon-color, #44739e);\n display: inline-block;\n flex: 0 0 1.7em;\n text-align: center;\n }\n .icon > ha-icon {\n height: 1.7em;\n width: 1.7em;\n }\n .icon[loc=\"left\"] {\n order: -1;\n margin-right: .6em;\n margin-left: 0;\n }\n .icon[loc=\"state\"] {\n align-self: center;\n }\n .states {\n align-items: flex-start;\n font-weight: 300;\n justify-content: space-between;\n flex-wrap: nowrap;\n }\n .states .icon {\n align-self: center;\n margin-left: 0;\n }\n .states[loc=\"center\"] {\n justify-content: space-evenly;\n }\n .states[loc=\"right\"] > .state {\n margin-left: auto;\n order: 2;\n }\n .states[loc=\"center\"] .states--secondary,\n .states[loc=\"right\"] .states--secondary {\n margin-left: 0;\n }\n .states[loc=\"center\"] .states--secondary {\n align-items: center;\n }\n .states[loc=\"right\"] .states--secondary {\n align-items: flex-start;\n }\n .states[loc=\"center\"] .state__time {\n left: 50%;\n transform: translateX(-50%);\n }\n .states > .icon > ha-icon {\n height: 2em !important;\n width: 2em !important;\n }\n .states--secondary {\n display: flex;\n flex-flow: column;\n flex-wrap: wrap;\n align-items: flex-end;\n margin-left: 1rem;\n min-width: 0;\n margin-left: 1.4em;\n }\n .states--secondary:empty {\n display: none;\n }\n .state {\n position: relative;\n display: flex;\n flex-wrap: nowrap;\n max-width: 100%;\n min-width: 0;\n }\n .state--small {\n font-size: .6em;\n margin-bottom: .6rem;\n flex-wrap: nowrap;\n }\n .state--small > svg {\n position: absolute;\n left: -1.6em;\n align-self: center;\n height: 1em;\n width: 1em;\n border-radius: 100%;\n margin-right: 1em;\n }\n .state--small:last-child {\n margin-bottom: 0;\n }\n .states--secondary > :only-child {\n font-size: 1em;\n margin-bottom: 0;\n }\n .states--secondary > :only-child svg {\n display: none;\n }\n .state__value {\n display: inline-block;\n font-size: 2.4em;\n margin-right: .25rem;\n line-height: 1.2em;\n }\n .state__uom {\n flex: 1;\n align-self: flex-end;\n display: inline-block;\n font-size: 1.4em;\n font-weight: 400;\n line-height: 1.6em;\n margin-top: .1em;\n opacity: .6;\n vertical-align: bottom;\n }\n .state--small .state__uom {\n flex: 1;\n }\n .state__time {\n font-size: .95rem;\n font-weight: 500;\n bottom: -1.1rem;\n left: 0;\n opacity: .75;\n position: absolute;\n white-space: nowrap;\n animation: fade .15s cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n .states[loc=\"right\"] .state__time {\n left: initial;\n right: 0;\n }\n .graph {\n align-self: flex-end;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n margin-top: auto;\n width: 100%;\n }\n .graph__container {\n display: flex;\n flex-direction: row;\n position: relative;\n }\n .graph__container__svg {\n cursor: default;\n flex: 1;\n }\n svg {\n overflow: hidden;\n display: block;\n }\n path {\n stroke-linecap: round;\n stroke-linejoin: round;\n }\n .fill[anim=\"false\"] {\n animation: reveal .25s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .fill[anim=\"false\"][type=\"fade\"] {\n animation: reveal-2 .25s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .line--points[anim=\"false\"],\n .line[anim=\"false\"] {\n animation: pop .25s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .line--points[inactive],\n .line--rect[inactive],\n .fill--rect[inactive] {\n opacity: 0 !important;\n animation: none !important;\n transition: all .15s !important;\n }\n .line--points[tooltip] .line--point[inactive] {\n opacity: 0;\n }\n .line--point {\n cursor: pointer;\n fill: var(--primary-background-color, white);\n stroke-width: inherit;\n }\n .line--point:hover {\n fill: var(--mcg-hover, inherit) !important;\n }\n .bars {\n animation: pop .25s cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n .bars[anim] {\n animation: bars .5s cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n .bar {\n transition: opacity .25s cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n .bar:hover {\n opacity: .5;\n cursor: pointer;\n }\n ha-card[gradient] .line--point:hover {\n fill: var(--primary-text-color, white);\n }\n path,\n .line--points,\n .fill {\n opacity: 0;\n }\n .line--points[anim=\"true\"][init] {\n animation: pop .5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .fill[anim=\"true\"][init] {\n animation: reveal .5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .fill[anim=\"true\"][init][type=\"fade\"] {\n animation: reveal-2 .5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .line[anim=\"true\"][init] {\n animation: dash 1s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .graph__labels.--secondary {\n right: 0;\n margin-right: 0px;\n }\n .graph__labels {\n align-items: flex-start;\n flex-direction: column;\n font-size: calc(.15em + 8.5px);\n font-weight: 400;\n justify-content: space-between;\n margin-right: 10px;\n padding: .6em;\n position: absolute;\n pointer-events: none;\n top: 0; bottom: 0;\n opacity: .75;\n }\n .graph__labels > span {\n cursor: pointer;\n background: var(--primary-background-color, white);\n border-radius: 1em;\n padding: .2em .6em;\n box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);\n }\n .graph__legend {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n padding-top: 16px;\n flex-wrap: wrap;\n }\n .graph__legend__item {\n cursor: pointer;\n display: flex;\n min-width: 0;\n margin: .4em;\n align-items: center\n }\n .graph__legend__item span {\n opacity: .75;\n margin-left: .4em;\n }\n .graph__legend__item svg {\n border-radius: 100%;\n min-width: 10px;\n }\n .info {\n justify-content: space-between;\n align-items: middle;\n }\n .info__item {\n display: flex;\n flex-flow: column;\n text-align: center;\n }\n .info__item:last-child {\n align-items: flex-end;\n text-align: right;\n }\n .info__item:first-child {\n align-items: flex-start;\n text-align: left;\n }\n .info__item__type {\n text-transform: capitalize;\n font-weight: 500;\n opacity: .9;\n }\n .info__item__time,\n .info__item__value {\n opacity: .75;\n }\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n @keyframes fade {\n 0% { opacity: 0; }\n }\n @keyframes reveal {\n 0% { opacity: 0; }\n 100% { opacity: .15; }\n }\n @keyframes reveal-2 {\n 0% { opacity: 0; }\n 100% { opacity: .4; }\n }\n @keyframes pop {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n @keyframes bars {\n 0% { opacity: 0; }\n 50% { opacity: 0; }\n 100% { opacity: 1; }\n }\n @keyframes dash {\n 0% {\n opacity: 0;\n }\n 25% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n stroke-dashoffset: 0;\n }\n }"]);return L=function(){return a},a}function M(a,b){return b||(b=a.slice(0)),Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(b)}}))}function N(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function O(a){for(var b,c=1;ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.parentNode.removeChild(a))}function M(a,b){var c=2=b.oldVersion&&c.createObjectStore("local-forage-detect-blob-support")}catch(c){if("ConstraintError"===c.name)console.warn("The database \""+a.name+"\" has been upgraded from version "+b.oldVersion+" to version "+b.newVersion+", but the storage \""+a.storeName+"\" already exists.");else throw c}}),f.onerror=function(a){a.preventDefault(),d(f.error)},f.onsuccess=function(){c(f.result),ea(a)}})}function ha(a){return ga(a,!1)}function ia(a){return ga(a,!0)}function ja(a,b){if(!a.db)return!0;var c=!a.db.objectStoreNames.contains(a.storeName),d=a.versiona.db.version;if(d&&(a.version!==b&&console.warn("The database \""+a.name+"\" can't be downgraded from version "+a.db.version+" to version "+a.version+"."),a.version=a.db.version),e||c){if(c){var f=a.db.version+1;f>a.version&&(a.version=f)}return!0}return!1}function ka(a){return new ec(function(b,c){var d=new FileReader;d.onerror=c,d.onloadend=function(c){var d=btoa(c.target.result||"");b({__local_forage_encoded_blob:!0,data:d,type:a.type})},d.readAsBinaryString(a)})}function la(a){var b=aa(atob(a.data));return U([b],{type:a.type})}function ma(a){return a&&a.__local_forage_encoded_blob}function na(a){var b=this,c=b._initReady().then(function(){var a=fc[b._dbInfo.name];if(a&&a.dbReady)return a.dbReady});return Z(c,a,a),c}function oa(a){da(a);for(var b,c=fc[a.name],d=c.forages,e=0;e(a.db=b,ja(a)?ia(a):b)).then(b=>{a.db=c.db=b;for(var e=0;e{throw fa(a,b),b})}function pa(a,b,c,d){d===void 0&&(d=1);try{var e=a.db.transaction(a.storeName,b);c(null,e)}catch(e){if(0{if(!a.db||"NotFoundError"===e.name&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),ia(a)}).then(()=>oa(a).then(function(){pa(a,b,c,d-1)})).catch(c);c(e)}}function qa(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ra(a){var b,c,d,e,f,g=.75*a.length,h=a.length,j=0;"="===a[a.length-1]&&(g--,"="===a[a.length-2]&&g--);var k=new ArrayBuffer(g),l=new Uint8Array(k);for(b=0;b>4,l[j++]=(15&d)<<4|e>>2,l[j++]=(3&e)<<6|63&f;return k}function sa(a){var b,c=new Uint8Array(a),d="";for(b=0;b>2],d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&c[b])<<4|c[b+1]>>4],d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&c[b+1])<<2|c[b+2]>>6],d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&c[b+2]];return 2==c.length%3?d=d.substring(0,d.length-1)+"=":1==c.length%3&&(d=d.substring(0,d.length-2)+"=="),d}function ta(a,b,c,d){a.executeSql("CREATE TABLE IF NOT EXISTS ".concat(b.storeName," ")+"(id INTEGER PRIMARY KEY, key unique, value)",[],c,d)}function ua(a,b,c,d,e,f){a.executeSql(c,d,e,function(a,g){g.code===g.SYNTAX_ERR?a.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[b.storeName],function(a,h){h.rows.length?f(a,g):ta(a,b,function(){a.executeSql(c,d,e,f)},f)},f):f(a,g)},f)}function va(a,b,c,d){var e=this;a=$(a);var f=new ec(function(f,g){e.ready().then(function(){void 0===b&&(b=null);var h=b,i=e._dbInfo;i.serializer.serialize(b,function(b,j){j?g(j):i.db.transaction(function(c){ua(c,i,"INSERT OR REPLACE INTO ".concat(i.storeName," ")+"(key, value) VALUES (?, ?)",[a,b],function(){f(h)},function(a,b){g(b)})},function(b){if(b.code===b.QUOTA_ERR){if(0 '__WebKitDatabaseInfoTable__'",[],function(c,d){for(var e=[],f=0;f"),Xa=new RegExp("".concat(Va,"|").concat(Wa)),Ya="$lit$";class Za{constructor(a,b){this.parts=[],this.element=b;for(var c,d=[],e=[],f=document.createTreeWalker(b.content,133,null,!1),g=0,h=-1,j=0,{strings:k,values:{length:l}}=a;j{var c=a.length-b.length;return 0<=c&&a.slice(c)===b},ab=a=>-1!==a.index,bb=()=>document.createComment(""),cb=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,db=a=>{for(var b=11===a.nodeType?0:1,c=document.createTreeWalker(a,133,null,!1);c.nextNode();)b++;return b},eb=function(a){for(var b,c=1"function"==typeof a&&fb.has(a),hb={},ib={};class jb{constructor(a,b,c){this.__parts=[],this.template=a,this.processor=b,this.options=c}update(a){var b=0;for(var c of this.__parts)void 0!==c&&c.setValue(a[b]),b++;for(var d of this.__parts)void 0!==d&&d.commit()}_clone(){for(var a,b=Sa?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),c=[],d=this.template.parts,e=document.createTreeWalker(b,133,null,!1),f=0,g=0,h=e.nextNode();fa}),lb=" ".concat(Va," ");class mb{constructor(a,b,c,d){this.strings=a,this.values=b,this.type=c,this.processor=d}getHTML(){for(var a=this.strings.length-1,b="",c=!1,d=0;d",f+1);var g=cb.exec(e);b+=null===g?e+(c?lb:Wa):e.substr(0,g.index)+g[1]+g[2]+Ya+g[3]+Va}return b+=this.strings[a],b}getTemplateElement(){var a=document.createElement("template"),b=this.getHTML();return void 0!==kb&&(b=kb.createHTML(b)),a.innerHTML=b,a}}class nb extends mb{getHTML(){return"".concat(super.getHTML(),"")}getTemplateElement(){var a=super.getTemplateElement(),b=a.content,c=b.firstChild;return b.removeChild(c),Ta(b,c.firstChild),a}}var ob=a=>null===a||"object"!=typeof a&&"function"!=typeof a,pb=a=>Array.isArray(a)||!!(a&&a[Symbol.iterator]);class qb{constructor(a,b,c){this.dirty=!0,this.element=a,this.name=b,this.strings=c,this.parts=[];for(var d=0;d{try{var a={get capture(){return wb=!0,!1}};window.addEventListener("test",a,a),window.removeEventListener("test",a,a)}catch(a){}})();class xb{constructor(a,b,c){this.value=void 0,this.__pendingValue=void 0,this.element=a,this.eventName=b,this.eventContext=c,this.__boundHandleEvent=a=>this.handleEvent(a)}setValue(a){this.__pendingValue=a}commit(){for(;gb(this.__pendingValue);){var d=this.__pendingValue;this.__pendingValue=hb,d(this)}if(this.__pendingValue!==hb){var a=this.__pendingValue,b=this.value,c=null==a||null!=b&&(a.capture!==b.capture||a.once!==b.once||a.passive!==b.passive);c&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),null!=a&&(null==b||c)&&(this.__options=yb(a),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=a,this.__pendingValue=hb}}handleEvent(a){"function"==typeof this.value?this.value.call(this.eventContext||this.element,a):this.value.handleEvent(a)}}var yb=a=>a&&(wb?{capture:a.capture,passive:a.passive,once:a.once}:a.capture),zb=new Map,Ab=new WeakMap,Bb=(a,b,c)=>{var d=Ab.get(b);d===void 0&&(Ua(b,b.firstChild),Ab.set(b,d=new sb(Object.assign({templateFactory:T},c))),d.appendInto(b)),d.setValue(a),d.commit()};var Cb=new class a{handleAttributeExpressions(a,b,c,d){var e=b[0];if("."===e){var g=new ub(a,b.slice(1),c);return g.parts}if("@"===e)return[new xb(a,b.slice(1),d.eventContext)];if("?"===e)return[new tb(a,b.slice(1),c)];var f=new qb(a,b,c);return f.parts}handleTextExpression(a){return new sb(a)}};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");var Db=function(a){for(var b=arguments.length,c=Array(1"".concat(a,"--").concat(b),Gb=!0;"undefined"==typeof window.ShadyCSS?Gb=!1:"undefined"==typeof window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),Gb=!1);var Hb,Ib=a=>b=>{var c=Fb(b.type,a),d=zb.get(c);void 0===d&&(d={stringsArray:new WeakMap,keyString:new Map},zb.set(c,d));var e=d.stringsArray.get(b.strings);if(void 0!==e)return e;var f=b.strings.join(Va);if(e=d.keyString.get(f),void 0===e){var g=b.getTemplateElement();Gb&&window.ShadyCSS.prepareTemplateDom(g,a),e=new Za(b,g),d.keyString.set(f,e)}return d.stringsArray.set(b.strings,e),e},Jb=["html","svg"],Kb=a=>{Jb.forEach(b=>{var c=zb.get(Fb(b,a));c!==void 0&&c.keyString.forEach(a=>{var{element:{content:b}}=a,c=new Set;Array.from(b.querySelectorAll("style")).forEach(a=>{c.add(a)}),i(a,c)})})},Lb=new Set,Mb=(a,b,c)=>{Lb.add(a);var d=!c?document.createElement("template"):c.element,e=b.querySelectorAll("style"),{length:f}=e;if(0===f)return void window.ShadyCSS.prepareTemplateStyles(d,a);for(var g,h=document.createElement("style"),j=0;j{if(!c||"object"!=typeof c||!c.scopeName)throw new Error("The `scopeName` option is required.");var d=c.scopeName,e=Ab.has(b),f=Gb&&11===b.nodeType&&!!b.host,g=f&&!Lb.has(d),h=g?document.createDocumentFragment():b;if(Bb(a,h,Object.assign({templateFactory:Ib(d)},c)),g){var i=Ab.get(h);Ab.delete(h);var j=i.value instanceof jb?i.value.template:void 0;Mb(d,h,j),Ua(b,b.firstChild),b.appendChild(h),Ab.set(b,i)}!e&&f&&window.ShadyCSS.styleElement(b.host)};window.JSCompiler_renameProperty=a=>a;var Ob={toAttribute(a,b){return b===Boolean?a?"":null:b===Object||b===Array?null==a?a:JSON.stringify(a):a},fromAttribute(a,b){return b===Boolean?null!==a:b===Number?null===a?null:+a:b===Object||b===Array?JSON.parse(a):a}},Pb=(a,b)=>b!==a&&(b===b||a===a),Qb={attribute:!0,type:String,converter:Ob,reflect:!1,hasChanged:Pb},Rb=1,Sb=4,Tb=8,Ub=16,Vb="finalized";class Wb extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();var a=[];return this._classProperties.forEach((b,c)=>{var d=this._attributeNameForProperty(c,b);void 0!==d&&(this._attributeToPropertyMap.set(d,c),a.push(d))}),a}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var a=Object.getPrototypeOf(this)._classProperties;a!==void 0&&a.forEach((a,b)=>this._classProperties.set(b,a))}}static createProperty(a){var b=1this._enableUpdatingResolver=a),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((a,b)=>{if(this.hasOwnProperty(b)){var c=this[b];delete this[b],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(b,c)}})}_applyInstanceProperties(){this._instanceProperties.forEach((a,b)=>this[b]=a),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){this._enableUpdatingResolver!==void 0&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(a,b,c){b!==c&&this._attributeToProperty(a,c)}_propertyToAttribute(a,b){var c=2this._propertyToAttribute(b,this[b],a)),this._reflectingProperties=void 0),this._markUpdated()}updated(){}firstUpdated(){}}Hb=Vb,Wb[Hb]=!0;var Xb=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yb=Symbol();class Zb{constructor(a,b){if(b!==Yb)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=a}get styleSheet(){return void 0===this._styleSheet&&(Xb?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}var $b=a=>new Zb(a+"",Yb),_b=a=>{if(a instanceof Zb)return a.cssText;if("number"==typeof a)return a;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(a,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))};(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");var ac={};class bc extends Wb{static getStyles(){return this.styles}static _getUniqueStyles(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_styles",this))){var a=this.getStyles();if(Array.isArray(a)){var b=(a,c)=>a.reduceRight((a,c)=>Array.isArray(c)?b(c,a):(a.add(c),a),c),c=b(a,new Set),d=[];c.forEach(a=>d.unshift(a)),this._styles=d}else this._styles=void 0===a?[]:[a];this._styles=this._styles.map(a=>{if(a instanceof CSSStyleSheet&&!Xb){var b=Array.prototype.slice.call(a.cssRules).reduce((a,b)=>a+b.cssText,"");return $b(b)}return a})}}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){var a=this.constructor._styles;0===a.length||(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow?Xb?this.renderRoot.adoptedStyleSheets=a.map(a=>a instanceof CSSStyleSheet?a:a.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(a.map(a=>a.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&window.ShadyCSS!==void 0&&window.ShadyCSS.styleElement(this)}update(a){var b=this.render();super.update(a),b!==ac&&this.constructor.render(b,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(a=>{var b=document.createElement("style");b.textContent=a.cssText,this.renderRoot.appendChild(b)}))}render(){return ac}}bc.finalized=!0,bc.render=Nb;var cc=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(a){}}();"undefined"==typeof Promise&&require("lie/polyfill");var dc,ec=Promise,fc={},gc=Object.prototype.toString,hc={_driver:"asyncStorage",_initStorage:function(a){function b(){return ec.resolve()}var c=this,d={db:null};if(a)for(var e in a)d[e]=a[e];var f=fc[d.name];f||(f=qa(),fc[d.name]=f),f.forages.push(c),c._initReady||(c._initReady=c.ready,c.ready=na);for(var g,h=[],i=0;ia?void b(null):void c.ready().then(function(){pa(c._dbInfo,"readonly",function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=!1,i=g.openKeyCursor();i.onsuccess=function(){var c=i.result;return c?void(0===a?b(c.key):h?b(c.key):(h=!0,c.advance(a))):void b(null)},i.onerror=function(){d(i.error)}}catch(a){d(a)}})}).catch(d)});return W(d,b),d},keys:function(a){var b=this,c=new ec(function(a,c){b.ready().then(function(){pa(b._dbInfo,"readonly",function(d,e){if(d)return c(d);try{var f=e.objectStore(b._dbInfo.storeName),g=f.openKeyCursor(),h=[];g.onsuccess=function(){var b=g.result;return b?void(h.push(b.key),b.continue()):void a(h)},g.onerror=function(){c(g.error)}}catch(a){c(a)}})}).catch(c)});return W(c,a),c},dropInstance:function(a,b){b=_.apply(this,arguments);var c=this.config();a="function"!=typeof a&&a||{},a.name||(a.name=a.name||c.name,a.storeName=a.storeName||c.storeName);var d,e=this;if(!a.name)d=ec.reject("Invalid arguments");else{var f=a.name===c.name&&e._dbInfo.db,g=f?ec.resolve(e._dbInfo.db):ha(a).then(b=>{var c=fc[a.name],d=c.forages;c.db=b;for(var e=0;e{if(b.objectStoreNames.contains(a.storeName)){var c=b.version+1;da(a);var d=fc[a.name],e=d.forages;b.close();for(var g,h=0;h{var e=cc.open(a.name,c);e.onerror=a=>{var b=e.result;b.close(),d(a)},e.onupgradeneeded=()=>{var b=e.result;b.deleteObjectStore(a.storeName)},e.onsuccess=()=>{var a=e.result;a.close(),b(a)}});return f.then(a=>{d.db=a;for(var b,c=0;c{throw(fa(a,b)||ec.resolve()).catch(()=>{}),b})}}):g.then(b=>{da(a);var c=fc[a.name],d=c.forages;b.close();for(var e,f=0;f{var d=cc.deleteDatabase(a.name);d.onerror=d.onblocked=a=>{var b=d.result;b&&b.close(),c(a)},d.onsuccess=()=>{var a=d.result;a&&a.close(),b(a)}});return g.then(a=>{c.db=a;for(var b,e=0;e{throw(fa(a,b)||ec.resolve()).catch(()=>{}),b})})}return W(d,b),d}},ic=/^~~local_forage_type~([^~]+)~/,jc="__lfsc__:".length,kc=jc+"arbf".length,lc=Object.prototype.toString,mc={serialize:function(a,b){var c="";if(a&&(c=lc.call(a)),a&&("[object ArrayBuffer]"===c||a.buffer&&"[object ArrayBuffer]"===lc.call(a.buffer))){var d,e="__lfsc__:";a instanceof ArrayBuffer?(d=a,e+="arbf"):(d=a.buffer,"[object Int8Array]"===c?e+="si08":"[object Uint8Array]"===c?e+="ui08":"[object Uint8ClampedArray]"===c?e+="uic8":"[object Int16Array]"===c?e+="si16":"[object Uint16Array]"===c?e+="ur16":"[object Int32Array]"===c?e+="si32":"[object Uint32Array]"===c?e+="ui32":"[object Float32Array]"===c?e+="fl32":"[object Float64Array]"===c?e+="fl64":b(new Error("Failed to get type for BinaryArray"))),b(e+sa(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var c="~~local_forage_type~"+a.type+"~"+sa(this.result);b("__lfsc__:blob"+c)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(c){console.error("Couldn't convert value into a JSON string: ",a),b(null,c)}},deserialize:function(a){if(a.substring(0,jc)!=="__lfsc__:")return JSON.parse(a);var b,c=a.substring(kc),d=a.substring(jc,kc);if(d==="blob"&&ic.test(c)){var e=c.match(ic);b=e[1],c=c.substring(e[0].length)}var f=ra(c);switch(d){case"arbf":return f;case"blob":return U([f],{type:b});case"si08":return new Int8Array(f);case"ui08":return new Uint8Array(f);case"uic8":return new Uint8ClampedArray(f);case"si16":return new Int16Array(f);case"ur16":return new Uint16Array(f);case"si32":return new Int32Array(f);case"ui32":return new Uint32Array(f);case"fl32":return new Float32Array(f);case"fl64":return new Float64Array(f);default:throw new Error("Unkown type: "+d);}},stringToBuffer:ra,bufferToString:sa},nc={_driver:"webSQLStorage",_initStorage:function(a){var b=this,c={db:null};if(a)for(var d in a)c[d]="string"==typeof a[d]?a[d]:a[d].toString();var e=new ec(function(a,d){try{c.db=openDatabase(c.name,c.version+"",c.description,c.size)}catch(a){return d(a)}c.db.transaction(function(e){ta(e,c,function(){b._dbInfo=c,a()},function(a,b){d(b)})},d)});return c.serializer=mc,e},_support:function(){return"function"==typeof openDatabase}(),iterate:function(a,b){var c=this,d=new ec(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){ua(c,e,"SELECT * FROM ".concat(e.storeName),[],function(c,d){for(var f=d.rows,g=f.length,h=0;ha===b||"number"==typeof a&&"number"==typeof b&&isNaN(a)&&isNaN(b),qc=(a,b)=>{for(var c=a.length,d=0;d{})}config(a){if("object"==typeof a){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a){if("storeName"==b&&(a[b]=a[b].replace(/\W/g,"_")),"version"==b&&"number"!=typeof a[b])return new Error("Database version must be a number.");this._config[b]=a[b]}return!("driver"in a&&a.driver)||this.setDriver(this._config.driver)}return"string"==typeof a?this._config[a]:this._config}defineDriver(a,b,c){var d=new ec(function(b,c){try{var d=a._driver,e=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!a._driver)return void c(e);for(var f=xc.concat("_initStorage"),g=0,h=f.length;g(null===b._ready&&(b._ready=b._initDriver()),b._ready));return Z(c,a,a),c}setDriver(a,b,c){function d(){g._config.driver=g.driver()}function e(a){return g._extend(a),d(),g._ready=g._initStorage(g._config),g._ready}function f(a){return function(){function b(){for(;cec.resolve());return this._driverSet=i.then(()=>{var a=h[0];return g._dbInfo=null,g._ready=null,g.getDriver(a).then(a=>{g._driver=a._driver,d(),g._wrapLibraryMethodsWithReady(),g._initDriver=f(h)})}).catch(()=>{d();var a=new Error("No available storage method found.");return g._driverSet=ec.reject(a),g._driverSet}),Z(this._driverSet,b,c),this._driverSet}supports(a){return!!tc[a]}_extend(a){Ca(this,a)}_getSupportedDrivers(a){for(var b,c=[],d=0,e=a.length;da.getHours()?b.amPm[0]:b.amPm[1]},A:function(a,b){return 12>a.getHours()?b.amPm[0].toUpperCase():b.amPm[1].toUpperCase()},ZZ:function(a){var b=a.getTimezoneOffset();return(0=a?"hass:battery-alert":"hass:battery-"+a}var e=b.attributes.unit_of_measurement;return"\xB0C"===e||"\xB0F"===e?"hass:thermometer":Ha("sensor")},input_datetime:function(a){return a.attributes.has_date?a.attributes.has_time?Ha("input_datetime"):"hass:calendar":"hass:clock"}},P=function(a){if(!a)return"hass:bookmark";if(a.attributes.icon)return a.attributes.icon;var b=Ga(a.entity_id);return b in cd?cd[b](a):Ha(b,a.state)},Q=function(a){var b={exports:{}};return a(b,b.exports),b.exports}(function(a){(function(b){a.exports=b()})(function(a){function b(e,f){var g=e[0],h=e[1],i=e[2],j=e[3];g+=0|(h&i|~h&j)+f[0]-680876936,g=0|(g<<7|g>>>25)+h,j+=0|(g&h|~g&i)+f[1]-389564586,j=0|(j<<12|j>>>20)+g,i+=0|(j&g|~j&h)+f[2]+606105819,i=0|(i<<17|i>>>15)+j,h+=0|(i&j|~i&g)+f[3]-1044525330,h=0|(h<<22|h>>>10)+i,g+=0|(h&i|~h&j)+f[4]-176418897,g=0|(g<<7|g>>>25)+h,j+=0|(g&h|~g&i)+f[5]+1200080426,j=0|(j<<12|j>>>20)+g,i+=0|(j&g|~j&h)+f[6]-1473231341,i=0|(i<<17|i>>>15)+j,h+=0|(i&j|~i&g)+f[7]-45705983,h=0|(h<<22|h>>>10)+i,g+=0|(h&i|~h&j)+f[8]+1770035416,g=0|(g<<7|g>>>25)+h,j+=0|(g&h|~g&i)+f[9]-1958414417,j=0|(j<<12|j>>>20)+g,i+=0|(j&g|~j&h)+f[10]-42063,i=0|(i<<17|i>>>15)+j,h+=0|(i&j|~i&g)+f[11]-1990404162,h=0|(h<<22|h>>>10)+i,g+=0|(h&i|~h&j)+f[12]+1804603682,g=0|(g<<7|g>>>25)+h,j+=0|(g&h|~g&i)+f[13]-40341101,j=0|(j<<12|j>>>20)+g,i+=0|(j&g|~j&h)+f[14]-1502002290,i=0|(i<<17|i>>>15)+j,h+=0|(i&j|~i&g)+f[15]+1236535329,h=0|(h<<22|h>>>10)+i,g+=0|(h&j|i&~j)+f[1]-165796510,g=0|(g<<5|g>>>27)+h,j+=0|(g&i|h&~i)+f[6]-1069501632,j=0|(j<<9|j>>>23)+g,i+=0|(j&h|g&~h)+f[11]+643717713,i=0|(i<<14|i>>>18)+j,h+=0|(i&g|j&~g)+f[0]-373897302,h=0|(h<<20|h>>>12)+i,g+=0|(h&j|i&~j)+f[5]-701558691,g=0|(g<<5|g>>>27)+h,j+=0|(g&i|h&~i)+f[10]+38016083,j=0|(j<<9|j>>>23)+g,i+=0|(j&h|g&~h)+f[15]-660478335,i=0|(i<<14|i>>>18)+j,h+=0|(i&g|j&~g)+f[4]-405537848,h=0|(h<<20|h>>>12)+i,g+=0|(h&j|i&~j)+f[9]+568446438,g=0|(g<<5|g>>>27)+h,j+=0|(g&i|h&~i)+f[14]-1019803690,j=0|(j<<9|j>>>23)+g,i+=0|(j&h|g&~h)+f[3]-187363961,i=0|(i<<14|i>>>18)+j,h+=0|(i&g|j&~g)+f[8]+1163531501,h=0|(h<<20|h>>>12)+i,g+=0|(h&j|i&~j)+f[13]-1444681467,g=0|(g<<5|g>>>27)+h,j+=0|(g&i|h&~i)+f[2]-51403784,j=0|(j<<9|j>>>23)+g,i+=0|(j&h|g&~h)+f[7]+1735328473,i=0|(i<<14|i>>>18)+j,h+=0|(i&g|j&~g)+f[12]-1926607734,h=0|(h<<20|h>>>12)+i,g+=0|(h^i^j)+f[5]-378558,g=0|(g<<4|g>>>28)+h,j+=0|(g^h^i)+f[8]-2022574463,j=0|(j<<11|j>>>21)+g,i+=0|(j^g^h)+f[11]+1839030562,i=0|(i<<16|i>>>16)+j,h+=0|(i^j^g)+f[14]-35309556,h=0|(h<<23|h>>>9)+i,g+=0|(h^i^j)+f[1]-1530992060,g=0|(g<<4|g>>>28)+h,j+=0|(g^h^i)+f[4]+1272893353,j=0|(j<<11|j>>>21)+g,i+=0|(j^g^h)+f[7]-155497632,i=0|(i<<16|i>>>16)+j,h+=0|(i^j^g)+f[10]-1094730640,h=0|(h<<23|h>>>9)+i,g+=0|(h^i^j)+f[13]+681279174,g=0|(g<<4|g>>>28)+h,j+=0|(g^h^i)+f[0]-358537222,j=0|(j<<11|j>>>21)+g,i+=0|(j^g^h)+f[3]-722521979,i=0|(i<<16|i>>>16)+j,h+=0|(i^j^g)+f[6]+76029189,h=0|(h<<23|h>>>9)+i,g+=0|(h^i^j)+f[9]-640364487,g=0|(g<<4|g>>>28)+h,j+=0|(g^h^i)+f[12]-421815835,j=0|(j<<11|j>>>21)+g,i+=0|(j^g^h)+f[15]+530742520,i=0|(i<<16|i>>>16)+j,h+=0|(i^j^g)+f[2]-995338651,h=0|(h<<23|h>>>9)+i,g+=0|(i^(h|~j))+f[0]-198630844,g=0|(g<<6|g>>>26)+h,j+=0|(h^(g|~i))+f[7]+1126891415,j=0|(j<<10|j>>>22)+g,i+=0|(g^(j|~h))+f[14]-1416354905,i=0|(i<<15|i>>>17)+j,h+=0|(j^(i|~g))+f[5]-57434055,h=0|(h<<21|h>>>11)+i,g+=0|(i^(h|~j))+f[12]+1700485571,g=0|(g<<6|g>>>26)+h,j+=0|(h^(g|~i))+f[3]-1894986606,j=0|(j<<10|j>>>22)+g,i+=0|(g^(j|~h))+f[10]-1051523,i=0|(i<<15|i>>>17)+j,h+=0|(j^(i|~g))+f[1]-2054922799,h=0|(h<<21|h>>>11)+i,g+=0|(i^(h|~j))+f[8]+1873313359,g=0|(g<<6|g>>>26)+h,j+=0|(h^(g|~i))+f[15]-30611744,j=0|(j<<10|j>>>22)+g,i+=0|(g^(j|~h))+f[6]-1560198380,i=0|(i<<15|i>>>17)+j,h+=0|(j^(i|~g))+f[13]+1309151649,h=0|(h<<21|h>>>11)+i,g+=0|(i^(h|~j))+f[4]-145523070,g=0|(g<<6|g>>>26)+h,j+=0|(h^(g|~i))+f[11]-1120210379,j=0|(j<<10|j>>>22)+g,i+=0|(g^(j|~h))+f[2]+718787259,i=0|(i<<15|i>>>17)+j,h+=0|(j^(i|~g))+f[9]-343485551,h=0|(h<<21|h>>>11)+i,e[0]=0|g+e[0],e[1]=0|h+e[1],e[2]=0|i+e[2],e[3]=0|j+e[3]}function c(a){var b,c=[];for(b=0;64>b;b+=4)c[b>>2]=a.charCodeAt(b)+(a.charCodeAt(b+1)<<8)+(a.charCodeAt(b+2)<<16)+(a.charCodeAt(b+3)<<24);return c}function d(b){var a,c=[];for(a=0;64>a;a+=4)c[a>>2]=b[a]+(b[a+1]<<8)+(b[a+2]<<16)+(b[a+3]<<24);return c}function e(a){var d,e,f,g,h,j,k=a.length,l=[1732584193,-271733879,-1732584194,271733878];for(d=64;d<=k;d+=64)b(l,c(a.substring(d-64,d)));for(a=a.substring(d-64),e=a.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=0;d>2]|=a.charCodeAt(d)<<(d%4<<3);if(f[d>>2]|=128<<(d%4<<3),55d;d+=1)f[d]=0;return g=8*k,g=g.toString(16).match(/(.*?)(.{0,8})$/),h=parseInt(g[2],16),j=parseInt(g[1],16)||0,f[14]=h,f[15]=j,b(l,f),l}function f(c){var e,f,g,h,j,k,l=c.length,m=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=l;e+=64)b(m,d(c.subarray(e-64,e)));for(c=e-64>2]|=c[e]<<(e%4<<3);if(g[e>>2]|=128<<(e%4<<3),55e;e+=1)g[e]=0;return h=8*l,h=h.toString(16).match(/(.*?)(.{0,8})$/),j=parseInt(h[2],16),k=parseInt(h[1],16)||0,g[14]=j,g[15]=k,b(m,g),m}function g(a){var b,c="";for(b=0;4>b;b+=1)c+=o[15&a>>8*b+4]+o[15&a>>8*b];return c}function h(a){var b;for(b=0;ba?Na(a+b,0):Ma(a,b)}ArrayBuffer.prototype.slice=function(c,d){var e,f,g,h,i=this.byteLength,j=b(c,i),k=i;return(d!==a&&(k=b(d,i)),j>k)?new ArrayBuffer(0):(e=k-j,f=new ArrayBuffer(e),g=new Uint8Array(f),h=new Uint8Array(this,j,e),g.set(h),f)}}(),n.prototype.append=function(a){return this.appendBinary(i(a)),this},n.prototype.appendBinary=function(a){this._buff+=a,this._length+=a.length;var d,e=this._buff.length;for(d=64;d<=e;d+=64)b(this._hash,c(this._buff.substring(d-64,d)));return this._buff=this._buff.substring(d-64),this},n.prototype.end=function(a){var b,c,d=this._buff,e=d.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(b=0;b>2]|=d.charCodeAt(b)<<(b%4<<3);return this._finish(f,e),c=h(this._hash),a&&(c=m(c)),this.reset(),c},n.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},n.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},n.prototype.setState=function(a){return this._buff=a.buff,this._length=a.length,this._hash=a.hash,this},n.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},n.prototype._finish=function(a,c){var d,e,f,g=c;if(a[g>>2]|=128<<(g%4<<3),55g;g+=1)a[g]=0;d=8*this._length,d=d.toString(16).match(/(.*?)(.{0,8})$/),e=parseInt(d[2],16),f=parseInt(d[1],16)||0,a[14]=e,a[15]=f,b(this._hash,a)},n.hash=function(a,b){return n.hashBinary(i(a),b)},n.hashBinary=function(a,b){var c=e(a),d=h(c);return b?m(d):d},n.ArrayBuffer=function(){this.reset()},n.ArrayBuffer.prototype.append=function(a){var c,e=l(this._buff.buffer,a,!0),f=e.length;for(this._length+=a.byteLength,c=64;c<=f;c+=64)b(this._hash,d(e.subarray(c-64,c)));return this._buff=c-64>2]|=d[b]<<(b%4<<3);return this._finish(f,e),c=h(this._hash),a&&(c=m(c)),this.reset(),c},n.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},n.ArrayBuffer.prototype.getState=function(){var a=n.prototype.getState.call(this);return a.buff=k(a.buff),a},n.ArrayBuffer.prototype.setState=function(a){return a.buff=j(a.buff,!0),n.prototype.setState.call(this,a)},n.ArrayBuffer.prototype.destroy=n.prototype.destroy,n.ArrayBuffer.prototype._finish=n.prototype._finish,n.ArrayBuffer.hash=function(a,b){var c=f(new Uint8Array(a)),d=h(c);return b?m(d):d},n})}),dd=Oa,ed=a=>fd(a,16,function(b){return dd(b)}),fd=(a,b,c)=>{if(null==a)return"";var d,e,f,g={},h={},j="",k="",l="",m=2,n=3,o=2,p=[],q=0,r=0;for(f=0;fl.charCodeAt(0)){for(d=0;dd;d++)q=q<<1|1&e,r==b-1?(r=0,p.push(c(q)),q=0):r++,e>>=1}else{for(e=1,d=0;dd;d++)q=q<<1|1&e,r==b-1?(r=0,p.push(c(q)),q=0):r++,e>>=1}m--,0==m&&(m=La(2,o),o++),delete h[l]}else for(e=g[l],d=0;d>=1;m--,0==m&&(m=La(2,o),o++),g[k]=n++,l=j+""}if(""!==l){if(Object.prototype.hasOwnProperty.call(h,l)){if(256>l.charCodeAt(0)){for(d=0;dd;d++)q=q<<1|1&e,r==b-1?(r=0,p.push(c(q)),q=0):r++,e>>=1}else{for(e=1,d=0;dd;d++)q=q<<1|1&e,r==b-1?(r=0,p.push(c(q)),q=0):r++,e>>=1}m--,0==m&&(m=La(2,o),o++),delete h[l]}else for(e=g[l],d=0;d>=1;m--,0==m&&(m=La(2,o),o++)}for(e=2,d=0;d>=1;for(;;)if(q<<=1,r==b-1){p.push(c(q));break}else r++;return p.join("")},gd=a=>null==a?"":""==a?null:hd(a.length,32768,function(b){return a.charCodeAt(b)}),hd=(a,b,d)=>{var e,f,g,h,j,k,l,m=[],n=4,o=4,p=3,q="",r=[],s={val:d(0),position:b,index:1};for(e=0;3>e;e+=1)m[e]=e;for(g=0,j=La(2,2),k=1;k!=j;)h=s.val&s.position,s.position>>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0a)return"";for(g=0,j=La(2,p),k=1;k!=j;)h=s.val&s.position,s.position>>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0a.reduce((a,c)=>+c[b]<+a[b]?c:a,a[0]),jd=(a,b)=>a.reduce((a,c)=>a+ +c[b],0)/a.length,kd=(a,b)=>a.reduce((a,c)=>+c[b]>+a[b]?c:a,a[0]),ld=function(a,b){var c=2a*3600*1000,nd=(c,a,b)=>{var d=+c.replace("#","0x"),e=d>>16,f=255&d>>8,g=255&d,h=+a.replace("#","0x");return"#".concat((0|16777216+(e+b*((h>>16)-e)<<16)+(f+b*((255&h>>8)-f)<<8)+(g+b*((255&h)-g))).toString(16).slice(1))},od=a=>ed(JSON.stringify(a)),pd=a=>"string"==typeof a?JSON.parse(gd(a)):a,qd=function(){for(var a=arguments.length,b=Array(a),c=0;c"undefined"!=typeof a)},rd=(c,a)=>c.length===a.length&&c.every((b,c)=>b===a[c]),sd=a=>{console.warn("mini-graph-card: ",a)},td="https://github.com/kalkih/mini-graph-card/blob/master/README.md",ud=14,vd=96,wd={humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",battery:"hass:battery",pressure:"hass:gauge",power:"hass:flash",signal_strength:"hass:wifi",motion:"hass:walk",door:"hass:door-closed",window:"hass:window-closed",presence:"hass:account",light:"hass:lightbulb"},xd=["var(--accent-color)","#3498db","#e74c3c","#9b59b6","#f1c40f","#2ecc71","#1abc9c","#34495e","#e67e22","#7f8c8d","#27ae60","#2980b9","#8e44ad"],yd=["entity","line","length","fill","points","tooltip","abs","config"],zd={name:!0,icon:!0,state:!0,graph:"line",labels:"hover",labels_secondary:"hover",extrema:!1,legend:!0,fill:!0,points:"hover"},Ad=0,X=1,Y=2,V=3600000;class Bd{constructor(a,b,c){var d=3this._reducer(a,b),[]);b[0]&&b[0].length&&(b[0]=[b[0][b[0].length-1]]);var c=Ka(this.hours*this.points);b.length=c,this.coords=this._calcPoints(b),this.min=Ma.apply(Math,S(this.coords.map(a=>+a[Y]))),this.max=Na.apply(Math,S(this.coords.map(a=>+a[Y])))}}_reducer(a,b){var c=this._endTime-new Date(b.last_changed).getTime(),d=c/V*this.points-this.hours*this.points,e=0>d?Pa(Qa(d)):0;return a[e]||(a[e]=[]),a[e].push(b),a}_calcPoints(a){var b=[],c=this.width/(this.hours*this.points-1);c=Number.isFinite(c)?c:this.width;for(var d=a.filter(Boolean)[0],e=[this._calcPoint(d),this._lastValue(d)],f=(a,d)=>{var f=c*d+this.margin[Ad];return a&&(e=[this._calcPoint(a),this._lastValue(a)]),b.push([f,0,a?e[0]:e[1]])},g=0;g{var b=this._logarithmic?Ja(Na(1,a[Y])):a[Y],e=this.height-(b-c)/d+2*this.margin[X];return[a[Ad],e,a[Y]]});return e}getPoints(){var{coords:a}=this;1===a.length&&(a[1]=[this.width+this.margin[Ad],0,a[0][Y]]),a=this._calcY(this.coords);var b,c,d=a[0];a.shift();var e=a.map((a,e)=>{b=a,c=this._smoothing?this._midPoint(d[Ad],d[X],b[Ad],b[X]):b;var f=this._smoothing?(b[Y]+d[Y])/2:b[Y];return d=b,[c[Ad],c[X],f,e+1]});return e}getPath(){var{coords:a}=this;1===a.length&&(a[1]=[this.width+this.margin[Ad],0,a[0][Y]]),a=this._calcY(this.coords);var b,c,d="",e=a[0];return d+="M".concat(e[Ad],",").concat(e[X]),a.forEach(a=>{b=a,c=this._smoothing?this._midPoint(e[Ad],e[X],b[Ad],b[X]):b,d+=" ".concat(c[Ad],",").concat(c[X]),d+=" Q ".concat(b[Ad],",").concat(b[X]),e=b}),d+=" ".concat(b[Ad],",").concat(b[X]),d}computeGradient(a,b){var c=b?Ja(Na(1,this._max))-Ja(Na(1,this._min)):this._max-this._min;return a.map((a,d,e)=>{var f;if(a.value>this._max&&e[d+1]){var h=(this._max-e[d+1].value)/(a.value-e[d+1].value);f=nd(e[d+1].color,a.color,h)}else if(a.value=c?0:b?(Ja(Na(1,this._max))-Ja(Na(1,a.value)))*(100/c):(this._max-a.value)*(100/c),{color:f||a.color,offset:g}})}getFill(a){var b=this.height+4*this.margin[X],c=a;return c+=" L ".concat(this.width-2*this.margin[Ad],", ").concat(b),c+=" L ".concat(this.coords[0][Ad],", ").concat(b," z"),c}getBars(a,b){var c=2({x:e*f*b+e*a+c,y:d[X],height:this.height-d[X]+4*this.margin[X],width:e-c,value:d[Y]}))}_midPoint(a,b,c,d){return[(a-c)/2+c,(b-d)/2+d]}_average(a){return a.reduce((a,b)=>a+parseFloat(b.state),0)/a.length}_median(a){var b=S(a).sort((c,a)=>parseFloat(c)-parseFloat(a)),c=Pa((b.length-1)/2);return 1==b.length%2?parseFloat(b[c].state):(parseFloat(b[c].state)+parseFloat(b[c+1].state))/2}_maximum(a){return Na.apply(Math,S(a.map(a=>a.state)))}_minimum(a){return Ma.apply(Math,S(a.map(a=>a.state)))}_first(a){return parseFloat(a[0].state)}_last(a){return parseFloat(a[a.length-1].state)}_sum(a){return a.reduce((a,b)=>a+parseFloat(b.state),0)}_delta(a){return this._maximum(a)-this._minimum(a)}_diff(a){return this._last(a)-this._first(a)}_lastValue(a){return["delta","diff"].includes(this.aggregateFuncName)?0:parseFloat(a[a.length-1].state)||0}_updateEndTime(){switch(this._endTime=new Date,this._groupBy){case"month":this._endTime.setMonth(this._endTime.getMonth()+1),this._endTime.setDate(1);break;case"date":this._endTime.setDate(this._endTime.getDate()+1),this._endTime.setHours(0,0,0,0);break;case"hour":this._endTime.setHours(this._endTime.getHours()+1),this._endTime.setMinutes(0,0,0);}}}var Cd=function css(a){for(var b=arguments.length,c=Array(1b+_b(c)+a[d+1],a[0]);return new Zb(e,Yb)}(L()),Dd=(a,b,c,d,f)=>{var g;switch(d.action){case"more-info":{g=new Event("hass-more-info",{composed:!0}),g.detail={entityId:f},a.dispatchEvent(g);break}case"navigate":{if(!d.navigation_path)return;window.history.pushState(null,"",d.navigation_path),g=new Event("location-changed",{composed:!0}),g.detail={replace:!1},window.dispatchEvent(g);break}case"call-service":{if(!d.service)return;var[h,i]=d.service.split(".",2),j=O({},d.service_data);b.callService(h,i,j);break}case"url":{if(!d.url)return;window.location.href=d.url;break}case"fire-dom-event":{g=new Event("ll-custom",{composed:!0,bubbles:!0}),g.detail=d,a.dispatchEvent(g);break}}},Ed=(a,b)=>{for(var c=b,d=a.length;c{if(!a||!a.length)return a;if(null==a[0].value||null==a[a.length-1].value)throw new Error("The first and last thresholds must have a set \"value\".\n See ".concat(td));var b=0,c=null;return a.map((d,e)=>{if(null!=d.value)return b=e,O({},d);null==c?c=Ed(a,e):e>c&&(b=c,c=Ed(a,e));var f=a[b].value,g=a[c].value,h=(g-f)/(c-b);return{color:"string"==typeof d?d:d.color,value:h*e+f}})},Gd=(a,b)=>{var c=Fd(a);if(c.sort((c,a)=>a.value-c.value),"smooth"===b)return c;var d,e=(d=[]).concat.apply(d,S(c.map((a,b)=>[a,{value:a.value-1e-4,color:c[b+1]?c[b+1].color:a.color}])));return e},Hd=a=>{if(!Array.isArray(a.entities))throw new Error("Please provide the \"entities\" option as a list.\n See ".concat(td));if(a.line_color_above||a.line_color_below)throw new Error("\"line_color_above/line_color_below\" was removed, please use \"color_thresholds\".\n See ".concat(td));var b=O(O({animate:!1,hour24:!1,font_size:ud,font_size_header:14,height:100,hours_to_show:24,points_per_hour:.5,aggregate_func:"avg",group_by:"interval",line_color:[].concat(xd),color_thresholds:[],color_thresholds_transition:"smooth",line_width:5,bar_spacing:4,compress:!0,smoothing:!0,state_map:[],cache:!0,value_factor:0,tap_action:{action:"more-info"}},JSON.parse(JSON.stringify(a))),{},{show:O(O({},zd),a.show)});b.entities.forEach((a,c)=>{"string"==typeof a&&(b.entities[c]={entity:a})}),b.state_map.forEach((a,c)=>{"string"==typeof a&&(b.state_map[c]={value:a,label:a}),b.state_map[c].label=b.state_map[c].label||b.state_map[c].value}),"string"==typeof a.line_color&&(b.line_color=[a.line_color].concat(xd)),b.font_size=a.font_size/100*ud||ud,b.color_thresholds=Gd(b.color_thresholds,b.color_thresholds_transition);var c=24vd&&(b.points_per_hour=vd/(b.hours_to_show*e),sd("Not enough space, adjusting points_per_hour to ".concat(b.points_per_hour)))}return b},Id="0.11.0";Ac.config({name:"mini-graph-card",version:1,storeName:"entity_history_cache",description:"Mini graph card uses caching for the entity history"}),Ac.iterate((a,b)=>{var c=b.endsWith("-raw")?a:pd(a),d=new Date;d.setHours(d.getHours()-c.hours_to_show),(a.version!==Id||new Date(c.last_fetched){console.warn("Purging has errored: ",a)}),console.info("%c MINI-GRAPH-CARD %c ".concat(Id," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;");class Jd extends bc{constructor(){super(),this.id=Math.random().toString(36).substr(2,9),this.config={},this.bound=[0,0],this.boundSecondary=[0,0],this.length=[],this.entity=[],this.line=[],this.bar=[],this.abs=[],this.fill=[],this.points=[],this.gradient=[],this.tooltip={},this.updateQueue=[],this.updating=!1,this.stateChanged=!1,this.initial=!0,this._md5Config=void 0}static get styles(){return Cd}set hass(a){this._hass=a;var b=!1,c=[];this.config.entities.forEach((d,e)=>{this.config.entities[e].index=e;var f=a&&a.states[d.entity]||void 0;f&&this.entity[e]!==f&&(this.entity[e]=f,c.push("".concat(f.entity_id,"-").concat(e)),b=!0)}),b&&(this.stateChanged=!0,this.entity=S(this.entity),this.config.update_interval||this.updating?this.updateQueue=[].concat(c,S(this.updateQueue)):setTimeout(()=>{this.updateQueue=[].concat(c,S(this.updateQueue)),this.updateData()},this.initial?0:1e3))}static get properties(){return{id:String,_hass:{},config:{},entity:[],Graph:[],line:[],shadow:[],length:Number,bound:[],boundSecondary:[],abs:[],tooltip:{},updateQueue:[],color:String}}setConfig(a){this.config=Hd(a,this.config),this._md5Config=Q.hash(JSON.stringify(this.config));var b=!rd(this.config.entities||[],a.entities);(!this.Graph||b)&&(this._hass&&(this.hass=this._hass),this.Graph=this.config.entities.map(a=>new Bd(500,this.config.height,[this.config.show.fill?0:this.config.line_width,this.config.line_width],this.config.hours_to_show,this.config.points_per_hour,a.aggregate_func||this.config.aggregate_func,this.config.group_by,qd(a.smoothing,this.config.smoothing,!a.entity.startsWith("binary_sensor.")),this.config.logarithmic)))}connectedCallback(){super.connectedCallback(),this.config.update_interval&&(window.requestAnimationFrame(()=>{this.updateOnInterval()}),this.interval=setInterval(()=>this.updateOnInterval(),1e3*this.config.update_interval))}disconnectedCallback(){this.interval&&clearInterval(this.interval),super.disconnectedCallback()}shouldUpdate(a){if(yd.some(b=>a.has(b)))return this.color=this.intColor(void 0===this.tooltip.value?this.entity[0]&&this.entity[0].state:this.tooltip.value,this.tooltip.entity||0),!0}firstUpdated(){this.initial=!1}updated(a){this.config.animate&&a.has("line")&&(this.length.length{this.length[a.id]=a.getTotalLength()}),this.length=S(this.length)):this.length=Array(this.entity.length).fill("none"))}render(){var{config:a}=0void 0===this.entity[b])?this.renderWarnings():Db(J(),a.group,a.show.graph&&a.show.fill,"hover"===a.show.points,"hover"===a.show.labels,"hover"===a.show.labels_secondary,0this.handlePopup(b,a.tap_action.entity||this.entity[0]),this.renderHeader(),this.renderStates(),this.renderGraph(),this.renderInfo()):Db(K())}renderWarnings(){return Db(I(),this.config.entities.map((a,b)=>this.entity[b]?Db(G()):Db(H(),this.config.entities[b].entity)))}renderHeader(){var{show:a,align_icon:b,align_header:c,font_size_header:d}=this.config;return a.name||a.icon&&"state"!==b?Db(F(),c,d,this.renderName(),"state"===b?"":this.renderIcon()):""}renderIcon(){var{icon:a,icon_adaptive_color:b}=this.config.show;return a?Db(E(),this.config.align_icon,b?"color: ".concat(this.color,";"):"",this.computeIcon(this.entity[0])):""}renderName(){if(this.config.show.name){var a=void 0===this.tooltip.entity?this.config.name||this.computeName(0):this.computeName(this.tooltip.entity),b=this.config.show.name_adaptive_color?"opacity: 1; color: ".concat(this.color,";"):"";return Db(D(),b,a)}}renderStates(){var[a]=this.config.entities;if(this.config.show.state)return Db(C(),this.config.align_state,this.renderState(a,0),this.config.entities.map((a,b)=>0this.handlePopup(a,this.entity[b]),a.state_adaptive_color?"color: ".concat(this.computeColor(f,b),";"):"",a.show_indicator?this.renderIndicator(f,b):"",this.computeState(c&&e||f),this.computeUom(c&&d||b),c&&this.renderStateTime()||"")}}renderStateTime(){return void 0===this.tooltip.value?void 0:Db(A(),this.tooltip.label?Db(z(),this.tooltip.label):Db(y(),this.tooltip.time[0],this.tooltip.time[1]))}renderGraph(){return this.config.show.graph?Db(x(),this.renderLabels(),this.renderLabelsSecondary(),this.renderSvg(),this.renderLegend()):""}renderLegend(){return 1>=this.visibleLegends.length||!this.config.show.legend?void 0:Db(w(),this.visibleLegends.map(a=>Db(v(),b=>this.handlePopup(b,this.entity[a.index]),()=>this.setTooltip(a.index,-1,this.getEntityState(a.index),"Current"),()=>this.tooltip={},this.renderIndicator(this.entity[a.index].state,a.index),this.computeName(a.index))))}renderIndicator(a,b){return Eb(u(),this.intColor(a,b))}renderSvgFill(a,b){if(a){var c="fade"===this.config.show.fill,d=this.length[b]||!1===this.config.entities[b].show_line;return Eb(t(),"fill-grad-".concat(this.id,"-").concat(b),"fill-grad-mask-".concat(this.id,"-").concat(b),"url(#fill-grad-".concat(this.id,"-").concat(b,")"),"fill-".concat(this.id,"-").concat(b),this.config.show.fill,b,this.config.animate,d,this.config.animate?"".concat(.5*b,"s"):"0s",c?"url(#fill-grad-mask-".concat(this.id,"-").concat(b,")"):"",this.fill[b])}}renderSvgLine(a,b){if(a){var c=Eb(s(),b,this.config.animate,this.length[b],this.config.animate?"".concat(.5*b,"s"):"0s",this.length[b]||"none",this.length[b]||"none","white",this.config.line_width,this.line[b]);return Eb(r(),"line-".concat(this.id,"-").concat(b),c)}}renderSvgPoint(a,b){var c=this.gradient[b]?this.computeColor(a[Y],b):"inherit";return Eb(q(),this.tooltip.index!==a[3],"--mcg-hover: ".concat(c,";"),c,c,a[Ad],a[X],this.config.line_width,()=>this.setTooltip(b,a[3],a[Y]),()=>this.tooltip={})}renderSvgPoints(a,b){if(a){var c=this.computeColor(this.entity[b].state,b);return Eb(p(),this.tooltip.entity===b,void 0!==this.tooltip.entity&&this.tooltip.entity!==b,this.length[b],this.config.animate&&"hover"!==this.config.show.points,this.config.animate?"".concat(.5*b+.5,"s"):"0s",c,c,this.config.line_width/2,a.map(a=>this.renderSvgPoint(a,b)))}}renderSvgGradient(a){if(a){var b=a.map((a,b)=>a?Eb(o(),"grad-".concat(this.id,"-").concat(b),a.map(a=>Eb(n(),a.color,"".concat(a.offset,"%")))):void 0);return Eb(m(),b)}}renderSvgLineRect(a,b){if(a){var c=this.gradient[b]?"url(#grad-".concat(this.id,"-").concat(b,")"):this.computeColor(this.entity[b].state,b);return Eb(l(),void 0!==this.tooltip.entity&&this.tooltip.entity!==b,"rect-".concat(this.id,"-").concat(b),c,"url(#line-".concat(this.id,"-").concat(b,")"))}}renderSvgFillRect(a,b){if(a){var c=this.gradient[b]?"url(#grad-".concat(this.id,"-").concat(b,")"):this.intColor(this.entity[b].state,b);return Eb(k(),void 0!==this.tooltip.entity&&this.tooltip.entity!==b,"fill-rect-".concat(this.id,"-").concat(b),c,"url(#fill-".concat(this.id,"-").concat(b,")"))}}renderSvgBars(a,b){if(a){var c=a.map((a,c)=>{var d=this.config.animate?Eb(j(),this.config.height,a.y):"",e=this.computeColor(a.value,b);return Eb(h(),a.x,a.y,a.height,a.width,e,()=>this.setTooltip(b,c,a.value),()=>this.tooltip={},d)});return Eb(g(),this.config.animate,c)}}renderSvg(){var{height:a}=this.config;return Eb(f(),0===a?0:"100%",a,a=>a.stopPropagation(),this.renderSvgGradient(this.gradient),this.fill.map((a,b)=>this.renderSvgFill(a,b)),this.fill.map((a,b)=>this.renderSvgFillRect(a,b)),this.line.map((a,b)=>this.renderSvgLine(a,b)),this.line.map((a,b)=>this.renderSvgLineRect(a,b)),this.bar.map((a,b)=>this.renderSvgBars(a,b)),this.points.map((a,b)=>this.renderSvgPoints(a,b)))}setTooltip(a,b,c){var d=3f&&1>e?e*f:1/e,i=Qa(b+1-Ka(f*e)),j=this.getEndDate(),k=1/60;j.setMilliseconds(j.getMilliseconds()-md(h*i+k));var l=ld(j,g,this._hass.language);j.setMilliseconds(j.getMilliseconds()-md(h-k));var m=ld(j,g,this._hass.language);this.tooltip={value:c,id:i,entity:a,time:[m,l],index:b,label:d}}renderLabels(){return this.config.show.labels&&0!==this.primaryYaxisSeries.length?Db(e(),this.computeState(this.bound[1]),this.computeState(this.bound[0])):void 0}renderLabelsSecondary(){return this.config.show.labels_secondary&&0!==this.secondaryYaxisSeries.length?Db(d(),this.computeState(this.boundSecondary[1]),this.computeState(this.boundSecondary[0])):void 0}renderInfo(){return 0Db(b(),a.type,this.computeState(a.state),this.computeUom(0),"avg"===a.type?"":ld(new Date(a.last_changed),this.config.format,this._hass.language)))):Db(a())}handlePopup(a,b){a.stopPropagation(),Dd(this,this._hass,this.config,this.config.tap_action,b.entity_id||b)}computeColor(a,b){var{color_thresholds:c,line_color:d}=this.config,e=O(O({color:d[b]||d[0]},c.slice(-1)[0]),c.find(b=>b.value<(+a||0)));return this.config.entities[b].color||e.color}get visibleEntities(){return this.config.entities.filter(a=>!1!==a.show_graph)}get primaryYaxisEntities(){return this.visibleEntities.filter(a=>a.y_axis===void 0||"primary"===a.y_axis)}get secondaryYaxisEntities(){return this.visibleEntities.filter(a=>"secondary"===a.y_axis)}get visibleLegends(){return this.visibleEntities.filter(a=>!1!==a.show_legend)}get primaryYaxisSeries(){return this.primaryYaxisEntities.map(a=>this.Graph[a.index])}get secondaryYaxisSeries(){return this.secondaryYaxisEntities.map(a=>this.Graph[a.index])}intColor(a,b){var c,{color_thresholds:d,line_color:e}=this.config,f=+a||0;if(0a.valuea.valueb.value===a);if(f)return f.label;sd("value [".concat(a,"] not found in state_map"))}var b="string"==typeof a?parseFloat(a.replace(/,/g,".")):+a;var c=this.config.decimals,d=10**this.config.value_factor;if(c===void 0||Ia(c)||Ia(b))return this.numberFormat(Ra(100*(b*d))/100,this._hass.language);var e=10**c;return this.numberFormat((Ra(b*d*e)/e).toFixed(c),this._hass.language,c)}numberFormat(a,b,c){return!Ia(+a)&&Intl?new Intl.NumberFormat(b,{minimumFractionDigits:c}).format(+a):a.toString()}updateOnInterval(){this.stateChanged&&!this.updating&&(this.stateChanged=!1,this.updateData())}updateData(){var a=arguments,b=this;return R(function*(){var{config:c}=0b.updateEntity(a,c,e,d));yield Promise.all(f)}catch(a){sd(a)}if(c.show.graph&&b.entity.forEach((a,c)=>{a&&b.Graph[c].update()}),b.updateBounds(),c.show.graph){var g=0;b.entity.forEach((a,d)=>{if(a&&0!==b.Graph[d].coords.length){var e="secondary"===c.entities[d].y_axis?b.boundSecondary:b.bound;if([b.Graph[d].min,b.Graph[d].max]=[e[0],e[1]],"bar"===c.show.graph){var f=b.visibleEntities.length;b.bar[d]=b.Graph[d].getBars(g,f,c.bar_spacing),g+=1}else{var h=b.Graph[d].getPath();!1!==c.entities[d].show_line&&(b.line[d]=h),c.show.fill&&!1!==c.entities[d].show_fill&&(b.fill[d]=b.Graph[d].getFill(h)),c.show.points&&!1!==c.entities[d].show_points&&(b.points[d]=b.Graph[d].getPoints()),0b[a])))||d:"~"===c[0]?Math[a].apply(Math,[+c.substr(1)].concat(S(b.map(b=>b[a])))):c}getBoundaries(a,b,c,d,e){var f=[this.getBoundary("min",a,b,d[0],e),this.getBoundary("max",a,c,d[1],e)];if(e){var g=Qa(f[0]-f[1]),h=parseFloat(e)-g;0c!=="".concat(a.entity_id,"-").concat(b));var f=[],g=c,h=!1,i=e.config.cache?yield e.getCache("".concat(a.entity_id,"_").concat(b),e.config.useCompress):void 0;if(i&&i.hours_to_show===e.config.hours_to_show){f=i.data;var k=f.findIndex(a=>new Date(a.last_changed)>c);-1===k?f=[]:(0g&&(g=new Date(l-1))}var j=yield e.fetchRecent(a.entity_id,g,d,!e.config.entities[b].attribute&&h,!!e.config.entities[b].attribute);if(j[0]&&0{e.config.entities[b].attribute&&(a.state=a.attributes[e.config.entities[b].attribute],delete a.attributes),0!Ia(parseFloat(a.state))),j=j.map(a=>({last_changed:e.config.entities[b].attribute?a.last_updated:a.last_changed,state:a.state})),f=[].concat(S(f),S(j)),e.config.cache&&e.setCache("".concat(a.entity_id,"_").concat(b),{hours_to_show:e.config.hours_to_show,last_fetched:new Date,data:f,version:Id},e.config.useCompress).catch(a=>{sd(a),Ac.clear()})),0!==f.length)if(e.entity[0]&&a.entity_id===e.entity[0].entity_id&&e.updateExtrema(f),!0===e.config.entities[b].fixed_value){var m=f[f.length-1];e.Graph[b].history=[m,m]}else e.Graph[b].history=f}})()}fetchRecent(a,b,c,d,e){var f=this;return R(function*(){var g="history/period";return b&&(g+="/".concat(b.toISOString())),g+="?filter_entity_id=".concat(a),c&&(g+="&end_time=".concat(c.toISOString())),d&&(g+="&skip_initial_state"),e||(g+="&minimal_response"),e&&(g+="&significant_changes_only=0"),f._hass.callApi("GET",g)})()}updateExtrema(a){var{extrema:b,average:c}=this.config.show;this.abs=[].concat(S(b?[O({type:"min"},id(a,"state"))]:[]),S(c?[{type:"avg",state:jd(a,"state")}]:[]),S(b?[O({type:"max"},kd(a,"state"))]:[]))}_convertState(a){var b=this.config.state_map.findIndex(b=>b.value===a.state);-1===b||(a.state=b)}getEndDate(){var a=new Date;switch(this.config.group_by){case"date":a.setDate(a.getDate()+1),a.setHours(0,0,0);break;case"hour":a.setHours(a.getHours()+1),a.setMinutes(0,0);}return a}setNextUpdate(){if(!this.config.update_interval){var a=1/this.config.points_per_hour;clearInterval(this.interval),this.interval=setInterval(()=>{this.updating||this.updateData()},a*V)}}getCardSize(){return 3}}customElements.define("mini-graph-card",Jd),window.customCards=window.customCards||[],window.customCards.push({type:"mini-graph-card",name:"Mini Graph Card",preview:!1,description:"The Mini Graph card is a minimalistic and customizable graph card"})})})(); +(function(){"use strict";function a(){var b=N([""]);return a=function(){return b},b}function b(){var a=N(["\n
\n ","\n \n "," ","\n \n \n ","\n \n
\n "]);return b=function(){return a},a}function c(){var a=N(["\n
\n ","\n
\n "]);return c=function(){return a},a}function d(){var a=N(["\n
\n ","\n ","\n
\n "]);return d=function(){return a},a}function e(){var a=N(["\n
\n ","\n ","\n
\n "]);return e=function(){return a},a}function f(){var a=N(["\n \n \n \n ","\n \n ","\n ","\n ","\n ","\n ","\n \n ","\n "]);return f=function(){return a},a}function g(){var a=N(["",""]);return g=function(){return a},a}function h(){var a=N(["\n \n ","\n "]);return h=function(){return a},a}function j(){var a=N(["\n \n "]);return j=function(){return a},a}function k(){var a=N(["\n "]);return k=function(){return a},a}function l(){var a=N(["\n "]);return l=function(){return a},a}function m(){var a=N(["",""]);return m=function(){return a},a}function n(){var a=N(["\n \n "]);return n=function(){return a},a}function o(){var a=N(["\n \n ","\n "]);return o=function(){return a},a}function p(){var a=N(["\n \n ","\n "]);return p=function(){return a},a}function q(){var a=N(["\n \n "]);return q=function(){return a},a}function r(){var a=N(["\n \n ","\n \n "]);return r=function(){return a},a}function s(){var a=N(["\n "]);return s=function(){return a},a}function t(){var a=N(["\n \n \n \n \n \n \n \n \n \n \n \n "]);return t=function(){return a},a}function u(){var a=N(["\n \n \n \n "]);return u=function(){return a},a}function v(){var a=N(["\n
\n ","\n ","\n
\n "]);return v=function(){return a},a}function w(){var a=N(["\n
\n ","\n
\n "]);return w=function(){return a},a}function x(){var a=N(["\n
\n
\n ","\n ","\n
\n ","\n
\n
\n ","\n
"]);return x=function(){return a},a}function y(){var a=N(["\n "," -\n ","\n "]);return y=function(){return a},a}function z(){var a=N(["\n ","\n "]);return z=function(){return a},a}function A(){var a=N(["\n
\n ","\n
\n "]);return A=function(){return a},a}function B(){var a=N(["\n \n ","\n \n ","\n \n \n ","\n \n ","\n
\n "]);return B=function(){return a},a}function C(){var a=N(["\n
\n ","\n
","
\n ","\n
\n "]);return C=function(){return a},a}function D(){var a=N(["\n
\n ","\n
\n "]);return D=function(){return a},a}function E(){var a=N(["\n
\n \n
\n "]);return E=function(){return a},a}function F(){var a=N(["\n
\n \n
\n "]);return F=function(){return a},a}function G(){var a=N(["\n
\n "," ","\n
\n "]);return G=function(){return a},a}function H(){var a=N([""]);return H=function(){return a},a}function I(){var a=N(["\n
\n Entity not available: ","\n
\n "]);return I=function(){return a},a}function J(){var a=N(["\n \n
mini-graph-card
\n ","\n
\n "]);return J=function(){return a},a}function K(){var a=N(["\n \n "," "," "," ","\n \n "]);return K=function(){return a},a}function L(){var a=N([""]);return L=function(){return a},a}function M(){var a=N(["\n :host {\n display: flex;\n flex-direction: column;\n }\n ha-card {\n flex-direction: column;\n flex: 1;\n padding: 16px 0;\n position: relative;\n overflow: hidden;\n }\n ha-card > div {\n padding: 0px 16px 16px 16px;\n }\n ha-card > div:last-child {\n padding-bottom: 0;\n }\n ha-card[points] .line--points,\n ha-card[labels] .graph__labels.--primary {\n opacity: 0;\n transition: opacity .25s;\n animation: none;\n }\n ha-card[labels-secondary] .graph__labels.--secondary {\n opacity: 0;\n transition: opacity .25s;\n animation: none;\n }\n ha-card[points]:hover .line--points,\n ha-card:hover .graph__labels.--primary,\n ha-card:hover .graph__labels.--secondary {\n opacity: 1;\n }\n ha-card[fill] {\n padding-bottom: 0;\n }\n ha-card[fill] .graph {\n padding: 0;\n order: 10;\n }\n ha-card[fill] path {\n stroke-linecap: initial;\n stroke-linejoin: initial;\n }\n ha-card[fill] .graph__legend {\n order: -1;\n padding: 0 16px 8px 16px;\n }\n ha-card[fill] .info {\n padding-bottom: 16px;\n }\n ha-card[group] {\n box-shadow: none;\n padding: 0;\n }\n ha-card[group] > div {\n padding-left: 0;\n padding-right: 0;\n }\n ha-card[group] .graph__legend {\n padding-left: 0;\n padding-right: 0;\n }\n ha-card[hover] {\n cursor: pointer;\n }\n .flex {\n display: flex;\n display: -webkit-flex;\n min-width: 0;\n }\n .header {\n justify-content: space-between;\n }\n .header[loc=\"center\"] {\n justify-content: space-around;\n }\n .header[loc=\"left\"] {\n align-self: flex-start;\n }\n .header[loc=\"right\"] {\n align-self: flex-end;\n }\n .name {\n align-items: center;\n min-width: 0;\n letter-spacing: var(--mcg-title-letter-spacing, normal);\n }\n .name > span {\n font-size: 1.2em;\n font-weight: var(--mcg-title-font-weight, 500);\n max-height: 1.4em;\n min-height: 1.4em;\n opacity: .65;\n }\n .icon {\n color: var(--paper-item-icon-color, #44739e);\n display: inline-block;\n flex: 0 0 1.7em;\n text-align: center;\n }\n .icon > ha-icon {\n height: 1.7em;\n width: 1.7em;\n }\n .icon[loc=\"left\"] {\n order: -1;\n margin-right: .6em;\n margin-left: 0;\n }\n .icon[loc=\"state\"] {\n align-self: center;\n }\n .states {\n align-items: flex-start;\n font-weight: 300;\n justify-content: space-between;\n flex-wrap: nowrap;\n }\n .states .icon {\n align-self: center;\n margin-left: 0;\n }\n .states[loc=\"center\"] {\n justify-content: space-evenly;\n }\n .states[loc=\"right\"] > .state {\n margin-left: auto;\n order: 2;\n }\n .states[loc=\"center\"] .states--secondary,\n .states[loc=\"right\"] .states--secondary {\n margin-left: 0;\n }\n .states[loc=\"center\"] .states--secondary {\n align-items: center;\n }\n .states[loc=\"right\"] .states--secondary {\n align-items: flex-start;\n }\n .states[loc=\"center\"] .state__time {\n left: 50%;\n transform: translateX(-50%);\n }\n .states > .icon > ha-icon {\n height: 2em !important;\n width: 2em !important;\n }\n .states--secondary {\n display: flex;\n flex-flow: column;\n flex-wrap: wrap;\n align-items: flex-end;\n margin-left: 1rem;\n min-width: 0;\n margin-left: 1.4em;\n }\n .states--secondary:empty {\n display: none;\n }\n .state {\n position: relative;\n display: flex;\n flex-wrap: nowrap;\n max-width: 100%;\n min-width: 0;\n }\n .state--small {\n font-size: .6em;\n margin-bottom: .6rem;\n flex-wrap: nowrap;\n }\n .state--small > svg {\n position: absolute;\n left: -1.6em;\n align-self: center;\n height: 1em;\n width: 1em;\n border-radius: 100%;\n margin-right: 1em;\n }\n .state--small:last-child {\n margin-bottom: 0;\n }\n .states--secondary > :only-child {\n font-size: 1em;\n margin-bottom: 0;\n }\n .states--secondary > :only-child svg {\n display: none;\n }\n .state__value {\n display: inline-block;\n font-size: 2.4em;\n margin-right: .25rem;\n line-height: 1.2em;\n }\n .state__uom {\n flex: 1;\n align-self: flex-end;\n display: inline-block;\n font-size: 1.4em;\n font-weight: 400;\n line-height: 1.6em;\n margin-top: .1em;\n opacity: .6;\n vertical-align: bottom;\n }\n .state--small .state__uom {\n flex: 1;\n }\n .state__time {\n font-size: .95rem;\n font-weight: 500;\n bottom: -1.1rem;\n left: 0;\n opacity: .75;\n position: absolute;\n white-space: nowrap;\n animation: fade .15s cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n .states[loc=\"right\"] .state__time {\n left: initial;\n right: 0;\n }\n .graph {\n align-self: flex-end;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n margin-top: auto;\n width: 100%;\n }\n .graph__container {\n display: flex;\n flex-direction: row;\n position: relative;\n }\n .graph__container__svg {\n cursor: default;\n flex: 1;\n }\n svg {\n overflow: hidden;\n display: block;\n }\n path {\n stroke-linecap: round;\n stroke-linejoin: round;\n }\n .fill[anim=\"false\"] {\n animation: reveal .25s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .fill[anim=\"false\"][type=\"fade\"] {\n animation: reveal-2 .25s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .line--points[anim=\"false\"],\n .line[anim=\"false\"] {\n animation: pop .25s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .line--points[inactive],\n .line--rect[inactive],\n .fill--rect[inactive] {\n opacity: 0 !important;\n animation: none !important;\n transition: all .15s !important;\n }\n .line--points[tooltip] .line--point[inactive] {\n opacity: 0;\n }\n .line--point {\n cursor: pointer;\n fill: var(--primary-background-color, white);\n stroke-width: inherit;\n }\n .line--point:hover {\n fill: var(--mcg-hover, inherit) !important;\n }\n .bars {\n animation: pop .25s cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n .bars[anim] {\n animation: bars .5s cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n .bar {\n transition: opacity .25s cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n .bar:hover {\n opacity: .5;\n cursor: pointer;\n }\n ha-card[gradient] .line--point:hover {\n fill: var(--primary-text-color, white);\n }\n path,\n .line--points,\n .fill {\n opacity: 0;\n }\n .line--points[anim=\"true\"][init] {\n animation: pop .5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .fill[anim=\"true\"][init] {\n animation: reveal .5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .fill[anim=\"true\"][init][type=\"fade\"] {\n animation: reveal-2 .5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .line[anim=\"true\"][init] {\n animation: dash 1s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;\n }\n .graph__labels.--secondary {\n right: 0;\n margin-right: 0px;\n align-items: flex-end;\n }\n .graph__labels {\n align-items: flex-start;\n flex-direction: column;\n font-size: calc(.15em + 8.5px);\n font-weight: 400;\n justify-content: space-between;\n margin-right: 10px;\n padding: .6em;\n position: absolute;\n pointer-events: none;\n top: 0; bottom: 0;\n opacity: .75;\n }\n .graph__labels > span {\n cursor: pointer;\n background: var(--primary-background-color, white);\n border-radius: 1em;\n padding: .2em .6em;\n box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);\n }\n .graph__legend {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n padding-top: 16px;\n flex-wrap: wrap;\n }\n .graph__legend__item {\n cursor: pointer;\n display: flex;\n min-width: 0;\n margin: .4em;\n align-items: center\n }\n .graph__legend__item span {\n opacity: .75;\n margin-left: .4em;\n }\n .graph__legend__item svg {\n border-radius: 100%;\n min-width: 10px;\n }\n .info {\n justify-content: space-between;\n align-items: middle;\n }\n .info__item {\n display: flex;\n flex-flow: column;\n text-align: center;\n }\n .info__item:last-child {\n align-items: flex-end;\n text-align: right;\n }\n .info__item:first-child {\n align-items: flex-start;\n text-align: left;\n }\n .info__item__type {\n text-transform: capitalize;\n font-weight: 500;\n opacity: .9;\n }\n .info__item__time,\n .info__item__value {\n opacity: .75;\n }\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n @keyframes fade {\n 0% { opacity: 0; }\n }\n @keyframes reveal {\n 0% { opacity: 0; }\n 100% { opacity: .15; }\n }\n @keyframes reveal-2 {\n 0% { opacity: 0; }\n 100% { opacity: .4; }\n }\n @keyframes pop {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n @keyframes bars {\n 0% { opacity: 0; }\n 50% { opacity: 0; }\n 100% { opacity: 1; }\n }\n @keyframes dash {\n 0% {\n opacity: 0;\n }\n 25% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n stroke-dashoffset: 0;\n }\n }"]);return M=function(){return a},a}function N(a,b){return b||(b=a.slice(0)),Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(b)}}))}function O(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function P(a){for(var b,c=1;ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.parentNode.removeChild(a))}function R(a,b){var c=2=b.oldVersion&&c.createObjectStore("local-forage-detect-blob-support")}catch(c){if("ConstraintError"===c.name)console.warn("The database \""+a.name+"\" has been upgraded from version "+b.oldVersion+" to version "+b.newVersion+", but the storage \""+a.storeName+"\" already exists.");else throw c}}),f.onerror=function(a){a.preventDefault(),d(f.error)},f.onsuccess=function(){c(f.result),fa(a)}})}function ia(a){return ha(a,!1)}function ja(a){return ha(a,!0)}function ka(a,b){if(!a.db)return!0;var c=!a.db.objectStoreNames.contains(a.storeName),d=a.versiona.db.version;if(d&&(a.version!==b&&console.warn("The database \""+a.name+"\" can't be downgraded from version "+a.db.version+" to version "+a.version+"."),a.version=a.db.version),e||c){if(c){var f=a.db.version+1;f>a.version&&(a.version=f)}return!0}return!1}function la(a){return new ec(function(b,c){var d=new FileReader;d.onerror=c,d.onloadend=function(c){var d=btoa(c.target.result||"");b({__local_forage_encoded_blob:!0,data:d,type:a.type})},d.readAsBinaryString(a)})}function ma(a){var b=ba(atob(a.data));return W([b],{type:a.type})}function na(a){return a&&a.__local_forage_encoded_blob}function oa(a){var b=this,c=b._initReady().then(function(){var a=fc[b._dbInfo.name];if(a&&a.dbReady)return a.dbReady});return $(c,a,a),c}function pa(a){ea(a);for(var b,c=fc[a.name],d=c.forages,e=0;e(a.db=b,ka(a)?ja(a):b)).then(b=>{a.db=c.db=b;for(var e=0;e{throw ga(a,b),b})}function qa(a,b,c,d){d===void 0&&(d=1);try{var e=a.db.transaction(a.storeName,b);c(null,e)}catch(e){if(0{if(!a.db||"NotFoundError"===e.name&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),ja(a)}).then(()=>pa(a).then(function(){qa(a,b,c,d-1)})).catch(c);c(e)}}function ra(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function sa(a){var b,c,d,e,f,g=.75*a.length,h=a.length,j=0;"="===a[a.length-1]&&(g--,"="===a[a.length-2]&&g--);var k=new ArrayBuffer(g),l=new Uint8Array(k);for(b=0;b>4,l[j++]=(15&d)<<4|e>>2,l[j++]=(3&e)<<6|63&f;return k}function ta(a){var b,c=new Uint8Array(a),d="";for(b=0;b>2],d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&c[b])<<4|c[b+1]>>4],d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&c[b+1])<<2|c[b+2]>>6],d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&c[b+2]];return 2==c.length%3?d=d.substring(0,d.length-1)+"=":1==c.length%3&&(d=d.substring(0,d.length-2)+"=="),d}function ua(a,b,c,d){a.executeSql("CREATE TABLE IF NOT EXISTS ".concat(b.storeName," ")+"(id INTEGER PRIMARY KEY, key unique, value)",[],c,d)}function va(a,b,c,d,e,f){a.executeSql(c,d,e,function(a,g){g.code===g.SYNTAX_ERR?a.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[b.storeName],function(a,h){h.rows.length?f(a,g):ua(a,b,function(){a.executeSql(c,d,e,f)},f)},f):f(a,g)},f)}function wa(a,b,c,d){var e=this;a=_(a);var f=new ec(function(f,g){e.ready().then(function(){void 0===b&&(b=null);var h=b,i=e._dbInfo;i.serializer.serialize(b,function(b,j){j?g(j):i.db.transaction(function(c){va(c,i,"INSERT OR REPLACE INTO ".concat(i.storeName," ")+"(key, value) VALUES (?, ?)",[a,b],function(){f(h)},function(a,b){g(b)})},function(b){if(b.code===b.QUOTA_ERR){if(0 '__WebKitDatabaseInfoTable__'",[],function(c,d){for(var e=[],f=0;f"),Xa=new RegExp("".concat(Va,"|").concat(Wa)),Ya="$lit$";class Za{constructor(a,b){this.parts=[],this.element=b;for(var c,d=[],e=[],f=document.createTreeWalker(b.content,133,null,!1),g=0,h=-1,j=0,{strings:k,values:{length:l}}=a;j{var c=a.length-b.length;return 0<=c&&a.slice(c)===b},ab=a=>-1!==a.index,bb=()=>document.createComment(""),cb=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,db=a=>{for(var b=11===a.nodeType?0:1,c=document.createTreeWalker(a,133,null,!1);c.nextNode();)b++;return b},eb=function(a){for(var b,c=1"function"==typeof a&&fb.has(a),hb={},ib={};class jb{constructor(a,b,c){this.__parts=[],this.template=a,this.processor=b,this.options=c}update(a){var b=0;for(var c of this.__parts)void 0!==c&&c.setValue(a[b]),b++;for(var d of this.__parts)void 0!==d&&d.commit()}_clone(){for(var a,b=Sa?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),c=[],d=this.template.parts,e=document.createTreeWalker(b,133,null,!1),f=0,g=0,h=e.nextNode();fa}),lb=" ".concat(Va," ");class mb{constructor(a,b,c,d){this.strings=a,this.values=b,this.type=c,this.processor=d}getHTML(){for(var a=this.strings.length-1,b="",c=!1,d=0;d",f+1);var g=cb.exec(e);b+=null===g?e+(c?lb:Wa):e.substr(0,g.index)+g[1]+g[2]+Ya+g[3]+Va}return b+=this.strings[a],b}getTemplateElement(){var a=document.createElement("template"),b=this.getHTML();return void 0!==kb&&(b=kb.createHTML(b)),a.innerHTML=b,a}}class nb extends mb{getHTML(){return"".concat(super.getHTML(),"")}getTemplateElement(){var a=super.getTemplateElement(),b=a.content,c=b.firstChild;return b.removeChild(c),Ta(b,c.firstChild),a}}var ob=a=>null===a||"object"!=typeof a&&"function"!=typeof a,pb=a=>Array.isArray(a)||!!(a&&a[Symbol.iterator]);class qb{constructor(a,b,c){this.dirty=!0,this.element=a,this.name=b,this.strings=c,this.parts=[];for(var d=0;d{try{var a={get capture(){return wb=!0,!1}};window.addEventListener("test",a,a),window.removeEventListener("test",a,a)}catch(a){}})();class xb{constructor(a,b,c){this.value=void 0,this.__pendingValue=void 0,this.element=a,this.eventName=b,this.eventContext=c,this.__boundHandleEvent=a=>this.handleEvent(a)}setValue(a){this.__pendingValue=a}commit(){for(;gb(this.__pendingValue);){var d=this.__pendingValue;this.__pendingValue=hb,d(this)}if(this.__pendingValue!==hb){var a=this.__pendingValue,b=this.value,c=null==a||null!=b&&(a.capture!==b.capture||a.once!==b.once||a.passive!==b.passive);c&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),null!=a&&(null==b||c)&&(this.__options=yb(a),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=a,this.__pendingValue=hb}}handleEvent(a){"function"==typeof this.value?this.value.call(this.eventContext||this.element,a):this.value.handleEvent(a)}}var yb=a=>a&&(wb?{capture:a.capture,passive:a.passive,once:a.once}:a.capture),zb=new Map,Ab=new WeakMap,Bb=(a,b,c)=>{var d=Ab.get(b);d===void 0&&(Ua(b,b.firstChild),Ab.set(b,d=new sb(Object.assign({templateFactory:U},c))),d.appendInto(b)),d.setValue(a),d.commit()};var Cb=new class a{handleAttributeExpressions(a,b,c,d){var e=b[0];if("."===e){var g=new ub(a,b.slice(1),c);return g.parts}if("@"===e)return[new xb(a,b.slice(1),d.eventContext)];if("?"===e)return[new tb(a,b.slice(1),c)];var f=new qb(a,b,c);return f.parts}handleTextExpression(a){return new sb(a)}};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");var Db=function(a){for(var b=arguments.length,c=Array(1"".concat(a,"--").concat(b),Gb=!0;"undefined"==typeof window.ShadyCSS?Gb=!1:"undefined"==typeof window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),Gb=!1);var Hb,Ib=a=>b=>{var c=Fb(b.type,a),d=zb.get(c);void 0===d&&(d={stringsArray:new WeakMap,keyString:new Map},zb.set(c,d));var e=d.stringsArray.get(b.strings);if(void 0!==e)return e;var f=b.strings.join(Va);if(e=d.keyString.get(f),void 0===e){var g=b.getTemplateElement();Gb&&window.ShadyCSS.prepareTemplateDom(g,a),e=new Za(b,g),d.keyString.set(f,e)}return d.stringsArray.set(b.strings,e),e},Jb=["html","svg"],Kb=a=>{Jb.forEach(b=>{var c=zb.get(Fb(b,a));c!==void 0&&c.keyString.forEach(a=>{var{element:{content:b}}=a,c=new Set;Array.from(b.querySelectorAll("style")).forEach(a=>{c.add(a)}),i(a,c)})})},Lb=new Set,Mb=(a,b,c)=>{Lb.add(a);var d=!c?document.createElement("template"):c.element,e=b.querySelectorAll("style"),{length:f}=e;if(0===f)return void window.ShadyCSS.prepareTemplateStyles(d,a);for(var g,h=document.createElement("style"),j=0;j{if(!c||"object"!=typeof c||!c.scopeName)throw new Error("The `scopeName` option is required.");var d=c.scopeName,e=Ab.has(b),f=Gb&&11===b.nodeType&&!!b.host,g=f&&!Lb.has(d),h=g?document.createDocumentFragment():b;if(Bb(a,h,Object.assign({templateFactory:Ib(d)},c)),g){var i=Ab.get(h);Ab.delete(h);var j=i.value instanceof jb?i.value.template:void 0;Mb(d,h,j),Ua(b,b.firstChild),b.appendChild(h),Ab.set(b,i)}!e&&f&&window.ShadyCSS.styleElement(b.host)};window.JSCompiler_renameProperty=a=>a;var Ob={toAttribute(a,b){return b===Boolean?a?"":null:b===Object||b===Array?null==a?a:JSON.stringify(a):a},fromAttribute(a,b){return b===Boolean?null!==a:b===Number?null===a?null:+a:b===Object||b===Array?JSON.parse(a):a}},Pb=(a,b)=>b!==a&&(b===b||a===a),Qb={attribute:!0,type:String,converter:Ob,reflect:!1,hasChanged:Pb},Rb=1,Sb=4,Tb=8,Ub=16,Vb="finalized";class Wb extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();var a=[];return this._classProperties.forEach((b,c)=>{var d=this._attributeNameForProperty(c,b);void 0!==d&&(this._attributeToPropertyMap.set(d,c),a.push(d))}),a}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var a=Object.getPrototypeOf(this)._classProperties;a!==void 0&&a.forEach((a,b)=>this._classProperties.set(b,a))}}static createProperty(a){var b=1this._enableUpdatingResolver=a),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((a,b)=>{if(this.hasOwnProperty(b)){var c=this[b];delete this[b],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(b,c)}})}_applyInstanceProperties(){this._instanceProperties.forEach((a,b)=>this[b]=a),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){this._enableUpdatingResolver!==void 0&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(a,b,c){b!==c&&this._attributeToProperty(a,c)}_propertyToAttribute(a,b){var c=2this._propertyToAttribute(b,this[b],a)),this._reflectingProperties=void 0),this._markUpdated()}updated(){}firstUpdated(){}}Hb=Vb,Wb[Hb]=!0;var Xb=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yb=Symbol();class Zb{constructor(a,b){if(b!==Yb)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=a}get styleSheet(){return void 0===this._styleSheet&&(Xb?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}var $b=a=>new Zb(a+"",Yb),_b=a=>{if(a instanceof Zb)return a.cssText;if("number"==typeof a)return a;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(a,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))};(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");var ac={};class bc extends Wb{static getStyles(){return this.styles}static _getUniqueStyles(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_styles",this))){var a=this.getStyles();if(Array.isArray(a)){var b=(a,c)=>a.reduceRight((a,c)=>Array.isArray(c)?b(c,a):(a.add(c),a),c),c=b(a,new Set),d=[];c.forEach(a=>d.unshift(a)),this._styles=d}else this._styles=void 0===a?[]:[a];this._styles=this._styles.map(a=>{if(a instanceof CSSStyleSheet&&!Xb){var b=Array.prototype.slice.call(a.cssRules).reduce((a,b)=>a+b.cssText,"");return $b(b)}return a})}}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){var a=this.constructor._styles;0===a.length||(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow?Xb?this.renderRoot.adoptedStyleSheets=a.map(a=>a instanceof CSSStyleSheet?a:a.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(a.map(a=>a.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&window.ShadyCSS!==void 0&&window.ShadyCSS.styleElement(this)}update(a){var b=this.render();super.update(a),b!==ac&&this.constructor.render(b,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(a=>{var b=document.createElement("style");b.textContent=a.cssText,this.renderRoot.appendChild(b)}))}render(){return ac}}bc.finalized=!0,bc.render=Nb;var cc=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(a){}}();"undefined"==typeof Promise&&require("lie/polyfill");var dc,ec=Promise,fc={},gc=Object.prototype.toString,hc={_driver:"asyncStorage",_initStorage:function(a){function b(){return ec.resolve()}var c=this,d={db:null};if(a)for(var e in a)d[e]=a[e];var f=fc[d.name];f||(f=ra(),fc[d.name]=f),f.forages.push(c),c._initReady||(c._initReady=c.ready,c.ready=oa);for(var g,h=[],i=0;ia?void b(null):void c.ready().then(function(){qa(c._dbInfo,"readonly",function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=!1,i=g.openKeyCursor();i.onsuccess=function(){var c=i.result;return c?void(0===a?b(c.key):h?b(c.key):(h=!0,c.advance(a))):void b(null)},i.onerror=function(){d(i.error)}}catch(a){d(a)}})}).catch(d)});return Z(d,b),d},keys:function(a){var b=this,c=new ec(function(a,c){b.ready().then(function(){qa(b._dbInfo,"readonly",function(d,e){if(d)return c(d);try{var f=e.objectStore(b._dbInfo.storeName),g=f.openKeyCursor(),h=[];g.onsuccess=function(){var b=g.result;return b?void(h.push(b.key),b.continue()):void a(h)},g.onerror=function(){c(g.error)}}catch(a){c(a)}})}).catch(c)});return Z(c,a),c},dropInstance:function(a,b){b=aa.apply(this,arguments);var c=this.config();a="function"!=typeof a&&a||{},a.name||(a.name=a.name||c.name,a.storeName=a.storeName||c.storeName);var d,e=this;if(!a.name)d=ec.reject("Invalid arguments");else{var f=a.name===c.name&&e._dbInfo.db,g=f?ec.resolve(e._dbInfo.db):ia(a).then(b=>{var c=fc[a.name],d=c.forages;c.db=b;for(var e=0;e{if(b.objectStoreNames.contains(a.storeName)){var c=b.version+1;ea(a);var d=fc[a.name],e=d.forages;b.close();for(var g,h=0;h{var e=cc.open(a.name,c);e.onerror=a=>{var b=e.result;b.close(),d(a)},e.onupgradeneeded=()=>{var b=e.result;b.deleteObjectStore(a.storeName)},e.onsuccess=()=>{var a=e.result;a.close(),b(a)}});return f.then(a=>{d.db=a;for(var b,c=0;c{throw(ga(a,b)||ec.resolve()).catch(()=>{}),b})}}):g.then(b=>{ea(a);var c=fc[a.name],d=c.forages;b.close();for(var e,f=0;f{var d=cc.deleteDatabase(a.name);d.onerror=d.onblocked=a=>{var b=d.result;b&&b.close(),c(a)},d.onsuccess=()=>{var a=d.result;a&&a.close(),b(a)}});return g.then(a=>{c.db=a;for(var b,e=0;e{throw(ga(a,b)||ec.resolve()).catch(()=>{}),b})})}return Z(d,b),d}},ic=/^~~local_forage_type~([^~]+)~/,jc="__lfsc__:".length,kc=jc+"arbf".length,lc=Object.prototype.toString,mc={serialize:function(a,b){var c="";if(a&&(c=lc.call(a)),a&&("[object ArrayBuffer]"===c||a.buffer&&"[object ArrayBuffer]"===lc.call(a.buffer))){var d,e="__lfsc__:";a instanceof ArrayBuffer?(d=a,e+="arbf"):(d=a.buffer,"[object Int8Array]"===c?e+="si08":"[object Uint8Array]"===c?e+="ui08":"[object Uint8ClampedArray]"===c?e+="uic8":"[object Int16Array]"===c?e+="si16":"[object Uint16Array]"===c?e+="ur16":"[object Int32Array]"===c?e+="si32":"[object Uint32Array]"===c?e+="ui32":"[object Float32Array]"===c?e+="fl32":"[object Float64Array]"===c?e+="fl64":b(new Error("Failed to get type for BinaryArray"))),b(e+ta(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var c="~~local_forage_type~"+a.type+"~"+ta(this.result);b("__lfsc__:blob"+c)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(c){console.error("Couldn't convert value into a JSON string: ",a),b(null,c)}},deserialize:function(a){if(a.substring(0,jc)!=="__lfsc__:")return JSON.parse(a);var b,c=a.substring(kc),d=a.substring(jc,kc);if(d==="blob"&&ic.test(c)){var e=c.match(ic);b=e[1],c=c.substring(e[0].length)}var f=sa(c);switch(d){case"arbf":return f;case"blob":return W([f],{type:b});case"si08":return new Int8Array(f);case"ui08":return new Uint8Array(f);case"uic8":return new Uint8ClampedArray(f);case"si16":return new Int16Array(f);case"ur16":return new Uint16Array(f);case"si32":return new Int32Array(f);case"ui32":return new Uint32Array(f);case"fl32":return new Float32Array(f);case"fl64":return new Float64Array(f);default:throw new Error("Unkown type: "+d);}},stringToBuffer:sa,bufferToString:ta},nc={_driver:"webSQLStorage",_initStorage:function(a){var b=this,c={db:null};if(a)for(var d in a)c[d]="string"==typeof a[d]?a[d]:a[d].toString();var e=new ec(function(a,d){try{c.db=openDatabase(c.name,c.version+"",c.description,c.size)}catch(a){return d(a)}c.db.transaction(function(e){ua(e,c,function(){b._dbInfo=c,a()},function(a,b){d(b)})},d)});return c.serializer=mc,e},_support:function(){return"function"==typeof openDatabase}(),iterate:function(a,b){var c=this,d=new ec(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){va(c,e,"SELECT * FROM ".concat(e.storeName),[],function(c,d){for(var f=d.rows,g=f.length,h=0;ha===b||"number"==typeof a&&"number"==typeof b&&isNaN(a)&&isNaN(b),qc=(a,b)=>{for(var c=a.length,d=0;d{})}config(a){if("object"==typeof a){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a){if("storeName"==b&&(a[b]=a[b].replace(/\W/g,"_")),"version"==b&&"number"!=typeof a[b])return new Error("Database version must be a number.");this._config[b]=a[b]}return!("driver"in a&&a.driver)||this.setDriver(this._config.driver)}return"string"==typeof a?this._config[a]:this._config}defineDriver(a,b,c){var d=new ec(function(b,c){try{var d=a._driver,e=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!a._driver)return void c(e);for(var f=xc.concat("_initStorage"),g=0,h=f.length;g(null===b._ready&&(b._ready=b._initDriver()),b._ready));return $(c,a,a),c}setDriver(a,b,c){function d(){g._config.driver=g.driver()}function e(a){return g._extend(a),d(),g._ready=g._initStorage(g._config),g._ready}function f(a){return function(){function b(){for(;cec.resolve());return this._driverSet=i.then(()=>{var a=h[0];return g._dbInfo=null,g._ready=null,g.getDriver(a).then(a=>{g._driver=a._driver,d(),g._wrapLibraryMethodsWithReady(),g._initDriver=f(h)})}).catch(()=>{d();var a=new Error("No available storage method found.");return g._driverSet=ec.reject(a),g._driverSet}),$(this._driverSet,b,c),this._driverSet}supports(a){return!!tc[a]}_extend(a){Da(this,a)}_getSupportedDrivers(a){for(var b,c=[],d=0,e=a.length;da.getHours()?b.amPm[0]:b.amPm[1]},A:function(a,b){return 12>a.getHours()?b.amPm[0].toUpperCase():b.amPm[1].toUpperCase()},ZZ:function(a){var b=a.getTimezoneOffset();return(0=a?"hass:battery-alert":"hass:battery-"+a}var e=b.attributes.unit_of_measurement;return"\xB0C"===e||"\xB0F"===e?"hass:thermometer":Ia("sensor")},input_datetime:function(a){return a.attributes.has_date?a.attributes.has_time?Ia("input_datetime"):"hass:calendar":"hass:clock"}},dd=function(a){if(!a)return"hass:bookmark";if(a.attributes.icon)return a.attributes.icon;var b=Ha(a.entity_id);return b in cd?cd[b](a):Ia(b,a.state)},Q=function(a){var b={exports:{}};return a(b,b.exports),b.exports}(function(a){(function(b){a.exports=b()})(function(a){function b(e,f){var g=e[0],h=e[1],i=e[2],j=e[3];g+=0|(h&i|~h&j)+f[0]-680876936,g=0|(g<<7|g>>>25)+h,j+=0|(g&h|~g&i)+f[1]-389564586,j=0|(j<<12|j>>>20)+g,i+=0|(j&g|~j&h)+f[2]+606105819,i=0|(i<<17|i>>>15)+j,h+=0|(i&j|~i&g)+f[3]-1044525330,h=0|(h<<22|h>>>10)+i,g+=0|(h&i|~h&j)+f[4]-176418897,g=0|(g<<7|g>>>25)+h,j+=0|(g&h|~g&i)+f[5]+1200080426,j=0|(j<<12|j>>>20)+g,i+=0|(j&g|~j&h)+f[6]-1473231341,i=0|(i<<17|i>>>15)+j,h+=0|(i&j|~i&g)+f[7]-45705983,h=0|(h<<22|h>>>10)+i,g+=0|(h&i|~h&j)+f[8]+1770035416,g=0|(g<<7|g>>>25)+h,j+=0|(g&h|~g&i)+f[9]-1958414417,j=0|(j<<12|j>>>20)+g,i+=0|(j&g|~j&h)+f[10]-42063,i=0|(i<<17|i>>>15)+j,h+=0|(i&j|~i&g)+f[11]-1990404162,h=0|(h<<22|h>>>10)+i,g+=0|(h&i|~h&j)+f[12]+1804603682,g=0|(g<<7|g>>>25)+h,j+=0|(g&h|~g&i)+f[13]-40341101,j=0|(j<<12|j>>>20)+g,i+=0|(j&g|~j&h)+f[14]-1502002290,i=0|(i<<17|i>>>15)+j,h+=0|(i&j|~i&g)+f[15]+1236535329,h=0|(h<<22|h>>>10)+i,g+=0|(h&j|i&~j)+f[1]-165796510,g=0|(g<<5|g>>>27)+h,j+=0|(g&i|h&~i)+f[6]-1069501632,j=0|(j<<9|j>>>23)+g,i+=0|(j&h|g&~h)+f[11]+643717713,i=0|(i<<14|i>>>18)+j,h+=0|(i&g|j&~g)+f[0]-373897302,h=0|(h<<20|h>>>12)+i,g+=0|(h&j|i&~j)+f[5]-701558691,g=0|(g<<5|g>>>27)+h,j+=0|(g&i|h&~i)+f[10]+38016083,j=0|(j<<9|j>>>23)+g,i+=0|(j&h|g&~h)+f[15]-660478335,i=0|(i<<14|i>>>18)+j,h+=0|(i&g|j&~g)+f[4]-405537848,h=0|(h<<20|h>>>12)+i,g+=0|(h&j|i&~j)+f[9]+568446438,g=0|(g<<5|g>>>27)+h,j+=0|(g&i|h&~i)+f[14]-1019803690,j=0|(j<<9|j>>>23)+g,i+=0|(j&h|g&~h)+f[3]-187363961,i=0|(i<<14|i>>>18)+j,h+=0|(i&g|j&~g)+f[8]+1163531501,h=0|(h<<20|h>>>12)+i,g+=0|(h&j|i&~j)+f[13]-1444681467,g=0|(g<<5|g>>>27)+h,j+=0|(g&i|h&~i)+f[2]-51403784,j=0|(j<<9|j>>>23)+g,i+=0|(j&h|g&~h)+f[7]+1735328473,i=0|(i<<14|i>>>18)+j,h+=0|(i&g|j&~g)+f[12]-1926607734,h=0|(h<<20|h>>>12)+i,g+=0|(h^i^j)+f[5]-378558,g=0|(g<<4|g>>>28)+h,j+=0|(g^h^i)+f[8]-2022574463,j=0|(j<<11|j>>>21)+g,i+=0|(j^g^h)+f[11]+1839030562,i=0|(i<<16|i>>>16)+j,h+=0|(i^j^g)+f[14]-35309556,h=0|(h<<23|h>>>9)+i,g+=0|(h^i^j)+f[1]-1530992060,g=0|(g<<4|g>>>28)+h,j+=0|(g^h^i)+f[4]+1272893353,j=0|(j<<11|j>>>21)+g,i+=0|(j^g^h)+f[7]-155497632,i=0|(i<<16|i>>>16)+j,h+=0|(i^j^g)+f[10]-1094730640,h=0|(h<<23|h>>>9)+i,g+=0|(h^i^j)+f[13]+681279174,g=0|(g<<4|g>>>28)+h,j+=0|(g^h^i)+f[0]-358537222,j=0|(j<<11|j>>>21)+g,i+=0|(j^g^h)+f[3]-722521979,i=0|(i<<16|i>>>16)+j,h+=0|(i^j^g)+f[6]+76029189,h=0|(h<<23|h>>>9)+i,g+=0|(h^i^j)+f[9]-640364487,g=0|(g<<4|g>>>28)+h,j+=0|(g^h^i)+f[12]-421815835,j=0|(j<<11|j>>>21)+g,i+=0|(j^g^h)+f[15]+530742520,i=0|(i<<16|i>>>16)+j,h+=0|(i^j^g)+f[2]-995338651,h=0|(h<<23|h>>>9)+i,g+=0|(i^(h|~j))+f[0]-198630844,g=0|(g<<6|g>>>26)+h,j+=0|(h^(g|~i))+f[7]+1126891415,j=0|(j<<10|j>>>22)+g,i+=0|(g^(j|~h))+f[14]-1416354905,i=0|(i<<15|i>>>17)+j,h+=0|(j^(i|~g))+f[5]-57434055,h=0|(h<<21|h>>>11)+i,g+=0|(i^(h|~j))+f[12]+1700485571,g=0|(g<<6|g>>>26)+h,j+=0|(h^(g|~i))+f[3]-1894986606,j=0|(j<<10|j>>>22)+g,i+=0|(g^(j|~h))+f[10]-1051523,i=0|(i<<15|i>>>17)+j,h+=0|(j^(i|~g))+f[1]-2054922799,h=0|(h<<21|h>>>11)+i,g+=0|(i^(h|~j))+f[8]+1873313359,g=0|(g<<6|g>>>26)+h,j+=0|(h^(g|~i))+f[15]-30611744,j=0|(j<<10|j>>>22)+g,i+=0|(g^(j|~h))+f[6]-1560198380,i=0|(i<<15|i>>>17)+j,h+=0|(j^(i|~g))+f[13]+1309151649,h=0|(h<<21|h>>>11)+i,g+=0|(i^(h|~j))+f[4]-145523070,g=0|(g<<6|g>>>26)+h,j+=0|(h^(g|~i))+f[11]-1120210379,j=0|(j<<10|j>>>22)+g,i+=0|(g^(j|~h))+f[2]+718787259,i=0|(i<<15|i>>>17)+j,h+=0|(j^(i|~g))+f[9]-343485551,h=0|(h<<21|h>>>11)+i,e[0]=0|g+e[0],e[1]=0|h+e[1],e[2]=0|i+e[2],e[3]=0|j+e[3]}function c(a){var b,c=[];for(b=0;64>b;b+=4)c[b>>2]=a.charCodeAt(b)+(a.charCodeAt(b+1)<<8)+(a.charCodeAt(b+2)<<16)+(a.charCodeAt(b+3)<<24);return c}function d(b){var a,c=[];for(a=0;64>a;a+=4)c[a>>2]=b[a]+(b[a+1]<<8)+(b[a+2]<<16)+(b[a+3]<<24);return c}function e(a){var d,e,f,g,h,j,k=a.length,l=[1732584193,-271733879,-1732584194,271733878];for(d=64;d<=k;d+=64)b(l,c(a.substring(d-64,d)));for(a=a.substring(d-64),e=a.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=0;d>2]|=a.charCodeAt(d)<<(d%4<<3);if(f[d>>2]|=128<<(d%4<<3),55d;d+=1)f[d]=0;return g=8*k,g=g.toString(16).match(/(.*?)(.{0,8})$/),h=parseInt(g[2],16),j=parseInt(g[1],16)||0,f[14]=h,f[15]=j,b(l,f),l}function f(c){var e,f,g,h,j,k,l=c.length,m=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=l;e+=64)b(m,d(c.subarray(e-64,e)));for(c=e-64>2]|=c[e]<<(e%4<<3);if(g[e>>2]|=128<<(e%4<<3),55e;e+=1)g[e]=0;return h=8*l,h=h.toString(16).match(/(.*?)(.{0,8})$/),j=parseInt(h[2],16),k=parseInt(h[1],16)||0,g[14]=j,g[15]=k,b(m,g),m}function g(a){var b,c="";for(b=0;4>b;b+=1)c+=o[15&a>>8*b+4]+o[15&a>>8*b];return c}function h(a){var b;for(b=0;ba?Na(a+b,0):Ma(a,b)}ArrayBuffer.prototype.slice=function(c,d){var e,f,g,h,i=this.byteLength,j=b(c,i),k=i;return(d!==a&&(k=b(d,i)),j>k)?new ArrayBuffer(0):(e=k-j,f=new ArrayBuffer(e),g=new Uint8Array(f),h=new Uint8Array(this,j,e),g.set(h),f)}}(),n.prototype.append=function(a){return this.appendBinary(i(a)),this},n.prototype.appendBinary=function(a){this._buff+=a,this._length+=a.length;var d,e=this._buff.length;for(d=64;d<=e;d+=64)b(this._hash,c(this._buff.substring(d-64,d)));return this._buff=this._buff.substring(d-64),this},n.prototype.end=function(a){var b,c,d=this._buff,e=d.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(b=0;b>2]|=d.charCodeAt(b)<<(b%4<<3);return this._finish(f,e),c=h(this._hash),a&&(c=m(c)),this.reset(),c},n.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},n.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},n.prototype.setState=function(a){return this._buff=a.buff,this._length=a.length,this._hash=a.hash,this},n.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},n.prototype._finish=function(a,c){var d,e,f,g=c;if(a[g>>2]|=128<<(g%4<<3),55g;g+=1)a[g]=0;d=8*this._length,d=d.toString(16).match(/(.*?)(.{0,8})$/),e=parseInt(d[2],16),f=parseInt(d[1],16)||0,a[14]=e,a[15]=f,b(this._hash,a)},n.hash=function(a,b){return n.hashBinary(i(a),b)},n.hashBinary=function(a,b){var c=e(a),d=h(c);return b?m(d):d},n.ArrayBuffer=function(){this.reset()},n.ArrayBuffer.prototype.append=function(a){var c,e=l(this._buff.buffer,a,!0),f=e.length;for(this._length+=a.byteLength,c=64;c<=f;c+=64)b(this._hash,d(e.subarray(c-64,c)));return this._buff=c-64>2]|=d[b]<<(b%4<<3);return this._finish(f,e),c=h(this._hash),a&&(c=m(c)),this.reset(),c},n.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},n.ArrayBuffer.prototype.getState=function(){var a=n.prototype.getState.call(this);return a.buff=k(a.buff),a},n.ArrayBuffer.prototype.setState=function(a){return a.buff=j(a.buff,!0),n.prototype.setState.call(this,a)},n.ArrayBuffer.prototype.destroy=n.prototype.destroy,n.ArrayBuffer.prototype._finish=n.prototype._finish,n.ArrayBuffer.hash=function(a,b){var c=f(new Uint8Array(a)),d=h(c);return b?m(d):d},n})}),ed=Oa,fd=a=>gd(a,16,function(b){return ed(b)}),gd=(a,b,c)=>{if(null==a)return"";var d,e,f,g={},h={},j="",k="",l="",m=2,n=3,o=2,p=[],q=0,r=0;for(f=0;fl.charCodeAt(0)){for(d=0;dd;d++)q=q<<1|1&e,r==b-1?(r=0,p.push(c(q)),q=0):r++,e>>=1}else{for(e=1,d=0;dd;d++)q=q<<1|1&e,r==b-1?(r=0,p.push(c(q)),q=0):r++,e>>=1}m--,0==m&&(m=La(2,o),o++),delete h[l]}else for(e=g[l],d=0;d>=1;m--,0==m&&(m=La(2,o),o++),g[k]=n++,l=j+""}if(""!==l){if(Object.prototype.hasOwnProperty.call(h,l)){if(256>l.charCodeAt(0)){for(d=0;dd;d++)q=q<<1|1&e,r==b-1?(r=0,p.push(c(q)),q=0):r++,e>>=1}else{for(e=1,d=0;dd;d++)q=q<<1|1&e,r==b-1?(r=0,p.push(c(q)),q=0):r++,e>>=1}m--,0==m&&(m=La(2,o),o++),delete h[l]}else for(e=g[l],d=0;d>=1;m--,0==m&&(m=La(2,o),o++)}for(e=2,d=0;d>=1;for(;;)if(q<<=1,r==b-1){p.push(c(q));break}else r++;return p.join("")},hd=a=>null==a?"":""==a?null:id(a.length,32768,function(b){return a.charCodeAt(b)}),id=(a,b,d)=>{var e,f,g,h,j,k,l,m=[],n=4,o=4,p=3,q="",r=[],s={val:d(0),position:b,index:1};for(e=0;3>e;e+=1)m[e]=e;for(g=0,j=La(2,2),k=1;k!=j;)h=s.val&s.position,s.position>>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0a)return"";for(g=0,j=La(2,p),k=1;k!=j;)h=s.val&s.position,s.position>>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0>=1,0==s.position&&(s.position=b,s.val=d(s.index++)),g|=(0a.reduce((a,c)=>+c[b]<+a[b]?c:a,a[0]),kd=(a,b)=>a.reduce((a,c)=>a+ +c[b],0)/a.length,ld=(a,b)=>a.reduce((a,c)=>+c[b]>+a[b]?c:a,a[0]),md=function(a,b){var c=2a*3600*1000,od=(c,a,b)=>{var d=+c.replace("#","0x"),e=d>>16,f=255&d>>8,g=255&d,h=+a.replace("#","0x");return"#".concat((0|16777216+(e+b*((h>>16)-e)<<16)+(f+b*((255&h>>8)-f)<<8)+(g+b*((255&h)-g))).toString(16).slice(1))},pd=a=>fd(JSON.stringify(a)),qd=a=>"string"==typeof a?JSON.parse(hd(a)):a,rd=function(){for(var a=arguments.length,b=Array(a),c=0;c"undefined"!=typeof a)},sd=(c,a)=>c.length===a.length&&c.every((b,c)=>b===a[c]),td=a=>{console.warn("mini-graph-card: ",a)},ud="https://github.com/kalkih/mini-graph-card/blob/master/README.md",vd=14,wd=96,xd={humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",battery:"hass:battery",pressure:"hass:gauge",power:"hass:flash",signal_strength:"hass:wifi",motion:"hass:walk",door:"hass:door-closed",window:"hass:window-closed",presence:"hass:account",light:"hass:lightbulb"},yd=["var(--accent-color)","#3498db","#e74c3c","#9b59b6","#f1c40f","#2ecc71","#1abc9c","#34495e","#e67e22","#7f8c8d","#27ae60","#2980b9","#8e44ad"],zd=["entity","line","length","fill","points","tooltip","abs","config"],Ad={name:!0,icon:!0,state:!0,graph:"line",labels:"hover",labels_secondary:"hover",extrema:!1,legend:!0,fill:!0,points:"hover"},Bd=0,X=1,Y=2,V=3600000;class Cd{constructor(a,b,c){var d=3this._reducer(a,b),[]),c=Ka(this.hours*this.points);b.length=c,this.coords=this._calcPoints(b),this.min=Ma.apply(Math,T(this.coords.map(a=>+a[Y]))),this.max=Na.apply(Math,T(this.coords.map(a=>+a[Y])))}}_reducer(a,b){var c=this._endTime-new Date(b.last_changed).getTime(),d=c/V*this.points-this.hours*this.points;if(0>d){var e=Pa(Qa(d));a[e]||(a[e]=[]),a[e].push(b)}else a[0]=[b];return a}_calcPoints(a){var b=this.width/(this.hours*this.points-1);b=Number.isFinite(b)?b:this.width;for(var c,d=[],e=a.filter(Boolean)[0],f=0;f{var b=this._logarithmic?Ja(Na(1,a[Y])):a[Y],e=this.height-(b-c)/d+2*this.margin[X];return[a[Bd],e,a[Y]]});return e}getPoints(){var{coords:a}=this;if(1===a.length&&(a[1]=[this.width+this.margin[Bd],0,a[0][Y]]),a=this._calcY(this.coords),this._smoothing){var b=a[0];return a.shift(),a.map((a,c)=>{var d=this._midPoint(b[Bd],b[X],a[Bd],a[X]),e=(b[Y]+a[Y])/2;return b=a,[d[Bd],d[X],e,c+1]})}return a.map((a,b)=>[a[Bd],a[X],a[Y],b])}getPath(){var{coords:a}=this;1===a.length&&(a[1]=[this.width+this.margin[Bd],0,a[0][Y]]),a=this._calcY(this.coords);var b,c,d="",e=a[0];return d+="M".concat(e[Bd],",").concat(e[X]),a.forEach(a=>{b=a,c=this._smoothing?this._midPoint(e[Bd],e[X],b[Bd],b[X]):b,d+=" ".concat(c[Bd],",").concat(c[X]),d+=" Q ".concat(b[Bd],",").concat(b[X]),e=b}),d+=" ".concat(b[Bd],",").concat(b[X]),d}computeGradient(a,b){var c=b?Ja(Na(1,this._max))-Ja(Na(1,this._min)):this._max-this._min;return a.map((a,d,e)=>{var f;if(a.value>this._max&&e[d+1]){var h=(this._max-e[d+1].value)/(a.value-e[d+1].value);f=od(e[d+1].color,a.color,h)}else if(a.value=c?0:b?(Ja(Na(1,this._max))-Ja(Na(1,a.value)))*(100/c):(this._max-a.value)*(100/c),{color:f||a.color,offset:g}})}getFill(a){var b=this.height+4*this.margin[X],c=a;return c+=" L ".concat(this.width-2*this.margin[Bd],", ").concat(b),c+=" L ".concat(this.coords[0][Bd],", ").concat(b," z"),c}getBars(a,b){var c=2({x:e*f*b+e*a+c,y:d[X],height:this.height-d[X]+4*this.margin[X],width:e-c,value:d[Y]}))}_midPoint(a,b,c,d){return[(a-c)/2+c,(b-d)/2+d]}_average(a){return a.reduce((a,b)=>a+parseFloat(b.state),0)/a.length}_median(a){var b=T(a).sort((c,a)=>parseFloat(c)-parseFloat(a)),c=Pa((b.length-1)/2);return 1==b.length%2?parseFloat(b[c].state):(parseFloat(b[c].state)+parseFloat(b[c+1].state))/2}_maximum(a){return Na.apply(Math,T(a.map(a=>a.state)))}_minimum(a){return Ma.apply(Math,T(a.map(a=>a.state)))}_first(a){return parseFloat(a[0].state)}_last(a){return parseFloat(a[a.length-1].state)}_sum(a){return a.reduce((a,b)=>a+parseFloat(b.state),0)}_delta(a){return this._maximum(a)-this._minimum(a)}_diff(a){return this._last(a)-this._first(a)}_lastValue(a){return["delta","diff"].includes(this.aggregateFuncName)?0:parseFloat(a[a.length-1].state)||0}_updateEndTime(){switch(this._endTime=new Date,this._groupBy){case"month":this._endTime.setMonth(this._endTime.getMonth()+1),this._endTime.setDate(1);break;case"date":this._endTime.setDate(this._endTime.getDate()+1),this._endTime.setHours(0,0,0,0);break;case"hour":this._endTime.setHours(this._endTime.getHours()+1),this._endTime.setMinutes(0,0,0);}}}var Dd=function css(a){for(var b=arguments.length,c=Array(1b+_b(c)+a[d+1],a[0]);return new Zb(e,Yb)}(M()),Ed=(a,b,c,d,f)=>{var g;switch(d.action){case"more-info":{g=new Event("hass-more-info",{composed:!0}),g.detail={entityId:f},a.dispatchEvent(g);break}case"navigate":{if(!d.navigation_path)return;window.history.pushState(null,"",d.navigation_path),g=new Event("location-changed",{composed:!0}),g.detail={replace:!1},window.dispatchEvent(g);break}case"call-service":{if(!d.service)return;var[h,i]=d.service.split(".",2),j=P({},d.service_data);b.callService(h,i,j);break}case"url":{if(!d.url)return;window.location.href=d.url;break}case"fire-dom-event":{g=new Event("ll-custom",{composed:!0,bubbles:!0}),g.detail=d,a.dispatchEvent(g);break}}},Fd=(a,b)=>{for(var c=b,d=a.length;c{if(!a||!a.length)return a;if(null==a[0].value||null==a[a.length-1].value)throw new Error("The first and last thresholds must have a set \"value\".\n See ".concat(ud));var b=0,c=null;return a.map((d,e)=>{if(null!=d.value)return b=e,P({},d);null==c?c=Fd(a,e):e>c&&(b=c,c=Fd(a,e));var f=a[b].value,g=a[c].value,h=(g-f)/(c-b);return{color:"string"==typeof d?d:d.color,value:h*e+f}})},Hd=(a,b)=>{var c=Gd(a);if(c.sort((c,a)=>a.value-c.value),"smooth"===b)return c;var d,e=(d=[]).concat.apply(d,T(c.map((a,b)=>[a,{value:a.value-1e-4,color:c[b+1]?c[b+1].color:a.color}])));return e},Id=a=>{if(!Array.isArray(a.entities))throw new Error("Please provide the \"entities\" option as a list.\n See ".concat(ud));if(a.line_color_above||a.line_color_below)throw new Error("\"line_color_above/line_color_below\" was removed, please use \"color_thresholds\".\n See ".concat(ud));var b=P(P({animate:!1,hour24:!1,font_size:vd,font_size_header:14,height:100,hours_to_show:24,points_per_hour:.5,aggregate_func:"avg",group_by:"interval",line_color:[].concat(yd),color_thresholds:[],color_thresholds_transition:"smooth",line_width:5,bar_spacing:4,compress:!0,smoothing:!0,state_map:[],cache:!0,value_factor:0,tap_action:{action:"more-info"}},JSON.parse(JSON.stringify(a))),{},{show:P(P({},Ad),a.show)});b.entities.forEach((a,c)=>{"string"==typeof a&&(b.entities[c]={entity:a})}),b.state_map.forEach((a,c)=>{"string"==typeof a&&(b.state_map[c]={value:a,label:a}),b.state_map[c].label=b.state_map[c].label||b.state_map[c].value}),"string"==typeof a.line_color&&(b.line_color=[a.line_color].concat(yd)),b.font_size=a.font_size/100*vd||vd,b.color_thresholds=Hd(b.color_thresholds,b.color_thresholds_transition);var c=24wd&&(b.points_per_hour=wd/(b.hours_to_show*e),td("Not enough space, adjusting points_per_hour to ".concat(b.points_per_hour)))}return b},Jd="0.12.1";Ac.config({name:"mini-graph-card",version:1,storeName:"entity_history_cache",description:"Mini graph card uses caching for the entity history"}),Ac.iterate((a,b)=>{var c=b.endsWith("-raw")?a:qd(a),d=new Date;d.setHours(d.getHours()-c.hours_to_show),(a.version!==Jd||new Date(c.last_fetched){console.warn("Purging has errored: ",a)}),console.info("%c MINI-GRAPH-CARD %c ".concat(Jd," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;");class Kd extends bc{constructor(){super(),this.id=Math.random().toString(36).substr(2,9),this.config={},this.bound=[0,0],this.boundSecondary=[0,0],this.length=[],this.entity=[],this.line=[],this.bar=[],this.abs=[],this.fill=[],this.points=[],this.gradient=[],this.tooltip={},this.updateQueue=[],this.updating=!1,this.stateChanged=!1,this.initial=!0,this._md5Config=void 0}static get styles(){return Dd}set hass(a){this._hass=a;var b=!1,c=[];this.config.entities.forEach((d,e)=>{this.config.entities[e].index=e;var f=a&&a.states[d.entity]||void 0;f&&this.entity[e]!==f&&(this.entity[e]=f,c.push("".concat(f.entity_id,"-").concat(e)),b=!0)}),b&&(this.stateChanged=!0,this.entity=T(this.entity),this.config.update_interval||this.updating?this.updateQueue=[].concat(c,T(this.updateQueue)):setTimeout(()=>{this.updateQueue=[].concat(c,T(this.updateQueue)),this.updateData()},this.initial?0:1e3))}static get properties(){return{id:String,_hass:{},config:{},entity:[],Graph:[],line:[],shadow:[],length:Number,bound:[],boundSecondary:[],abs:[],tooltip:{},updateQueue:[],color:String}}setConfig(a){this.config=Id(a,this.config),this._md5Config=Q.hash(JSON.stringify(this.config));var b=!sd(this.config.entities||[],a.entities);(!this.Graph||b)&&(this._hass&&(this.hass=this._hass),this.Graph=this.config.entities.map(a=>new Cd(500,this.config.height,[this.config.show.fill?0:this.config.line_width,this.config.line_width],this.config.hours_to_show,this.config.points_per_hour,a.aggregate_func||this.config.aggregate_func,this.config.group_by,rd(a.smoothing,this.config.smoothing,!a.entity.startsWith("binary_sensor.")),this.config.logarithmic)))}connectedCallback(){super.connectedCallback(),this.config.update_interval&&(window.requestAnimationFrame(()=>{this.updateOnInterval()}),this.interval=setInterval(()=>this.updateOnInterval(),1e3*this.config.update_interval))}disconnectedCallback(){this.interval&&clearInterval(this.interval),super.disconnectedCallback()}shouldUpdate(a){if(zd.some(b=>a.has(b)))return this.color=this.intColor(void 0===this.tooltip.value?this.entity[0]&&this.entity[0].state:this.tooltip.value,this.tooltip.entity||0),!0}firstUpdated(){this.initial=!1}updated(a){this.config.animate&&a.has("line")&&(this.length.length{this.length[a.id]=a.getTotalLength()}),this.length=T(this.length)):this.length=Array(this.entity.length).fill("none"))}render(){var{config:a}=0void 0===this.entity[b])?this.renderWarnings():Db(K(),a.group,a.show.graph&&a.show.fill,"hover"===a.show.points,"hover"===a.show.labels,"hover"===a.show.labels_secondary,0this.handlePopup(b,a.tap_action.entity||this.entity[0]),this.renderHeader(),this.renderStates(),this.renderGraph(),this.renderInfo()):Db(L())}renderWarnings(){return Db(J(),this.config.entities.map((a,b)=>this.entity[b]?Db(H()):Db(I(),this.config.entities[b].entity)))}renderHeader(){var{show:a,align_icon:b,align_header:c,font_size_header:d}=this.config;return a.name||a.icon&&"state"!==b?Db(G(),c,d,this.renderName(),"state"===b?"":this.renderIcon()):""}renderIcon(){if(this.config.icon_image!==void 0)return Db(F(),this.config.icon_image);var{icon:a,icon_adaptive_color:b}=this.config.show;return a?Db(E(),this.config.align_icon,b?"color: ".concat(this.color,";"):"",this.computeIcon(this.entity[0])):""}renderName(){if(this.config.show.name){var a=void 0===this.tooltip.entity?this.config.name||this.computeName(0):this.computeName(this.tooltip.entity),b=this.config.show.name_adaptive_color?"opacity: 1; color: ".concat(this.color,";"):"";return Db(D(),b,a)}}renderStates(){var[a]=this.config.entities;if(this.config.show.state)return Db(C(),this.config.align_state,this.renderState(a,0),this.config.entities.map((a,b)=>0a&&a[b],a)}getEntityState(a){var b=this.config.entities[a];return"last"===this.config.show.state?this.points[a][this.points[a].length-1][Y]:b.attribute?this.getObjectAttr(this.entity[a].attributes,b.attribute):this.entity[a].state}renderState(a,b){var c=0===b;if(c||a.show_state){var{entity:d,value:e}=this.tooltip,f=this.getEntityState(b);return Db(B(),!c&&"state--small",a=>this.handlePopup(a,this.entity[b]),a.state_adaptive_color?"color: ".concat(this.computeColor(f,b),";"):"",a.show_indicator?this.renderIndicator(f,b):"",this.computeState(c&&e!==void 0?e:f),this.computeUom(c&&d||b),c&&this.renderStateTime()||"")}}renderStateTime(){return void 0===this.tooltip.value?void 0:Db(A(),this.tooltip.label?Db(z(),this.tooltip.label):Db(y(),this.tooltip.time[0],this.tooltip.time[1]))}renderGraph(){return this.config.show.graph?Db(x(),this.renderLabels(),this.renderLabelsSecondary(),this.renderSvg(),this.renderLegend()):""}renderLegend(){return 1>=this.visibleLegends.length||!this.config.show.legend?void 0:Db(w(),this.visibleLegends.map(a=>Db(v(),b=>this.handlePopup(b,this.entity[a.index]),()=>this.setTooltip(a.index,-1,this.getEntityState(a.index),"Current"),()=>this.tooltip={},this.renderIndicator(this.entity[a.index].state,a.index),this.computeName(a.index))))}renderIndicator(a,b){return Eb(u(),this.intColor(a,b))}renderSvgFill(a,b){if(a){var c="fade"===this.config.show.fill,d=this.length[b]||!1===this.config.entities[b].show_line;return Eb(t(),"fill-grad-".concat(this.id,"-").concat(b),"fill-grad-mask-".concat(this.id,"-").concat(b),"url(#fill-grad-".concat(this.id,"-").concat(b,")"),"fill-".concat(this.id,"-").concat(b),this.config.show.fill,b,this.config.animate,d,this.config.animate?"".concat(.5*b,"s"):"0s",c?"url(#fill-grad-mask-".concat(this.id,"-").concat(b,")"):"",this.fill[b])}}renderSvgLine(a,b){if(a){var c=Eb(s(),b,this.config.animate,this.length[b],this.config.animate?"".concat(.5*b,"s"):"0s",this.length[b]||"none",this.length[b]||"none","white",this.config.line_width,this.line[b]);return Eb(r(),"line-".concat(this.id,"-").concat(b),c)}}renderSvgPoint(a,b){var c=this.gradient[b]?this.computeColor(a[Y],b):"inherit";return Eb(q(),this.tooltip.index!==a[3],"--mcg-hover: ".concat(c,";"),c,c,a[Bd],a[X],this.config.line_width,()=>this.setTooltip(b,a[3],a[Y]),()=>this.tooltip={})}renderSvgPoints(a,b){if(a){var c=this.computeColor(this.entity[b].state,b);return Eb(p(),this.tooltip.entity===b,void 0!==this.tooltip.entity&&this.tooltip.entity!==b,this.length[b],this.config.animate&&"hover"!==this.config.show.points,this.config.animate?"".concat(.5*b+.5,"s"):"0s",c,c,this.config.line_width/2,a.map(a=>this.renderSvgPoint(a,b)))}}renderSvgGradient(a){if(a){var b=a.map((a,b)=>a?Eb(o(),"grad-".concat(this.id,"-").concat(b),a.map(a=>Eb(n(),a.color,"".concat(a.offset,"%")))):void 0);return Eb(m(),b)}}renderSvgLineRect(a,b){if(a){var c=this.gradient[b]?"url(#grad-".concat(this.id,"-").concat(b,")"):this.computeColor(this.entity[b].state,b);return Eb(l(),void 0!==this.tooltip.entity&&this.tooltip.entity!==b,"rect-".concat(this.id,"-").concat(b),c,"url(#line-".concat(this.id,"-").concat(b,")"))}}renderSvgFillRect(a,b){if(a){var c=this.gradient[b]?"url(#grad-".concat(this.id,"-").concat(b,")"):this.intColor(this.entity[b].state,b);return Eb(k(),void 0!==this.tooltip.entity&&this.tooltip.entity!==b,"fill-rect-".concat(this.id,"-").concat(b),c,"url(#fill-".concat(this.id,"-").concat(b,")"))}}renderSvgBars(a,b){if(a){var c=a.map((a,c)=>{var d=this.config.animate?Eb(j(),this.config.height,a.y):"",e=this.computeColor(a.value,b);return Eb(h(),a.x,a.y,a.height,a.width,e,()=>this.setTooltip(b,c,a.value),()=>this.tooltip={},d)});return Eb(g(),this.config.animate,c)}}renderSvg(){var{height:a}=this.config;return Eb(f(),0===a?0:"100%",a,a=>a.stopPropagation(),this.renderSvgGradient(this.gradient),this.fill.map((a,b)=>this.renderSvgFill(a,b)),this.fill.map((a,b)=>this.renderSvgFillRect(a,b)),this.line.map((a,b)=>this.renderSvgLine(a,b)),this.line.map((a,b)=>this.renderSvgLineRect(a,b)),this.bar.map((a,b)=>this.renderSvgBars(a,b)),this.points.map((a,b)=>this.renderSvgPoints(a,b)))}setTooltip(a,b,c){var d=3Db(b(),a.type,this.computeState(a.state),this.computeUom(0),"avg"===a.type?"":md(new Date(a.last_changed),this.config.format,this._hass.language)))):Db(a())}handlePopup(a,b){a.stopPropagation(),Ed(this,this._hass,this.config,this.config.tap_action,b.entity_id||b)}computeColor(a,b){var{color_thresholds:c,line_color:d}=this.config,e=P(P({color:d[b]||d[0]},c.slice(-1)[0]),c.find(b=>b.value<(+a||0)));return this.config.entities[b].color||e.color}get visibleEntities(){return this.config.entities.filter(a=>!1!==a.show_graph)}get primaryYaxisEntities(){return this.visibleEntities.filter(a=>a.y_axis===void 0||"primary"===a.y_axis)}get secondaryYaxisEntities(){return this.visibleEntities.filter(a=>"secondary"===a.y_axis)}get visibleLegends(){return this.visibleEntities.filter(a=>!1!==a.show_legend)}get primaryYaxisSeries(){return this.primaryYaxisEntities.map(a=>this.Graph[a.index])}get secondaryYaxisSeries(){return this.secondaryYaxisEntities.map(a=>this.Graph[a.index])}intColor(a,b){var c,{color_thresholds:d,line_color:e}=this.config,f=+a||0;if(0a.valuea.valueb.value===a);if(f)return f.label;td("value [".concat(a,"] not found in state_map"))}var b="string"==typeof a?parseFloat(a.replace(/,/g,".")):+a;var c=this.config.decimals,d=10**this.config.value_factor;if(c===void 0||O(c)||O(b))return this.numberFormat(Ra(100*(b*d))/100,this._hass.language);var e=10**c;return this.numberFormat((Ra(b*d*e)/e).toFixed(c),this._hass.language,c)}numberFormat(a,b,c){return!O(+a)&&Intl?new Intl.NumberFormat(b,{minimumFractionDigits:c}).format(+a):a.toString()}updateOnInterval(){this.stateChanged&&!this.updating&&(this.stateChanged=!1,this.updateData())}updateData(){var a=arguments,b=this;return S(function*(){var{config:c}=0b.updateEntity(a,c,e,d));yield Promise.all(f)}catch(a){td(a)}if(c.show.graph&&b.entity.forEach((a,c)=>{a&&b.Graph[c].update()}),b.updateBounds(),c.show.graph){var g=0;b.entity.forEach((a,d)=>{if(a&&0!==b.Graph[d].coords.length){var e="secondary"===c.entities[d].y_axis?b.boundSecondary:b.bound;if([b.Graph[d].min,b.Graph[d].max]=[e[0],e[1]],"bar"===c.show.graph){var f=b.visibleEntities.length;b.bar[d]=b.Graph[d].getBars(g,f,c.bar_spacing),g+=1}else{var h=b.Graph[d].getPath();!1!==c.entities[d].show_line&&(b.line[d]=h),c.show.fill&&!1!==c.entities[d].show_fill&&(b.fill[d]=b.Graph[d].getFill(h)),c.show.points&&!1!==c.entities[d].show_points&&(b.points[d]=b.Graph[d].getPoints()),0b[a])))||d:"~"===c[0]?Math[a].apply(Math,[+c.substr(1)].concat(T(b.map(b=>b[a])))):c}getBoundaries(a,b,c,d,e){var f=[this.getBoundary("min",a,b,d[0],e),this.getBoundary("max",a,c,d[1],e)];if(e){var g=Qa(f[0]-f[1]),h=parseFloat(e)-g;0c!=="".concat(a.entity_id,"-").concat(b));var f=[],g=c,h=!1,i=e.config.cache?yield e.getCache("".concat(a.entity_id,"_").concat(b),e.config.useCompress):void 0;if(i&&i.hours_to_show===e.config.hours_to_show){f=i.data;var k=f.findIndex(a=>new Date(a.last_changed)>c);-1===k?f=[]:(0g&&(g=new Date(l-1))}var j=yield e.fetchRecent(a.entity_id,g,d,!e.config.entities[b].attribute&&h,!!e.config.entities[b].attribute);if(j[0]&&0{e.config.entities[b].attribute&&(a.state=e.getObjectAttr(a.attributes,e.config.entities[b].attribute),delete a.attributes),0!O(parseFloat(a.state))),j=j.map(a=>({last_changed:e.config.entities[b].attribute?a.last_updated:a.last_changed,state:a.state})),f=[].concat(T(f),T(j)),e.config.cache&&e.setCache("".concat(a.entity_id,"_").concat(b),{hours_to_show:e.config.hours_to_show,last_fetched:new Date,data:f,version:Jd},e.config.useCompress).catch(a=>{td(a),Ac.clear()})),0!==f.length)if(e.entity[0]&&a.entity_id===e.entity[0].entity_id&&e.updateExtrema(f),!0===e.config.entities[b].fixed_value){var m=f[f.length-1];e.Graph[b].history=[m,m]}else e.Graph[b].history=f}})()}fetchRecent(a,b,c,d,e){var f=this;return S(function*(){var g="history/period";return b&&(g+="/".concat(b.toISOString())),g+="?filter_entity_id=".concat(a),c&&(g+="&end_time=".concat(c.toISOString())),d&&(g+="&skip_initial_state"),e||(g+="&minimal_response&no_attributes"),e&&(g+="&significant_changes_only=0"),f._hass.callApi("GET",g)})()}updateExtrema(a){var{extrema:b,average:c}=this.config.show;this.abs=[].concat(T(b?[P({type:"min"},jd(a,"state"))]:[]),T(c?[{type:"avg",state:kd(a,"state")}]:[]),T(b?[P({type:"max"},ld(a,"state"))]:[]))}_convertState(a){var b=this.config.state_map.findIndex(b=>b.value===a.state);-1===b||(a.state=b)}getEndDate(){var a=new Date;switch(this.config.group_by){case"date":a.setDate(a.getDate()+1),a.setHours(0,0,0);break;case"hour":a.setHours(a.getHours()+1),a.setMinutes(0,0);}return a}setNextUpdate(){if(!this.config.update_interval){var a=1/this.config.points_per_hour;clearInterval(this.interval),this.interval=setInterval(()=>{this.updating||this.updateData()},a*V)}}getCardSize(){return 3}}customElements.define("mini-graph-card",Kd),window.customCards=window.customCards||[],window.customCards.push({type:"mini-graph-card",name:"Mini Graph Card",preview:!1,description:"The Mini Graph card is a minimalistic and customizable graph card"})})})(); diff --git a/custom_components/ui_lovelace_minimalist/cards/mini-media-player/mini-media-player.js b/custom_components/ui_lovelace_minimalist/cards/mini-media-player/mini-media-player.js index 7d2fad0b5..8d9705833 100644 --- a/custom_components/ui_lovelace_minimalist/cards/mini-media-player/mini-media-player.js +++ b/custom_components/ui_lovelace_minimalist/cards/mini-media-player/mini-media-player.js @@ -25,7 +25,7 @@ function t(t,e,i,r){var o,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPro * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */}const e="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,i=(t,e,i=null)=>{for(;e!==i;){const i=e.nextSibling;t.removeChild(e),e=i}},r=`{{lit-${String(Math.random()).slice(2)}}}`,o=`\x3c!--${r}--\x3e`,n=new RegExp(`${r}|${o}`);class s{constructor(t,e){this.parts=[],this.element=e;const i=[],o=[],s=document.createTreeWalker(e.content,133,null,!1);let l=0,h=-1,u=0;const{strings:d,values:{length:m}}=t;for(;u0;){const e=d[u],i=p.exec(e)[2],r=i.toLowerCase()+"$lit$",o=t.getAttribute(r);t.removeAttribute(r);const s=o.split(n);this.parts.push({type:"attribute",index:h,name:i,strings:s}),u+=s.length-1}}"TEMPLATE"===t.tagName&&(o.push(t),s.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(r)>=0){const r=t.parentNode,o=e.split(n),s=o.length-1;for(let e=0;e{const i=t.length-e.length;return i>=0&&t.slice(i)===e},l=t=>-1!==t.index,c=()=>document.createComment(""),p=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function h(t,e){const{element:{content:i},parts:r}=t,o=document.createTreeWalker(i,133,null,!1);let n=d(r),s=r[n],a=-1,l=0;const c=[];let p=null;for(;o.nextNode();){a++;const t=o.currentNode;for(t.previousSibling===p&&(p=null),e.has(t)&&(c.push(t),null===p&&(p=t)),null!==p&&l++;void 0!==s&&s.index===a;)s.index=null!==p?-1:s.index-l,n=d(r,n),s=r[n]}c.forEach((t=>t.parentNode.removeChild(t)))}const u=t=>{let e=11===t.nodeType?0:1;const i=document.createTreeWalker(t,133,null,!1);for(;i.nextNode();)e++;return e},d=(t,e=-1)=>{for(let i=e+1;i{for(;e!==i;){const i=e.nextSibling;t.removeChild(e),e=i}},r=`{{lit-${String(Math.random()).slice(2)}}}`,o=`\x3c!--${r}--\x3e`,n=new RegExp(`${r}|${o}`);class s{constructor(t,e){this.parts=[],this.element=e;const i=[],o=[],s=document.createTreeWalker(e.content,133,null,!1);let l=0,h=-1,p=0;const{strings:d,values:{length:m}}=t;for(;p0;){const e=d[p],i=u.exec(e)[2],r=i.toLowerCase()+"$lit$",o=t.getAttribute(r);t.removeAttribute(r);const s=o.split(n);this.parts.push({type:"attribute",index:h,name:i,strings:s}),p+=s.length-1}}"TEMPLATE"===t.tagName&&(o.push(t),s.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(r)>=0){const r=t.parentNode,o=e.split(n),s=o.length-1;for(let e=0;e{const i=t.length-e.length;return i>=0&&t.slice(i)===e},l=t=>-1!==t.index,c=()=>document.createComment(""),u=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function h(t,e){const{element:{content:i},parts:r}=t,o=document.createTreeWalker(i,133,null,!1);let n=d(r),s=r[n],a=-1,l=0;const c=[];let u=null;for(;o.nextNode();){a++;const t=o.currentNode;for(t.previousSibling===u&&(u=null),e.has(t)&&(c.push(t),null===u&&(u=t)),null!==u&&l++;void 0!==s&&s.index===a;)s.index=null!==u?-1:s.index-l,n=d(r,n),s=r[n]}c.forEach((t=>t.parentNode.removeChild(t)))}const p=t=>{let e=11===t.nodeType?0:1;const i=document.createTreeWalker(t,133,null,!1);for(;i.nextNode();)e++;return e},d=(t,e=-1)=>{for(let i=e+1;it}),w=` ${r} `;class x{constructor(t,e,i,r){this.strings=t,this.values=e,this.type=i,this.processor=r}getHTML(){const t=this.strings.length-1;let e="",i=!1;for(let n=0;n-1||i)&&-1===t.indexOf("--\x3e",s+1);const a=p.exec(t);e+=null===a?t+(i?w:o):t.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+r}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==b&&(e=b.createHTML(e)),t.innerHTML=e,t}} + */const b=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),w=` ${r} `;class x{constructor(t,e,i,r){this.strings=t,this.values=e,this.type=i,this.processor=r}getHTML(){const t=this.strings.length-1;let e="",i=!1;for(let n=0;n-1||i)&&-1===t.indexOf("--\x3e",s+1);const a=u.exec(t);e+=null===a?t+(i?w:o):t.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+r}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==b&&(e=b.createHTML(e)),t.innerHTML=e,t}} /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -79,7 +79,7 @@ class y{constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const k=t=>null===t||!("object"==typeof t||"function"==typeof t),S=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class ${constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let t=0;t{try{const t={get capture(){return O=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class A{constructor(t,e,i){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;f(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=v,t(this)}if(this.__pendingValue===v)return;const t=this.__pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=V(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=v}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const V=t=>t&&(O?{capture:t.capture,passive:t.passive,once:t.once}:t.capture) + */const k=t=>null===t||!("object"==typeof t||"function"==typeof t),S=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class ${constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let t=0;t{try{const t={get capture(){return O=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class A{constructor(t,e,i){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;f(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=v,t(this)}if(this.__pendingValue===v)return;const t=this.__pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=V(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=v}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const V=t=>t&&(O?{capture:t.capture,passive:t.passive,once:t.once}:t.capture) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -92,7 +92,7 @@ class y{constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */;function N(t){let e=L.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},L.set(t.type,e));let i=e.stringsArray.get(t.strings);if(void 0!==i)return i;const o=t.strings.join(r);return i=e.keyString.get(o),void 0===i&&(i=new s(t,t.getTemplateElement()),e.keyString.set(o,i)),e.stringsArray.set(t.strings,i),i}const L=new Map,D=new WeakMap; + */;function N(t){let e=L.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},L.set(t.type,e));let i=e.stringsArray.get(t.strings);if(void 0!==i)return i;const o=t.strings.join(r);return i=e.keyString.get(o),void 0===i&&(i=new s(t,t.getTemplateElement()),e.keyString.set(o,i)),e.stringsArray.set(t.strings,i),i}const L=new Map,j=new WeakMap; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -105,7 +105,7 @@ class y{constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const j=new + */const D=new /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -119,7 +119,7 @@ class y{constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class{handleAttributeExpressions(t,e,i,r){const o=e[0];if("."===o){return new M(t,e.slice(1),i).parts}if("@"===o)return[new A(t,e.slice(1),r.eventContext)];if("?"===o)return[new E(t,e.slice(1),i)];return new $(t,e,i).parts}handleTextExpression(t){return new C(t)}}; +class{handleAttributeExpressions(t,e,i,r){const o=e[0];if("."===o){return new E(t,e.slice(1),i).parts}if("@"===o)return[new A(t,e.slice(1),r.eventContext)];if("?"===o)return[new M(t,e.slice(1),i)];return new $(t,e,i).parts}handleTextExpression(t){return new C(t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -132,7 +132,7 @@ class{handleAttributeExpressions(t,e,i,r){const o=e[0];if("."===o){return new M( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const I=(t,...e)=>new x(t,e,"html",j) + */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const I=(t,...e)=>new x(t,e,"html",D) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -145,7 +145,7 @@ class{handleAttributeExpressions(t,e,i,r){const o=e[0];if("."===o){return new M( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */,R=(t,e)=>`${t}--${e}`;let z=!0;void 0===window.ShadyCSS?z=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),z=!1);const F=t=>e=>{const i=R(e.type,t);let o=L.get(i);void 0===o&&(o={stringsArray:new WeakMap,keyString:new Map},L.set(i,o));let n=o.stringsArray.get(e.strings);if(void 0!==n)return n;const a=e.strings.join(r);if(n=o.keyString.get(a),void 0===n){const i=e.getTemplateElement();z&&window.ShadyCSS.prepareTemplateDom(i,t),n=new s(e,i),o.keyString.set(a,n)}return o.stringsArray.set(e.strings,n),n},U=["html","svg"],q=new Set,B=(t,e,i)=>{q.add(t);const r=i?i.element:document.createElement("template"),o=e.querySelectorAll("style"),{length:n}=o;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(r,t);const s=document.createElement("style");for(let t=0;t{U.forEach((e=>{const i=L.get(R(e,t));void 0!==i&&i.keyString.forEach((t=>{const{element:{content:e}}=t,i=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{i.add(t)})),h(t,i)}))}))})(t);const a=r.content;i?function(t,e,i=null){const{element:{content:r},parts:o}=t;if(null==i)return void r.appendChild(e);const n=document.createTreeWalker(r,133,null,!1);let s=d(o),a=0,l=-1;for(;n.nextNode();)for(l++,n.currentNode===i&&(a=u(e),i.parentNode.insertBefore(e,i));-1!==s&&o[s].index===l;){if(a>0){for(;-1!==s;)o[s].index+=a,s=d(o,s);return}s=d(o,s)}}(i,s,a.firstChild):a.insertBefore(s,a.firstChild),window.ShadyCSS.prepareTemplateStyles(r,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(i){a.insertBefore(s,a.firstChild);const t=new Set;t.add(s),h(i,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const G={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},H=(t,e)=>e!==t&&(e==e||t==t),W={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:H};class X extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,i)=>{const r=this._attributeNameForProperty(i,e);void 0!==r&&(this._attributeToPropertyMap.set(r,i),t.push(r))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach(((t,e)=>this._classProperties.set(e,t)))}}static createProperty(t,e=W){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const i="symbol"==typeof t?Symbol():`__${t}`,r=this.getPropertyDescriptor(t,i,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const o=this[t];this[e]=r,this.requestUpdateInternal(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||W}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const i of e)this.createProperty(i,t[i])}}static _attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,i=H){return i(t,e)}static _propertyValueFromAttribute(t,e){const i=e.type,r=e.converter||G,o="function"==typeof r?r:r.fromAttribute;return o?o(t,i):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const i=e.type,r=e.converter;return(r&&r.toAttribute||G.toAttribute)(t,i)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,e)=>this[e]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,i){e!==i&&this._attributeToProperty(t,i)}_propertyToAttribute(t,e,i=W){const r=this.constructor,o=r._attributeNameForProperty(t,i);if(void 0!==o){const t=r._propertyValueToAttribute(e,i);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(o):this.setAttribute(o,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const i=this.constructor,r=i._attributeToPropertyMap.get(t);if(void 0!==r){const t=i.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=i._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,i){let r=!0;if(void 0!==t){const o=this.constructor;i=i||o.getPropertyOptions(t),o._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):r=!1}!this._hasRequestedUpdate&&r&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((t,e)=>this._propertyToAttribute(e,this[e],t))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}X.finalized=!0; + */,R=(t,e)=>`${t}--${e}`;let z=!0;void 0===window.ShadyCSS?z=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),z=!1);const U=t=>e=>{const i=R(e.type,t);let o=L.get(i);void 0===o&&(o={stringsArray:new WeakMap,keyString:new Map},L.set(i,o));let n=o.stringsArray.get(e.strings);if(void 0!==n)return n;const a=e.strings.join(r);if(n=o.keyString.get(a),void 0===n){const i=e.getTemplateElement();z&&window.ShadyCSS.prepareTemplateDom(i,t),n=new s(e,i),o.keyString.set(a,n)}return o.stringsArray.set(e.strings,n),n},q=["html","svg"],B=new Set,F=(t,e,i)=>{B.add(t);const r=i?i.element:document.createElement("template"),o=e.querySelectorAll("style"),{length:n}=o;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(r,t);const s=document.createElement("style");for(let t=0;t{q.forEach((e=>{const i=L.get(R(e,t));void 0!==i&&i.keyString.forEach((t=>{const{element:{content:e}}=t,i=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{i.add(t)})),h(t,i)}))}))})(t);const a=r.content;i?function(t,e,i=null){const{element:{content:r},parts:o}=t;if(null==i)return void r.appendChild(e);const n=document.createTreeWalker(r,133,null,!1);let s=d(o),a=0,l=-1;for(;n.nextNode();)for(l++,n.currentNode===i&&(a=p(e),i.parentNode.insertBefore(e,i));-1!==s&&o[s].index===l;){if(a>0){for(;-1!==s;)o[s].index+=a,s=d(o,s);return}s=d(o,s)}}(i,s,a.firstChild):a.insertBefore(s,a.firstChild),window.ShadyCSS.prepareTemplateStyles(r,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(i){a.insertBefore(s,a.firstChild);const t=new Set;t.add(s),h(i,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const G={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},H=(t,e)=>e!==t&&(e==e||t==t),W={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:H};class Z extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,i)=>{const r=this._attributeNameForProperty(i,e);void 0!==r&&(this._attributeToPropertyMap.set(r,i),t.push(r))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach(((t,e)=>this._classProperties.set(e,t)))}}static createProperty(t,e=W){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const i="symbol"==typeof t?Symbol():`__${t}`,r=this.getPropertyDescriptor(t,i,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const o=this[t];this[e]=r,this.requestUpdateInternal(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||W}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const i of e)this.createProperty(i,t[i])}}static _attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,i=H){return i(t,e)}static _propertyValueFromAttribute(t,e){const i=e.type,r=e.converter||G,o="function"==typeof r?r:r.fromAttribute;return o?o(t,i):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const i=e.type,r=e.converter;return(r&&r.toAttribute||G.toAttribute)(t,i)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,e)=>this[e]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,i){e!==i&&this._attributeToProperty(t,i)}_propertyToAttribute(t,e,i=W){const r=this.constructor,o=r._attributeNameForProperty(t,i);if(void 0!==o){const t=r._propertyValueToAttribute(e,i);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(o):this.setAttribute(o,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const i=this.constructor,r=i._attributeToPropertyMap.get(t);if(void 0!==r){const t=i.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=i._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,i){let r=!0;if(void 0!==t){const o=this.constructor;i=i||o.getPropertyOptions(t),o._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):r=!1}!this._hasRequestedUpdate&&r&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((t,e)=>this._propertyToAttribute(e,this[e],t))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}Z.finalized=!0; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -159,7 +159,7 @@ class{handleAttributeExpressions(t,e,i,r){const o=e[0];if("."===o){return new M( * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const J=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:r}=e;return{kind:i,elements:r,finisher(e){window.customElements.define(t,e)}}})(t,e),Y=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function Z(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):Y(t,e)}const K=t=>function(t){return Z({attribute:!1,hasChanged:null==t?void 0:t.hasChanged})}(t) +const J=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:r}=e;return{kind:i,elements:r,finisher(e){window.customElements.define(t,e)}}})(t,e),X=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function Y(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):X(t,e)}const K=t=>function(t){return Y({attribute:!1,hasChanged:null==t?void 0:t.hasChanged})}(t) /** @license Copyright (c) 2019 The Polymer Project Authors. All rights reserved. @@ -183,7 +183,7 @@ found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const rt={};class ot extends X{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,i)=>t.reduceRight(((t,i)=>Array.isArray(i)?e(i,t):(t.add(i),t)),i),i=e(t,new Set),r=[];i.forEach((t=>r.unshift(t))),this._styles=r}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!Q){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return new et(String(e),tt)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Q?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==rt&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return rt}}ot.finalized=!0,ot.render=(t,e,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const o=r.scopeName,n=D.has(e),s=z&&11===e.nodeType&&!!e.host,a=s&&!q.has(o),l=a?document.createDocumentFragment():e;if(((t,e,r)=>{let o=D.get(e);void 0===o&&(i(e,e.firstChild),D.set(e,o=new C(Object.assign({templateFactory:N},r))),o.appendInto(e)),o.setValue(t),o.commit()})(t,l,Object.assign({templateFactory:F(o)},r)),a){const t=D.get(l);D.delete(l);const r=t.value instanceof y?t.value.template:void 0;B(o,l,r),i(e,e.firstChild),e.appendChild(l),D.set(e,t)}!n&&s&&window.ShadyCSS.styleElement(e.host)},ot.shadowRootOptions={mode:"open"}; +(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const rt={};class ot extends Z{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,i)=>t.reduceRight(((t,i)=>Array.isArray(i)?e(i,t):(t.add(i),t)),i),i=e(t,new Set),r=[];i.forEach((t=>r.unshift(t))),this._styles=r}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!Q){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return new et(String(e),tt)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Q?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==rt&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return rt}}ot.finalized=!0,ot.render=(t,e,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const o=r.scopeName,n=j.has(e),s=z&&11===e.nodeType&&!!e.host,a=s&&!B.has(o),l=a?document.createDocumentFragment():e;if(((t,e,r)=>{let o=j.get(e);void 0===o&&(i(e,e.firstChild),j.set(e,o=new C(Object.assign({templateFactory:N},r))),o.appendInto(e)),o.setValue(t),o.commit()})(t,l,Object.assign({templateFactory:U(o)},r)),a){const t=j.get(l);j.delete(l);const r=t.value instanceof y?t.value.template:void 0;F(o,l,r),i(e,e.firstChild),e.appendChild(l),j.set(e,t)}!n&&s&&window.ShadyCSS.styleElement(e.host)},ot.shadowRootOptions={mode:"open"}; /** * @license * Copyright (c) 2018 The Polymer Project Authors. All rights reserved. @@ -197,7 +197,7 @@ found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;const e=(t.getAttribute("class")||"").split(/\s+/);for(const t of e)this.classes.add(t)}add(t){this.classes.add(t),this.changed=!0}remove(t){this.classes.delete(t),this.changed=!0}commit(){if(this.changed){let t="";this.classes.forEach((e=>t+=e+" ")),this.element.setAttribute("class",t)}}}const st=new WeakMap,at=g((t=>e=>{if(!(e instanceof P)||e instanceof T||"class"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `classMap` directive must be used in the `class` attribute and must be the only part in the attribute.");const{committer:i}=e,{element:r}=i;let o=st.get(e);void 0===o&&(r.setAttribute("class",i.strings.join(" ")),st.set(e,o=new Set));const n=r.classList||new nt(r);o.forEach((e=>{e in t||(n.remove(e),o.delete(e))}));for(const e in t){const i=t[e];i!=o.has(e)&&(i?(n.add(e),o.add(e)):(n.remove(e),o.delete(e)))}"function"==typeof n.commit&&n.commit()})),lt=new WeakMap,ct=g((t=>e=>{if(!(e instanceof P)||e instanceof T||"style"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:i}=e,{style:r}=i.element;let o=lt.get(e);void 0===o&&(r.cssText=i.strings.join(" "),lt.set(e,o=new Set)),o.forEach((e=>{e in t||(o.delete(e),-1===e.indexOf("-")?r[e]=null:r.removeProperty(e))}));for(const e in t)o.add(e),-1===e.indexOf("-")?r[e]=t[e]:r.setProperty(e,t[e])}));var pt=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var i=-1;return t.some((function(t,r){return t[0]===e&&(i=r,!0)})),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var i=t(this.__entries__,e),r=this.__entries__[i];return r&&r[1]},e.prototype.set=function(e,i){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=i:this.__entries__.push([e,i])},e.prototype.delete=function(e){var i=this.__entries__,r=t(i,e);~r&&i.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var i=0,r=this.__entries__;i0},t.prototype.connect_=function(){ht&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),gt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){ht&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=void 0===e?"":e;mt.some((function(t){return!!~i.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),vt=function(t,e){for(var i=0,r=Object.keys(e);i0},t}(),Mt="undefined"!=typeof WeakMap?new WeakMap:new pt,Tt=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=ft.getInstance(),r=new Et(e,i,this);Mt.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){Tt.prototype[t]=function(){var e;return(e=Mt.get(this))[t].apply(e,arguments)}}));var Ot=void 0!==ut.ResizeObserver?ut.ResizeObserver:Tt;const At={repeat:!0,shuffle:!0,power_state:!0,artwork_border:!0,icon_state:!0,sound_mode:!0,runtime:!0,runtime_remaining:!0,volume:!1,volume_level:!0,controls:!1,play_pause:!1,play_stop:!0,prev:!1,next:!1,jump:!0,state_label:!1,progress:!1,icon:!1,name:!1,info:!1},Vt={OFF:"off",ALL:"all",ONE:"one"},Nt="mdi:cast",Lt="mdi:chevron-down",Dt="mdi:speaker-multiple",jt={true:"mdi:volume-off",false:"mdi:volume-high"},It="mdi:skip-next",Rt={true:"mdi:pause",false:"mdi:play"},zt="mdi:power",Ft="mdi:skip-previous",Ut="mdi:shuffle",qt={[Vt.OFF]:"mdi:repeat-off",[Vt.ONE]:"mdi:repeat-once",[Vt.ALL]:"mdi:repeat"},Bt={true:"mdi:stop",false:"mdi:play"},Gt="mdi:volume-minus",Ht="mdi:volume-plus",Wt="mdi:fast-forward",Xt="mdi:rewind",Jt=["entity","groupMgmtEntity","_overflow","break","thumbnail","prevThumbnail","edit","idle","cardHeight","backgroundColor","foregroundColor"],Yt=["media_duration","media_position","media_position_updated_at"],Zt=[{attr:"media_title"},{attr:"media_artist"},{attr:"media_series_title"},{attr:"media_season",prefix:"S"},{attr:"media_episode",prefix:"E"},{attr:"app_name"}],Kt="sonos",Qt="squeezebox",te="soundtouch",ee="media_player",ie="heos";var re;!function(t){t.MORE_INFO="more-info",t.NAVIGATE="navigate",t.CALL_SERVICE="call-service",t.URL="url",t.FIRE_DOM_EVENT="fire-dom-event",t.NONE="none"}(re||(re={}));const oe=t=>{var e;(t=>{if(void 0===t.entity)throw new Error("You need to specify the required entity option.");if("media_player"!==t.entity.split(".")[0])throw new Error("Specify an entity from within the media_player domain.");if(void 0===t.type)throw new Error("You need to specify the required type option.")})(t);const i=Object.assign(Object.assign({artwork:"default",info:"default",group:!1,volume_stateless:!1,more_info:!0,source:"default",sound_mode:"default",toggle_power:!0,tap_action:{action:re.MORE_INFO},jump_amount:10},t),{hide:Object.assign(Object.assign({},At),t.hide),speaker_group:Object.assign(Object.assign({show_group_count:!0,platform:"sonos",supports_master:!0,entities:[]},t.sonos),t.speaker_group),shortcuts:Object.assign({label:"Shortcuts..."},t.shortcuts),max_volume:null!==(e=Number(t.max_volume))&&void 0!==e?e:100,min_volume:Number(t.min_volume)||0});return i.collapse=i.hide.controls||i.hide.volume,i.info=i.collapse&&"scroll"!==i.info?"short":i.info,i.flow=i.hide.icon&&i.hide.name&&i.hide.info,i};var ne;!function(t){t.PLAYING="playing",t.PAUSED="paused",t.IDLE="idle",t.OFF="off",t.ON="on",t.UNAVAILABLE="unavailable",t.UNKNOWN="unknown",t.STANDBY="standby"}(ne||(ne={}));class se{constructor(t,e,i){this.hass=t||{},this.config=e||{},this.entity=i||{},this.state=i.state,this._entityId=i&&i.entity_id||this.config.entity,this._attr=i.attributes||{},this.idle=!!e.idle_view&&this.idleView,this._active=this.isActive}get id(){return this.entity.entity_id}get icon(){return this._attr.icon}get isPaused(){return this.state===ne.PAUSED}get isPlaying(){return this.state===ne.PLAYING}get isIdle(){return this.state===ne.IDLE}get isStandby(){return this.state===ne.STANDBY}get isUnavailable(){return this.state===ne.UNAVAILABLE}get isOff(){return this.state===ne.OFF}get isActive(){return!this.isOff&&!this.isUnavailable&&!this.idle||!1}get shuffle(){return this._attr.shuffle||!1}get repeat(){return this._attr.repeat||Vt.OFF}get content(){return this._attr.media_content_type||"none"}get mediaDuration(){return this._attr.media_duration||0}get updatedAt(){return this._attr.media_position_updated_at||0}get position(){return this._attr.media_position||0}get name(){return this._attr.friendly_name||""}get groupCount(){return this.group.length}get isGrouped(){return this.group.length>1}get group(){return this.platform===Qt?this._attr.sync_group||[]:this.platform===ee||this.platform===ie||this.platform===Kt?this._attr.group_members||[]:this._attr[`${this.platform}_group`]||[]}get platform(){return this.config.speaker_group.platform}get master(){return this.supportsMaster&&this.group[0]||this._entityId}get isMaster(){return this.master===this._entityId}get sources(){return this._attr.source_list||[]}get source(){return this._attr.source||""}get soundModes(){return this._attr.sound_mode_list||[]}get soundMode(){return this._attr.sound_mode||""}get muted(){return this._attr.is_volume_muted||!1}get vol(){return this._attr.volume_level||0}get picture(){return this._attr.entity_picture_local||this._attr.entity_picture}get hasArtwork(){return!!this.picture&&"none"!==this.config.artwork&&this._active&&!this.idle}get mediaInfo(){return Zt.map((t=>Object.assign({text:this._attr[t.attr],prefix:""},t))).filter((t=>t.text))}get hasProgress(){return!this.config.hide.progress&&!this.idle&&Yt.every((t=>t in this._attr))}get supportsPrev(){return!!this._attr.supported_features&&(16|this._attr.supported_features)===this._attr.supported_features}get supportsNext(){return!!this._attr.supported_features&&(32|this._attr.supported_features)===this._attr.supported_features}get progress(){return this.isPlaying?this.position+(Date.now()-new Date(this.updatedAt).getTime())/1e3:this.position}get idleView(){const t=this.config.idle_view;return!!((null==t?void 0:t.when_idle)&&this.isIdle||(null==t?void 0:t.when_standby)&&this.isStandby||(null==t?void 0:t.when_paused)&&this.isPaused)||!(!this.updatedAt||!(null==t?void 0:t.after)||this.isPlaying)&&this.checkIdleAfter(t.after)}get trackIdle(){var t,e;return Boolean(this._active&&!this.isPlaying&&this.updatedAt&&(null===(e=null===(t=this.config)||void 0===t?void 0:t.idle_view)||void 0===e?void 0:e.after))}checkIdleAfter(t){const e=(Date.now()-new Date(this.updatedAt).getTime())/1e3;return this.idle=e>60*t,this._active=this.isActive,this.idle}get supportsShuffle(){return void 0!==this._attr.shuffle}get supportsRepeat(){return void 0!==this._attr.repeat}get supportsMute(){return void 0!==this._attr.is_volume_muted}get supportsVolumeSet(){return void 0!==this._attr.volume_level}get supportsMaster(){return this.platform!==Qt&&this.config.speaker_group.supports_master}async fetchArtwork(){const t=this._attr.entity_picture_local?this.hass.hassUrl(this.picture):this.picture;try{const e=await fetch(new Request(t)),i=(t=>{let e="";return[].slice.call(new Uint8Array(t)).forEach((t=>e+=String.fromCharCode(t))),window.btoa(e)})(await e.arrayBuffer());return`url(data:${e.headers.get("Content-Type")||"image/jpeg"};base64,${i})`}catch(t){return!1}}getAttribute(t){return this._attr[t]}toggle(t){return this.config.toggle_power?this.callService(t,"toggle"):this.isOff?this.callService(t,"turn_on"):void this.callService(t,"turn_off")}toggleMute(t){this.config.speaker_group.sync_volume?this.group.forEach((e=>{this.callService(t,"volume_mute",{entity_id:e,is_volume_muted:!this.muted})})):this.callService(t,"volume_mute",{is_volume_muted:!this.muted})}toggleShuffle(t){this.callService(t,"shuffle_set",{shuffle:!this.shuffle})}toggleRepeat(t){const e=Object.values(Vt),{length:i}=e,r=e.indexOf(this.repeat)-1,o=e[(r-1%i+i)%i];this.callService(t,"repeat_set",{repeat:o})}setSource(t,e){this.callService(t,"select_source",{source:e})}setMedia(t,e){this.callService(t,"play_media",Object.assign({},e))}playPause(t){this.callService(t,"media_play_pause")}playStop(t){this.isPlaying?this.callService(t,"media_stop"):this.callService(t,"media_play")}setSoundMode(t,e){this.callService(t,"select_sound_mode",{sound_mode:e})}next(t){this.callService(t,"media_next_track")}prev(t){this.callService(t,"media_previous_track")}stop(t){this.callService(t,"media_stop")}volumeUp(t){this.supportsVolumeSet&&this.config.volume_step&&this.config.volume_step>0?this.callService(t,"volume_set",{entity_id:this._entityId,volume_level:Math.min(this.vol+this.config.volume_step/100,1)}):this.callService(t,"volume_up")}volumeDown(t){this.supportsVolumeSet&&this.config.volume_step&&this.config.volume_step>0?this.callService(t,"volume_set",{entity_id:this._entityId,volume_level:Math.max(this.vol-this.config.volume_step/100,0)}):this.callService(t,"volume_down")}seek(t,e){this.callService(t,"media_seek",{seek_position:e})}jump(t,e){const i=this.progress+e,r=Math.min(Math.max(i,0),Number(this.mediaDuration)||i);this.callService(t,"media_seek",{seek_position:r})}setVolume(t,e){this.config.speaker_group.sync_volume&&this.config.speaker_group.entities?this.group.forEach((i=>{var r;const o=null===(r=this.config.speaker_group.entities)||void 0===r?void 0:r.find((t=>t.entity_id===i));if(void 0===o)return;let n=e;o.volume_offset&&(n+=o.volume_offset/100,n>1&&(n=1),n<0&&(n=0)),this.callService(t,"volume_set",{entity_id:i,volume_level:n})})):this.callService(t,"volume_set",{entity_id:this._entityId,volume_level:e})}handleGroupChange(t,e,i){const{platform:r}=this,o={entity_id:e};if(i)switch(o.master=this._entityId,r){case te:return this.handleSoundtouch(t,this.isGrouped?"ADD_ZONE_SLAVE":"CREATE_ZONE",e);case Qt:return this.callService(t,"sync",{entity_id:this._entityId,other_player:e},Qt);case ee:case Kt:return this.callService(t,"join",{entity_id:this._entityId,group_members:e},ee);case ie:return this.callService(t,"join",{entity_id:this._entityId,group_members:this.group.concat("string"==typeof e?[e]:e)},ee);default:return this.callService(t,"join",o,r)}else switch(r){case te:return this.handleSoundtouch(t,"REMOVE_ZONE_SLAVE",e);case Qt:return this.callService(t,"unsync",o,Qt);case ee:case Kt:return this.callService(t,"unjoin",{entity_id:e},ee);case ie:return this.callService(t,"unjoin",{entity_id:"string"==typeof e?e:e[0]},ee);default:return this.callService(t,"unjoin",o,r)}}handleSoundtouch(t,e,i){return this.callService(t,e,{master:this.master,slaves:i},te,!0)}toggleScript(t,e,i={}){const[,r]=e.split(".");this.callService(t,r,Object.assign({},i),"script")}toggleService(t,e,i={}){t.stopPropagation();const[r,o]=e.split(".");this.hass.callService(r,o,Object.assign({},i))}callService(t,e,i,r="media_player",o=!1){t.stopPropagation(),this.hass.callService(r,e,Object.assign(Object.assign({},!o&&{entity_id:this._entityId}),i))}}const ae=it` +class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;const e=(t.getAttribute("class")||"").split(/\s+/);for(const t of e)this.classes.add(t)}add(t){this.classes.add(t),this.changed=!0}remove(t){this.classes.delete(t),this.changed=!0}commit(){if(this.changed){let t="";this.classes.forEach((e=>t+=e+" ")),this.element.setAttribute("class",t)}}}const st=new WeakMap,at=g((t=>e=>{if(!(e instanceof P)||e instanceof T||"class"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `classMap` directive must be used in the `class` attribute and must be the only part in the attribute.");const{committer:i}=e,{element:r}=i;let o=st.get(e);void 0===o&&(r.setAttribute("class",i.strings.join(" ")),st.set(e,o=new Set));const n=r.classList||new nt(r);o.forEach((e=>{e in t||(n.remove(e),o.delete(e))}));for(const e in t){const i=t[e];i!=o.has(e)&&(i?(n.add(e),o.add(e)):(n.remove(e),o.delete(e)))}"function"==typeof n.commit&&n.commit()})),lt=new WeakMap,ct=g((t=>e=>{if(!(e instanceof P)||e instanceof T||"style"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:i}=e,{style:r}=i.element;let o=lt.get(e);void 0===o&&(r.cssText=i.strings.join(" "),lt.set(e,o=new Set)),o.forEach((e=>{e in t||(o.delete(e),-1===e.indexOf("-")?r[e]=null:r.removeProperty(e))}));for(const e in t)o.add(e),-1===e.indexOf("-")?r[e]=t[e]:r.setProperty(e,t[e])}));var ut=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var i=-1;return t.some((function(t,r){return t[0]===e&&(i=r,!0)})),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var i=t(this.__entries__,e),r=this.__entries__[i];return r&&r[1]},e.prototype.set=function(e,i){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=i:this.__entries__.push([e,i])},e.prototype.delete=function(e){var i=this.__entries__,r=t(i,e);~r&&i.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var i=0,r=this.__entries__;i0},t.prototype.connect_=function(){ht&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),gt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){ht&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=void 0===e?"":e;mt.some((function(t){return!!~i.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),vt=function(t,e){for(var i=0,r=Object.keys(e);i0},t}(),Et="undefined"!=typeof WeakMap?new WeakMap:new ut,Tt=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=ft.getInstance(),r=new Mt(e,i,this);Et.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){Tt.prototype[t]=function(){var e;return(e=Et.get(this))[t].apply(e,arguments)}}));var Ot=void 0!==pt.ResizeObserver?pt.ResizeObserver:Tt;const At={repeat:!0,shuffle:!0,power_state:!0,artwork_border:!0,icon_state:!0,sound_mode:!0,group_button:!1,runtime:!0,runtime_remaining:!0,volume:!1,volume_level:!0,controls:!1,play_pause:!1,play_stop:!0,prev:!1,next:!1,jump:!0,state_label:!1,progress:!1,icon:!1,name:!1,info:!1},Vt={OFF:"off",ALL:"all",ONE:"one"},Nt="mdi:chevron-down",Lt="mdi:speaker-multiple",jt={true:"mdi:volume-off",false:"mdi:volume-high"},Dt="mdi:skip-next",It={true:"mdi:pause",false:"mdi:play"},Rt="mdi:power",zt="mdi:skip-previous",Ut="mdi:shuffle",qt={[Vt.OFF]:"mdi:repeat-off",[Vt.ONE]:"mdi:repeat-once",[Vt.ALL]:"mdi:repeat"},Bt={true:"mdi:stop",false:"mdi:play"},Ft="mdi:volume-minus",Gt="mdi:volume-plus",Ht="mdi:fast-forward",Wt="mdi:rewind",Zt=["entity","groupMgmtEntity","_overflow","break","thumbnail","prevThumbnail","edit","idle","cardHeight","backgroundColor","foregroundColor"],Jt=["media_duration","media_position","media_position_updated_at"],Xt=[{attr:"media_title"},{attr:"media_artist"},{attr:"media_series_title"},{attr:"media_season",prefix:"S"},{attr:"media_episode",prefix:"E"},{attr:"media_channel"},{attr:"app_name"}],Yt="sonos",Kt="squeezebox",Qt="soundtouch",te="media_player",ee="heos";var ie;!function(t){t.MORE_INFO="more-info",t.NAVIGATE="navigate",t.CALL_SERVICE="call-service",t.URL="url",t.FIRE_DOM_EVENT="fire-dom-event",t.NONE="none"}(ie||(ie={}));const re=t=>{var e;(t=>{if(void 0===t.entity)throw new Error("You need to specify the required entity option.");if("media_player"!==t.entity.split(".")[0])throw new Error("Specify an entity from within the media_player domain.");if(void 0===t.type)throw new Error("You need to specify the required type option.")})(t);const i=Object.assign(Object.assign({artwork:"default",info:"default",group:!1,volume_stateless:!1,more_info:!0,source:"default",sound_mode:"default",toggle_power:!0,tap_action:{action:ie.MORE_INFO},jump_amount:10},t),{hide:Object.assign(Object.assign({},At),t.hide),speaker_group:Object.assign(Object.assign({show_group_count:!0,platform:"sonos",supports_master:!0,entities:[]},t.sonos),t.speaker_group),shortcuts:Object.assign({label:"Shortcuts..."},t.shortcuts),max_volume:null!==(e=Number(t.max_volume))&&void 0!==e?e:100,min_volume:Number(t.min_volume)||0});return i.collapse=i.hide.controls||i.hide.volume,i.info=i.collapse&&"scroll"!==i.info?"short":i.info,i.flow=i.hide.icon&&i.hide.name&&i.hide.info,i};var oe;!function(t){t.PLAYING="playing",t.PAUSED="paused",t.IDLE="idle",t.OFF="off",t.ON="on",t.UNAVAILABLE="unavailable",t.UNKNOWN="unknown",t.STANDBY="standby"}(oe||(oe={}));class ne{constructor(t,e,i){this.hass=t||{},this.config=e||{},this.entity=i||{},this.state=i.state,this._entityId=i&&i.entity_id||this.config.entity,this._attr=i.attributes||{},this.idle=!!e.idle_view&&this.idleView,this._active=this.isActive}get id(){return this.entity.entity_id}get icon(){return this._attr.icon}get isPaused(){return this.state===oe.PAUSED}get isPlaying(){return this.state===oe.PLAYING}get isIdle(){return this.state===oe.IDLE}get isStandby(){return this.state===oe.STANDBY}get isUnavailable(){return this.state===oe.UNAVAILABLE}get isOff(){return this.state===oe.OFF}get isActive(){return!this.isOff&&!this.isUnavailable&&!this.idle||!1}get assumedState(){return this._attr.assumed_state||!1}get shuffle(){return this._attr.shuffle||!1}get repeat(){return this._attr.repeat||Vt.OFF}get content(){return this._attr.media_content_type||"none"}get mediaDuration(){return this._attr.media_duration||0}get updatedAt(){return this._attr.media_position_updated_at||0}get position(){return this._attr.media_position||0}get name(){return this._attr.friendly_name||""}get groupCount(){return this.group.length}get isGrouped(){return this.group.length>1}get group(){return this.platform===Kt?this._attr.sync_group||[]:this.platform===te||this.platform===ee||this.platform===Yt?this._attr.group_members||[]:this._attr[`${this.platform}_group`]||[]}get platform(){return this.config.speaker_group.platform}get master(){return this.supportsMaster&&this.group[0]||this._entityId}get isMaster(){return this.master===this._entityId}get sources(){return this._attr.source_list||[]}get source(){return this._attr.source||""}get soundModes(){return this._attr.sound_mode_list||[]}get soundMode(){return this._attr.sound_mode||""}get muted(){return this._attr.is_volume_muted||!1}get vol(){return this._attr.volume_level||0}get picture(){return this._attr.entity_picture_local||this._attr.entity_picture}get hasArtwork(){return!!this.picture&&"none"!==this.config.artwork&&this._active&&!this.idle}get mediaInfo(){return Xt.map((t=>Object.assign({text:this._attr[t.attr],prefix:""},t))).filter((t=>t.text))}get hasProgress(){return!this.config.hide.progress&&!this.idle&&Jt.every((t=>t in this._attr))}get supportsPrev(){return!!this._attr.supported_features&&(16|this._attr.supported_features)===this._attr.supported_features}get supportsNext(){return!!this._attr.supported_features&&(32|this._attr.supported_features)===this._attr.supported_features}get progress(){return this.isPlaying?this.position+(Date.now()-new Date(this.updatedAt).getTime())/1e3:this.position}get idleView(){const t=this.config.idle_view;return!!((null==t?void 0:t.when_idle)&&this.isIdle||(null==t?void 0:t.when_standby)&&this.isStandby||(null==t?void 0:t.when_paused)&&this.isPaused)||!(!this.updatedAt||!(null==t?void 0:t.after)||this.isPlaying)&&this.checkIdleAfter(t.after)}get trackIdle(){var t,e;return Boolean(this._active&&!this.isPlaying&&this.updatedAt&&(null===(e=null===(t=this.config)||void 0===t?void 0:t.idle_view)||void 0===e?void 0:e.after))}checkIdleAfter(t){const e=(Date.now()-new Date(this.updatedAt).getTime())/1e3;return this.idle=e>60*t,this._active=this.isActive,this.idle}get supportsShuffle(){return void 0!==this._attr.shuffle}get supportsRepeat(){return void 0!==this._attr.repeat}get supportsMute(){return void 0!==this._attr.is_volume_muted}get supportsVolumeSet(){return void 0!==this._attr.volume_level}get supportsMaster(){return this.platform!==Kt&&this.config.speaker_group.supports_master}async fetchArtwork(){const t=this._attr.entity_picture_local?this.hass.hassUrl(this.picture):this.picture;try{const e=await fetch(new Request(t)),i=(t=>{let e="";return[].slice.call(new Uint8Array(t)).forEach((t=>e+=String.fromCharCode(t))),window.btoa(e)})(await e.arrayBuffer());return`url(data:${e.headers.get("Content-Type")||"image/jpeg"};base64,${i})`}catch(t){return!1}}getAttribute(t){return this._attr[t]}toggle(t){return this.config.toggle_power?this.callService(t,"toggle"):this.isOff?this.callService(t,"turn_on"):void this.callService(t,"turn_off")}toggleMute(t){this.config.speaker_group.sync_volume?this.group.forEach((e=>{this.callService(t,"volume_mute",{entity_id:e,is_volume_muted:!this.muted})})):this.callService(t,"volume_mute",{is_volume_muted:!this.muted})}toggleShuffle(t){this.callService(t,"shuffle_set",{shuffle:!this.shuffle})}toggleRepeat(t){const e=Object.values(Vt),{length:i}=e,r=e.indexOf(this.repeat)-1,o=e[(r-1%i+i)%i];this.callService(t,"repeat_set",{repeat:o})}setSource(t,e){this.callService(t,"select_source",{source:e})}setMedia(t,e){this.callService(t,"play_media",Object.assign({},e))}play(t){this.callService(t,"media_play")}pause(t){this.callService(t,"media_pause")}playPause(t){this.callService(t,"media_play_pause")}playStop(t){this.isPlaying?this.callService(t,"media_stop"):this.callService(t,"media_play")}setSoundMode(t,e){this.callService(t,"select_sound_mode",{sound_mode:e})}next(t){this.callService(t,"media_next_track")}prev(t){this.callService(t,"media_previous_track")}stop(t){this.callService(t,"media_stop")}volumeUp(t){this.supportsVolumeSet&&this.config.volume_step&&this.config.volume_step>0?this.callService(t,"volume_set",{entity_id:this._entityId,volume_level:Math.min(this.vol+this.config.volume_step/100,1)}):this.callService(t,"volume_up")}volumeDown(t){this.supportsVolumeSet&&this.config.volume_step&&this.config.volume_step>0?this.callService(t,"volume_set",{entity_id:this._entityId,volume_level:Math.max(this.vol-this.config.volume_step/100,0)}):this.callService(t,"volume_down")}seek(t,e){this.callService(t,"media_seek",{seek_position:e})}jump(t,e){const i=this.progress+e,r=Math.min(Math.max(i,0),Number(this.mediaDuration)||i);this.callService(t,"media_seek",{seek_position:r})}setVolume(t,e){this.config.speaker_group.sync_volume&&this.config.speaker_group.entities?this.group.forEach((i=>{var r;const o=null===(r=this.config.speaker_group.entities)||void 0===r?void 0:r.find((t=>t.entity_id===i));if(void 0===o)return;let n=e;o.volume_offset&&(n+=o.volume_offset/100,n>1&&(n=1),n<0&&(n=0)),this.callService(t,"volume_set",{entity_id:i,volume_level:n})})):this.callService(t,"volume_set",{entity_id:this._entityId,volume_level:e})}handleGroupChange(t,e,i){const{platform:r}=this,o={entity_id:e};if(i)switch(o.master=this._entityId,r){case Qt:return this.handleSoundtouch(t,this.isGrouped?"ADD_ZONE_SLAVE":"CREATE_ZONE",e);case Kt:return this.callService(t,"sync",{entity_id:this._entityId,other_player:e},Kt);case te:case Yt:return this.callService(t,"join",{entity_id:this._entityId,group_members:e},te);case ee:return this.callService(t,"join",{entity_id:this._entityId,group_members:this.group.concat("string"==typeof e?[e]:e)},te);default:return this.callService(t,"join",o,r)}else switch(r){case Qt:return this.handleSoundtouch(t,"REMOVE_ZONE_SLAVE",e);case Kt:return this.callService(t,"unsync",o,Kt);case te:case Yt:return this.callService(t,"unjoin",{entity_id:e},te);case ee:return this.callService(t,"unjoin",{entity_id:"string"==typeof e?e:e[0]},te);default:return this.callService(t,"unjoin",o,r)}}handleSoundtouch(t,e,i){return this.callService(t,e,{master:this.master,slaves:i},Qt,!0)}toggleScript(t,e,i={}){const[,r]=e.split(".");this.callService(t,r,Object.assign({},i),"script")}toggleService(t,e,i={}){t.stopPropagation();const[r,o]=e.split(".");this.hass.callService(r,o,Object.assign({},i))}callService(t,e,i,r="media_player",o=!1){t.stopPropagation(),this.hass.callService(r,e,Object.assign(Object.assign({},!o&&{entity_id:this._entityId}),i))}}const se=it` :host { overflow: visible !important; display: block; @@ -257,6 +257,13 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons --switch-unchecked-color: var(--mmp-text-color); --switch-unchecked-button-color: var(--mmp-text-color); --switch-unchecked-track-color: var(--mmp-text-color); + --mdc-text-field-fill-color: transparent; + --mdc-text-field-ink-color: var(--mmp-text-color); + --mdc-text-field-idle-line-color: var(--mmp-text-color); + --mdc-text-field-label-ink-color: var(--mmp-text-color); + --mdc-text-field-hover-line-color: var(--mmp-text-color); + --mdc-ripple-color: var(--mmp-text-color); + --text-field-padding: 0; color: var(--mmp-text-color); } ha-card { @@ -385,7 +392,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons background-size: cover; background-repeat: no-repeat; background-position: center center; - border-radius: var(--ha-card-border-radius, 0); + border-radius: var(--mmp-border-radius, 0); overflow: hidden; } .cover.--prev { @@ -396,8 +403,6 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons } ha-card[artwork*='full-cover'].--has-artwork .mmp-player { background: linear-gradient(to top, var(--mmp-overlay-color) var(--mmp-overlay-color-stop), transparent 100%); - border-bottom-left-radius: var(--ha-card-border-radius, 0); - border-bottom-right-radius: var(--ha-card-border-radius, 0); } ha-card.--has-artwork .cover, ha-card.--has-artwork[artwork='cover'] .cover:before { @@ -651,7 +656,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons ha-switch { padding: 16px 6px; } -`,le=it` +`,ae=it` .ellipsis { overflow: hidden; text-overflow: ellipsis; @@ -681,7 +686,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons mmp-icon-button ha-icon { display: flex; } -`;var ce=(t,e,i,r,o)=>{let n;switch(r.action){case"more-info":n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:r.entity||o},t.dispatchEvent(n);break;case"navigate":if(!r.navigation_path)return;window.history.pushState(null,"",r.navigation_path),n=new Event("location-changed",{composed:!0}),n.detail={replace:!1},window.dispatchEvent(n);break;case"call-service":{if(!r.service)return;const[t,i]=r.service.split(".",2),o={...r.service_data};e.callService(t,i,o);break}case"url":if(!r.url)return;r.new_tab?window.open(r.url,"_blank"):window.location.href=r.url;break;case"fire-dom-event":n=new Event("ll-custom",{composed:!0,bubbles:!0}),n.detail=r,t.dispatchEvent(n)}r.haptic&&((t,e)=>{const i=new Event("haptic",{composed:!0});i.detail={haptic:e},t.dispatchEvent(i)})(t,r.haptic)};var pe,he,ue,de=(pe=function(t,e){var i;window,i=function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(r,o,function(e){return t[e]}.bind(null,o));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=10)}([function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.assignDeep=e.mapValues=void 0,e.mapValues=function(t,e){var i={};for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];i[r]=e(o)}return i},e.assignDeep=function t(e){for(var i=[],r=1;r0){var o=Math.max(e,i);o>t.maxDimension&&(r=t.maxDimension/o)}else r=1/t.quality;r<1&&this.resize(e*r,i*r,r)},t}();e.ImageBase=r,e.applyFilters=function(t,e){if(e.length>0)for(var i=t.data,r=i.length/4,o=void 0,n=void 0,s=void 0,a=void 0,l=void 0,c=0;c0?t.filter((function(t){for(var i=t.r,r=t.g,o=t.b,n=0;n.04045?Math.pow((t+.005)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.005)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.005)/1.055,2.4):i/12.92,[.4124*(t*=100)+.3576*(e*=100)+.1805*(i*=100),.2126*t+.7152*e+.0722*i,.0193*t+.1192*e+.9505*i]}function n(t,e,i){return e/=100,i/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116)-16,500*(t-e),200*(e-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]}function s(t,e,i){var r=o(t,e,i);return n(r[0],r[1],r[2])}function a(t,e){var i=t[0],r=t[1],o=t[2],n=e[0],s=e[1],a=e[2],l=i-n,c=r-s,p=o-a,h=Math.sqrt(r*r+o*o),u=n-i,d=Math.sqrt(s*s+a*a)-h,m=Math.sqrt(l*l+c*c+p*p),g=Math.sqrt(m)>Math.sqrt(Math.abs(u))+Math.sqrt(Math.abs(d))?Math.sqrt(m*m-u*u-d*d):0;return u/=1,d/=1*(1+.045*h),g/=1*(1+.015*h),Math.sqrt(u*u+d*d+g*g)}function l(t,e){return a(s.apply(void 0,t),s.apply(void 0,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.getColorDiffStatus=e.hexDiff=e.rgbDiff=e.deltaE94=e.rgbToCIELab=e.xyzToCIELab=e.rgbToXyz=e.hslToRgb=e.rgbToHsl=e.rgbToHex=e.hexToRgb=e.DELTAE94_DIFF_STATUS=void 0,e.DELTAE94_DIFF_STATUS={NA:0,PERFECT:1,CLOSE:2,GOOD:10,SIMILAR:50},e.hexToRgb=r,e.rgbToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7)},e.rgbToHsl=function(t,e,i){t/=255,e/=255,i/=255;var r=Math.max(t,e,i),o=Math.min(t,e,i),n=0,s=0,a=(r+o)/2;if(r!==o){var l=r-o;switch(s=a>.5?l/(2-r-o):l/(r+o),r){case t:n=(e-i)/l+(e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}if(0===e)r=o=n=i;else{var a=i<.5?i*(1+e):i+e-i*e,l=2*i-a;r=s(l,a,t+1/3),o=s(l,a,t),n=s(l,a,t-1/3)}return[255*r,255*o,255*n]},e.rgbToXyz=o,e.xyzToCIELab=n,e.rgbToCIELab=s,e.deltaE94=a,e.rgbDiff=l,e.hexDiff=function(t,e){return l(r(t),r(e))},e.getColorDiffStatus=function(t){return t0&&this._opts.filters.splice(e)}return this},t.prototype.clearFilters=function(){return this._opts.filters=[],this},t.prototype.quality=function(t){return this._opts.quality=t,this},t.prototype.useImageClass=function(t){return this._opts.ImageClass=t,this},t.prototype.useGenerator=function(t,e){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(e?{name:t,options:e}:t),this},t.prototype.useQuantizer=function(t,e){return this._opts.quantizer=e?{name:t,options:e}:t,this},t.prototype.build=function(){return new o.default(this._src,this._opts)},t.prototype.getPalette=function(t){return this.build().getPalette(t)},t.prototype.getSwatches=function(t){return this.build().getPalette(t)},t}();e.default=s},function(t,e,i){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},r(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype._initCanvas=function(){var t=this.image,e=this._canvas=document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new ReferenceError("Failed to create canvas context");this._context=i,e.className="@vibrant/canvas",e.style.display="none",this._width=e.width=t.width,this._height=e.height=t.height,i.drawImage(t,0,0),document.body.appendChild(e)},e.prototype.load=function(t){var e,i,r,o,n,s,a,l=this;if("string"==typeof t)e=document.createElement("img"),i=t,(a=new URL(i,location.href)).protocol===location.protocol&&a.host===location.host&&a.port===location.port||(r=window.location.href,o=i,n=new URL(r),s=new URL(o),n.protocol===s.protocol&&n.hostname===s.hostname&&n.port===s.port)||(e.crossOrigin="anonymous"),e.src=i;else{if(!(t instanceof HTMLImageElement))return Promise.reject(new Error("Cannot load buffer as an image in browser"));e=t,i=t.src}return this.image=e,new Promise((function(t,r){var o=function(){l._initCanvas(),t(l)};e.complete?o():(e.onload=o,e.onerror=function(t){return r(new Error("Fail to load image: "+i))})}))},e.prototype.clear=function(){this._context.clearRect(0,0,this._width,this._height)},e.prototype.update=function(t){this._context.putImageData(t,0,0)},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.resize=function(t,e,i){var r=this,o=r._canvas,n=r._context,s=r.image;this._width=o.width=t,this._height=o.height=e,n.scale(i,i),n.drawImage(s,0,0)},e.prototype.getPixelCount=function(){return this._width*this._height},e.prototype.getImageData=function(){return this._context.getImageData(0,0,this._width,this._height)},e.prototype.remove=function(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)},e}(i(2).ImageBase);e.default=n},function(t,e,i){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},o=i(5),n=r(i(11));o.use(n.default),t.exports=o},function(t,e,i){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(i(12)),n=r(i(16)),s=(new(i(17).BasicPipeline)).filter.register("default",(function(t,e,i,r){return r>=125&&!(t>250&&e>250&&i>250)})).quantizer.register("mmcq",o.default).generator.register("default",n.default);e.default=s},function(t,e,i){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(3),n=r(i(13)),s=r(i(15));function a(t,e){for(var i=t.size();t.size()0))break;var o=r.split(),n=o[0],s=o[1];if(t.push(n),s&&s.count()>0&&t.push(s),t.size()===i)break;i=t.size()}}e.default=function(t,e){if(0===t.length||e.colorCount<2||e.colorCount>256)throw new Error("Wrong MMCQ parameters");var i=n.default.build(t);i.histogram.colorCount;var r=new s.default((function(t,e){return t.count()-e.count()}));r.push(i),a(r,.75*e.colorCount);var l=new s.default((function(t,e){return t.count()*t.volume()-e.count()*e.volume()}));return l.contents=r.contents,a(l,e.colorCount-l.size()),function(t){for(var e=[];t.size();){var i=t.pop(),r=i.avg();r[0],r[1],r[2],e.push(new o.Swatch(r,i.count()))}return e}(l)}},function(t,e,i){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(i(14)),n=function(){function t(t,e,i,r,o,n,s){this.histogram=s,this._volume=-1,this._count=-1,this.dimension={r1:t,r2:e,g1:i,g2:r,b1:o,b2:n}}return t.build=function(e){var i=new o.default(e,{sigBits:5});return new t(i.rmin,i.rmax,i.gmin,i.gmax,i.bmin,i.bmax,i)},t.prototype.invalidate=function(){this._volume=this._count=-1,this._avg=null},t.prototype.volume=function(){if(this._volume<0){var t=this.dimension,e=t.r1,i=t.r2,r=t.g1,o=t.g2,n=t.b1,s=t.b2;this._volume=(i-e+1)*(o-r+1)*(s-n+1)}return this._volume},t.prototype.count=function(){if(this._count<0){for(var t=this.histogram,e=t.hist,i=t.getColorIndex,r=this.dimension,o=r.r1,n=r.r2,s=r.g1,a=r.g2,l=r.b1,c=r.b2,p=0,h=o;h<=n;h++)for(var u=s;u<=a;u++)for(var d=l;d<=c;d++)p+=e[i(h,u,d)];this._count=p}return this._count},t.prototype.clone=function(){var e=this.histogram,i=this.dimension;return new t(i.r1,i.r2,i.g1,i.g2,i.b1,i.b2,e)},t.prototype.avg=function(){if(!this._avg){var t=this.histogram,e=t.hist,i=t.getColorIndex,r=this.dimension,o=r.r1,n=r.r2,s=r.g1,a=r.g2,l=r.b1,c=r.b2,p=0,h=void 0,u=void 0,d=void 0;h=u=d=0;for(var m=o;m<=n;m++)for(var g=s;g<=a;g++)for(var f=l;f<=c;f++){var v=e[i(m,g,f)];p+=v,h+=v*(m+.5)*8,u+=v*(g+.5)*8,d+=v*(f+.5)*8}this._avg=p?[~~(h/p),~~(u/p),~~(d/p)]:[~~(8*(o+n+1)/2),~~(8*(s+a+1)/2),~~(8*(l+c+1)/2)]}return this._avg},t.prototype.contains=function(t){var e=t[0],i=t[1],r=t[2],o=this.dimension,n=o.r1,s=o.r2,a=o.g1,l=o.g2,c=o.b1,p=o.b2;return i>>=3,r>>=3,(e>>=3)>=n&&e<=s&&i>=a&&i<=l&&r>=c&&r<=p},t.prototype.split=function(){var t=this.histogram,e=t.hist,i=t.getColorIndex,r=this.dimension,o=r.r1,n=r.r2,s=r.g1,a=r.g2,l=r.b1,c=r.b2,p=this.count();if(!p)return[];if(1===p)return[this.clone()];var h,u,d=n-o+1,m=a-s+1,g=c-l+1,f=Math.max(d,m,g),v=null;h=u=0;var _=null;if(f===d){_="r",v=new Uint32Array(n+1);for(var y=o;y<=n;y++){h=0;for(var b=s;b<=a;b++)for(var w=l;w<=c;w++)h+=e[i(y,b,w)];u+=h,v[y]=u}}else if(f===m)for(_="g",v=new Uint32Array(a+1),b=s;b<=a;b++){for(h=0,y=o;y<=n;y++)for(w=l;w<=c;w++)h+=e[i(y,b,w)];u+=h,v[b]=u}else for(_="b",v=new Uint32Array(c+1),w=l;w<=c;w++){for(h=0,y=o;y<=n;y++)for(b=s;b<=a;b++)h+=e[i(y,b,w)];u+=h,v[w]=u}for(var x=-1,k=new Uint32Array(v.length),S=0;Su/2&&(x=S),k[S]=u-$}var P=this;return function(t){var e=t+"1",i=t+"2",r=P.dimension[e],o=P.dimension[i],n=P.clone(),s=P.clone(),a=x-r,l=o-x;for(a<=l?(o=Math.min(o-1,~~(x+l/2)),o=Math.max(0,o)):(o=Math.max(r,~~(x-1-a/2)),o=Math.min(P.dimension[i],o));!v[o];)o++;for(var c=k[o];!c&&v[o-1];)c=k[--o];return n.dimension[i]=o,s.dimension[e]=o+1,[n,s]}(_)},t}();e.default=n},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){this.pixels=t,this.opts=e;var i=e.sigBits,r=function(t,e,r){return(t<<2*i)+(e<>=d,h>>=d,u>>=d)]+=1,p>o&&(o=p),ps&&(s=h),hl&&(l=u),u0?t+1:t}),0),this.hist=m,this.rmax=o,this.rmin=n,this.gmax=s,this.gmin=a,this.bmax=l,this.bmin=c}return Object.defineProperty(t.prototype,"colorCount",{get:function(){return this._colorCount},enumerable:!1,configurable:!0}),t}();e.default=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this._comparator=t,this.contents=[],this._sorted=!1}return t.prototype._sort=function(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)},t.prototype.push=function(t){this.contents.push(t),this._sorted=!1},t.prototype.peek=function(t){return this._sort(),t="number"==typeof t?t:this.contents.length-1,this.contents[t]},t.prototype.pop=function(){return this._sort(),this.contents.pop()},t.prototype.size=function(){return this.contents.length},t.prototype.map=function(t){return this._sort(),this.contents.map(t)},t}();e.default=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),o=i(4),n={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function s(t,e,i,r,o,n,s,a,l,c){var p=null,h=0;return e.forEach((function(e){var u=e.hsl,d=u[1],m=u[2];if(d>=a&&d<=l&&m>=o&&m<=n&&!function(t,e){return t.Vibrant===e||t.DarkVibrant===e||t.LightVibrant===e||t.Muted===e||t.DarkMuted===e||t.LightMuted===e}(t,e)){var g=function(t,e,i,r,o,n,s){function a(t,e){return 1-Math.abs(t-e)}return function(){for(var t=[],e=0;eh)&&(p=e,h=g)}})),p}e.default=function(t,e){e=Object.assign({},n,e);var i=function(t){var e=0;return t.forEach((function(t){e=Math.max(e,t.population)})),e}(t),a=function(t,e,i){var r={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return r.Vibrant=s(r,t,e,i.targetNormalLuma,i.minNormalLuma,i.maxNormalLuma,i.targetVibrantSaturation,i.minVibrantSaturation,1,i),r.LightVibrant=s(r,t,e,i.targetLightLuma,i.minLightLuma,1,i.targetVibrantSaturation,i.minVibrantSaturation,1,i),r.DarkVibrant=s(r,t,e,i.targetDarkLuma,0,i.maxDarkLuma,i.targetVibrantSaturation,i.minVibrantSaturation,1,i),r.Muted=s(r,t,e,i.targetNormalLuma,i.minNormalLuma,i.maxNormalLuma,i.targetMutesSaturation,0,i.maxMutesSaturation,i),r.LightMuted=s(r,t,e,i.targetLightLuma,i.minLightLuma,1,i.targetMutesSaturation,0,i.maxMutesSaturation,i),r.DarkMuted=s(r,t,e,i.targetDarkLuma,0,i.maxDarkLuma,i.targetMutesSaturation,0,i.maxMutesSaturation,i),r}(t,i,e);return function(t,e,i){if(!t.Vibrant&&!t.DarkVibrant&&!t.LightVibrant){if(!t.DarkVibrant&&t.DarkMuted){var n=t.DarkMuted.hsl,s=n[0],a=n[1],l=n[2];l=i.targetDarkLuma,t.DarkVibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.LightVibrant&&t.LightMuted){var c=t.LightMuted.hsl;s=c[0],a=c[1],l=c[2],l=i.targetDarkLuma,t.DarkVibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}}if(!t.Vibrant&&t.DarkVibrant){var p=t.DarkVibrant.hsl;s=p[0],a=p[1],l=p[2],l=i.targetNormalLuma,t.Vibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}else if(!t.Vibrant&&t.LightVibrant){var h=t.LightVibrant.hsl;s=h[0],a=h[1],l=h[2],l=i.targetNormalLuma,t.Vibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.DarkVibrant&&t.Vibrant){var u=t.Vibrant.hsl;s=u[0],a=u[1],l=u[2],l=i.targetDarkLuma,t.DarkVibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.LightVibrant&&t.Vibrant){var d=t.Vibrant.hsl;s=d[0],a=d[1],l=d[2],l=i.targetLightLuma,t.LightVibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.Muted&&t.Vibrant){var m=t.Vibrant.hsl;s=m[0],a=m[1],l=m[2],l=i.targetMutesSaturation,t.Muted=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.DarkMuted&&t.DarkVibrant){var g=t.DarkVibrant.hsl;s=g[0],a=g[1],l=g[2],l=i.targetMutesSaturation,t.DarkMuted=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.LightMuted&&t.LightVibrant){var f=t.LightVibrant.hsl;s=f[0],a=f[1],l=f[2],l=i.targetMutesSaturation,t.LightMuted=new r.Swatch(o.hslToRgb(s,a,l),0)}}(a,0,e),a}},function(t,e,i){var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(o,n){function s(t){try{l(r.next(t))}catch(t){n(t)}}function a(t){try{l(r.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var i,r,o,n,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(o=2&n[0]?r.return:n[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,n[1])).done)return o;switch(r=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,r=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){s=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]{const r=[t,e,i].map((t=>{let e=t;return e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4}));return.2126*r[0]+.7152*r[1]+.0722*r[2]},fe=(t,e)=>Math.round(100*(((t,e)=>{const i=ge(...t),r=ge(...e);return(Math.max(i,r)+.05)/(Math.min(i,r)+.05)})(t,e)+Number.EPSILON))/100;me._pipeline.generator.register("default",(t=>{t.sort(((t,e)=>e.population-t.population));const e=t[0];let i;const r=new Map,o=(t,i)=>(r.has(t)||r.set(t,fe(e.rgb,i)),r.get(t)>4.5);for(let e=1;e150)&&o(e.hex,e.rgb)){i=e.rgb;break}}}return void 0===i&&(i=e.getYiq()<200?[255,255,255]:[0,0,0]),[new e.constructor(i,0).hex,e.hex]}));customElements.get("ha-slider")||customElements.define("ha-slider",class extends(customElements.get("paper-slider")){}),customElements.get("ha-icon-button")||customElements.define("ha-icon-button",class extends(customElements.get("paper-icon-button")){}),customElements.get("ha-icon")||customElements.define("ha-icon",class extends(customElements.get("iron-icon")){});const ve={en:{placeholder:{tts:"Text to speech"},label:{leave:"Leave",ungroup:"Ungroup",group_all:"Group all",send:"Send",master:"Master"},state:{idle:"Idle",unavailable:"Unavailable"},title:{speaker_management:"Group management"}},de:{placeholder:{tts:"Text zum Sprechen"},label:{leave:"Verlassen",ungroup:"Teilen",group_all:"Gruppieren",send:"Senden",master:"Master"},state:{idle:"Pause",unavailable:"Nicht verfügbar"},title:{speaker_management:"Wiedergabe auf"}},fr:{placeholder:{tts:"Texte à lire"},label:{leave:"Quitter",ungroup:"Dégrouper",group_all:"Grouper tous",send:"Envoyer"},state:{idle:"Inactif",unavailable:"Indisponible"},title:{speaker_management:"Gestion des groupes"}},hu:{placeholder:{tts:"Szövegfelolvasás"},label:{leave:"Kilépés",ungroup:"Összes ki",group_all:"Összes be",send:"Küldés",master:"Forrás"},state:{idle:"Tétlen",unavailable:"Nem elérhető"},title:{speaker_management:"Hangszórók csoportosítása"}},no:{placeholder:{tts:"Tekst til tale"},label:{leave:"Forlat",ungroup:"Oppløs gruppe",group_all:"Grupper alle",send:"Send",master:"Master"},state:{idle:"Inaktiv",unavailable:"Utilgjengelig"},title:{speaker_management:"Gruppestyring"}},pl:{placeholder:{tts:"Zamień tekst na mowę"},label:{leave:"Opuść",ungroup:"Usuń grupę",group_all:"Grupuj wszystkie",send:"Wyślij"},state:{idle:"nieaktywny",unavailable:"niedostępny"},title:{speaker_management:"Zarządzanie grupą"}},uk:{placeholder:{tts:"Текст для відтворення"},label:{leave:"Залишити",ungroup:"Розгрупувати",group_all:"Згрупувати всі",send:"Надіслати",master:"Головний"},state:{idle:"бездіяльність",unavailable:"недоступний"},title:{speaker_management:"Управління групою"}},cz:{placeholder:{tts:"Převeď text na řeč"},label:{leave:"Odejít",ungroup:"Zrušit seskupení",group_all:"Seskupit vše",send:"Poslat",master:"Master"},state:{idle:"Nečinný",unavailable:"Nedostupný"},title:{speaker_management:"Správa skupin"}},ru:{placeholder:{tts:"Преобразование текста в речь"},label:{leave:"Покинуть",ungroup:"Разгруппировать",group_all:"Сгруппировать все",send:"Отправить",master:"Мастер"},state:{idle:"Бездействие",unavailable:"Недоступен"},title:{speaker_management:"Управление группой"}},es:{placeholder:{tts:"Texto a voz"},label:{leave:"Salir",ungroup:"Desagrupar",group_all:"Agrupar todos",send:"Enviar",master:"Maestro"},state:{idle:"Inactivo",unavailable:"No disponible"},title:{speaker_management:"Gestión de grupo"}},zh:{placeholder:{tts:"播放文本"},label:{leave:"退出",ungroup:"取消组合",group_all:"组合全部",send:"发送",master:"主要的"},state:{idle:"空闲",unavailable:"不可用"},title:{speaker_management:"组合管理"}},ca:{placeholder:{tts:"Text a veu"},label:{leave:"Sortir",ungroup:"Desagrupar",group_all:"Agrupar-los tots",send:"Enviar",master:"Mestre"},state:{idle:"Inactiu",unavailable:"No disponible"},title:{speaker_management:"Gestió del grup"}}},_e=(t,e)=>e.split(".").reduce(((t,e)=>t&&t[e]||null),t),ye=(t,e,i,r="unknown")=>{const o=t.selectedLanguage||t.language,n=o.split("-")[0];return ve[o]&&_e(ve[o],e)||t.resources[o]&&i&&t.resources[o][i]||ve[n]&&_e(ve[n],e)||_e(ve.en,e)||r};let be=class extends ot{render(){return I` +`;var le=(t,e,i,r,o)=>{let n;switch(r.action){case"more-info":n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:r.entity||o},t.dispatchEvent(n);break;case"navigate":if(!r.navigation_path)return;window.history.pushState(null,"",r.navigation_path),n=new Event("location-changed",{composed:!0}),n.detail={replace:!1},window.dispatchEvent(n);break;case"call-service":{if(!r.service)return;const[t,i]=r.service.split(".",2),o={...r.service_data};e.callService(t,i,o);break}case"url":if(!r.url)return;r.new_tab?window.open(r.url,"_blank"):window.location.href=r.url;break;case"fire-dom-event":n=new Event("ll-custom",{composed:!0,bubbles:!0}),n.detail=r,t.dispatchEvent(n)}r.haptic&&((t,e)=>{const i=new Event("haptic",{composed:!0});i.detail={haptic:e},t.dispatchEvent(i)})(t,r.haptic)};var ce,ue,he,pe=(ce=function(t,e){var i;window,i=function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(r,o,function(e){return t[e]}.bind(null,o));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=10)}([function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.assignDeep=e.mapValues=void 0,e.mapValues=function(t,e){var i={};for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];i[r]=e(o)}return i},e.assignDeep=function t(e){for(var i=[],r=1;r0){var o=Math.max(e,i);o>t.maxDimension&&(r=t.maxDimension/o)}else r=1/t.quality;r<1&&this.resize(e*r,i*r,r)},t}();e.ImageBase=r,e.applyFilters=function(t,e){if(e.length>0)for(var i=t.data,r=i.length/4,o=void 0,n=void 0,s=void 0,a=void 0,l=void 0,c=0;c0?t.filter((function(t){for(var i=t.r,r=t.g,o=t.b,n=0;n.04045?Math.pow((t+.005)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.005)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.005)/1.055,2.4):i/12.92,[.4124*(t*=100)+.3576*(e*=100)+.1805*(i*=100),.2126*t+.7152*e+.0722*i,.0193*t+.1192*e+.9505*i]}function n(t,e,i){return e/=100,i/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116)-16,500*(t-e),200*(e-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]}function s(t,e,i){var r=o(t,e,i);return n(r[0],r[1],r[2])}function a(t,e){var i=t[0],r=t[1],o=t[2],n=e[0],s=e[1],a=e[2],l=i-n,c=r-s,u=o-a,h=Math.sqrt(r*r+o*o),p=n-i,d=Math.sqrt(s*s+a*a)-h,m=Math.sqrt(l*l+c*c+u*u),g=Math.sqrt(m)>Math.sqrt(Math.abs(p))+Math.sqrt(Math.abs(d))?Math.sqrt(m*m-p*p-d*d):0;return p/=1,d/=1*(1+.045*h),g/=1*(1+.015*h),Math.sqrt(p*p+d*d+g*g)}function l(t,e){return a(s.apply(void 0,t),s.apply(void 0,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.getColorDiffStatus=e.hexDiff=e.rgbDiff=e.deltaE94=e.rgbToCIELab=e.xyzToCIELab=e.rgbToXyz=e.hslToRgb=e.rgbToHsl=e.rgbToHex=e.hexToRgb=e.DELTAE94_DIFF_STATUS=void 0,e.DELTAE94_DIFF_STATUS={NA:0,PERFECT:1,CLOSE:2,GOOD:10,SIMILAR:50},e.hexToRgb=r,e.rgbToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7)},e.rgbToHsl=function(t,e,i){t/=255,e/=255,i/=255;var r=Math.max(t,e,i),o=Math.min(t,e,i),n=0,s=0,a=(r+o)/2;if(r!==o){var l=r-o;switch(s=a>.5?l/(2-r-o):l/(r+o),r){case t:n=(e-i)/l+(e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}if(0===e)r=o=n=i;else{var a=i<.5?i*(1+e):i+e-i*e,l=2*i-a;r=s(l,a,t+1/3),o=s(l,a,t),n=s(l,a,t-1/3)}return[255*r,255*o,255*n]},e.rgbToXyz=o,e.xyzToCIELab=n,e.rgbToCIELab=s,e.deltaE94=a,e.rgbDiff=l,e.hexDiff=function(t,e){return l(r(t),r(e))},e.getColorDiffStatus=function(t){return t0&&this._opts.filters.splice(e)}return this},t.prototype.clearFilters=function(){return this._opts.filters=[],this},t.prototype.quality=function(t){return this._opts.quality=t,this},t.prototype.useImageClass=function(t){return this._opts.ImageClass=t,this},t.prototype.useGenerator=function(t,e){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(e?{name:t,options:e}:t),this},t.prototype.useQuantizer=function(t,e){return this._opts.quantizer=e?{name:t,options:e}:t,this},t.prototype.build=function(){return new o.default(this._src,this._opts)},t.prototype.getPalette=function(t){return this.build().getPalette(t)},t.prototype.getSwatches=function(t){return this.build().getPalette(t)},t}();e.default=s},function(t,e,i){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},r(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype._initCanvas=function(){var t=this.image,e=this._canvas=document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new ReferenceError("Failed to create canvas context");this._context=i,e.className="@vibrant/canvas",e.style.display="none",this._width=e.width=t.width,this._height=e.height=t.height,i.drawImage(t,0,0),document.body.appendChild(e)},e.prototype.load=function(t){var e,i,r,o,n,s,a,l=this;if("string"==typeof t)e=document.createElement("img"),i=t,(a=new URL(i,location.href)).protocol===location.protocol&&a.host===location.host&&a.port===location.port||(r=window.location.href,o=i,n=new URL(r),s=new URL(o),n.protocol===s.protocol&&n.hostname===s.hostname&&n.port===s.port)||(e.crossOrigin="anonymous"),e.src=i;else{if(!(t instanceof HTMLImageElement))return Promise.reject(new Error("Cannot load buffer as an image in browser"));e=t,i=t.src}return this.image=e,new Promise((function(t,r){var o=function(){l._initCanvas(),t(l)};e.complete?o():(e.onload=o,e.onerror=function(t){return r(new Error("Fail to load image: "+i))})}))},e.prototype.clear=function(){this._context.clearRect(0,0,this._width,this._height)},e.prototype.update=function(t){this._context.putImageData(t,0,0)},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.resize=function(t,e,i){var r=this,o=r._canvas,n=r._context,s=r.image;this._width=o.width=t,this._height=o.height=e,n.scale(i,i),n.drawImage(s,0,0)},e.prototype.getPixelCount=function(){return this._width*this._height},e.prototype.getImageData=function(){return this._context.getImageData(0,0,this._width,this._height)},e.prototype.remove=function(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)},e}(i(2).ImageBase);e.default=n},function(t,e,i){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},o=i(5),n=r(i(11));o.use(n.default),t.exports=o},function(t,e,i){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(i(12)),n=r(i(16)),s=(new(i(17).BasicPipeline)).filter.register("default",(function(t,e,i,r){return r>=125&&!(t>250&&e>250&&i>250)})).quantizer.register("mmcq",o.default).generator.register("default",n.default);e.default=s},function(t,e,i){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(3),n=r(i(13)),s=r(i(15));function a(t,e){for(var i=t.size();t.size()0))break;var o=r.split(),n=o[0],s=o[1];if(t.push(n),s&&s.count()>0&&t.push(s),t.size()===i)break;i=t.size()}}e.default=function(t,e){if(0===t.length||e.colorCount<2||e.colorCount>256)throw new Error("Wrong MMCQ parameters");var i=n.default.build(t);i.histogram.colorCount;var r=new s.default((function(t,e){return t.count()-e.count()}));r.push(i),a(r,.75*e.colorCount);var l=new s.default((function(t,e){return t.count()*t.volume()-e.count()*e.volume()}));return l.contents=r.contents,a(l,e.colorCount-l.size()),function(t){for(var e=[];t.size();){var i=t.pop(),r=i.avg();r[0],r[1],r[2],e.push(new o.Swatch(r,i.count()))}return e}(l)}},function(t,e,i){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(i(14)),n=function(){function t(t,e,i,r,o,n,s){this.histogram=s,this._volume=-1,this._count=-1,this.dimension={r1:t,r2:e,g1:i,g2:r,b1:o,b2:n}}return t.build=function(e){var i=new o.default(e,{sigBits:5});return new t(i.rmin,i.rmax,i.gmin,i.gmax,i.bmin,i.bmax,i)},t.prototype.invalidate=function(){this._volume=this._count=-1,this._avg=null},t.prototype.volume=function(){if(this._volume<0){var t=this.dimension,e=t.r1,i=t.r2,r=t.g1,o=t.g2,n=t.b1,s=t.b2;this._volume=(i-e+1)*(o-r+1)*(s-n+1)}return this._volume},t.prototype.count=function(){if(this._count<0){for(var t=this.histogram,e=t.hist,i=t.getColorIndex,r=this.dimension,o=r.r1,n=r.r2,s=r.g1,a=r.g2,l=r.b1,c=r.b2,u=0,h=o;h<=n;h++)for(var p=s;p<=a;p++)for(var d=l;d<=c;d++)u+=e[i(h,p,d)];this._count=u}return this._count},t.prototype.clone=function(){var e=this.histogram,i=this.dimension;return new t(i.r1,i.r2,i.g1,i.g2,i.b1,i.b2,e)},t.prototype.avg=function(){if(!this._avg){var t=this.histogram,e=t.hist,i=t.getColorIndex,r=this.dimension,o=r.r1,n=r.r2,s=r.g1,a=r.g2,l=r.b1,c=r.b2,u=0,h=void 0,p=void 0,d=void 0;h=p=d=0;for(var m=o;m<=n;m++)for(var g=s;g<=a;g++)for(var f=l;f<=c;f++){var v=e[i(m,g,f)];u+=v,h+=v*(m+.5)*8,p+=v*(g+.5)*8,d+=v*(f+.5)*8}this._avg=u?[~~(h/u),~~(p/u),~~(d/u)]:[~~(8*(o+n+1)/2),~~(8*(s+a+1)/2),~~(8*(l+c+1)/2)]}return this._avg},t.prototype.contains=function(t){var e=t[0],i=t[1],r=t[2],o=this.dimension,n=o.r1,s=o.r2,a=o.g1,l=o.g2,c=o.b1,u=o.b2;return i>>=3,r>>=3,(e>>=3)>=n&&e<=s&&i>=a&&i<=l&&r>=c&&r<=u},t.prototype.split=function(){var t=this.histogram,e=t.hist,i=t.getColorIndex,r=this.dimension,o=r.r1,n=r.r2,s=r.g1,a=r.g2,l=r.b1,c=r.b2,u=this.count();if(!u)return[];if(1===u)return[this.clone()];var h,p,d=n-o+1,m=a-s+1,g=c-l+1,f=Math.max(d,m,g),v=null;h=p=0;var _=null;if(f===d){_="r",v=new Uint32Array(n+1);for(var y=o;y<=n;y++){h=0;for(var b=s;b<=a;b++)for(var w=l;w<=c;w++)h+=e[i(y,b,w)];p+=h,v[y]=p}}else if(f===m)for(_="g",v=new Uint32Array(a+1),b=s;b<=a;b++){for(h=0,y=o;y<=n;y++)for(w=l;w<=c;w++)h+=e[i(y,b,w)];p+=h,v[b]=p}else for(_="b",v=new Uint32Array(c+1),w=l;w<=c;w++){for(h=0,y=o;y<=n;y++)for(b=s;b<=a;b++)h+=e[i(y,b,w)];p+=h,v[w]=p}for(var x=-1,k=new Uint32Array(v.length),S=0;Sp/2&&(x=S),k[S]=p-$}var P=this;return function(t){var e=t+"1",i=t+"2",r=P.dimension[e],o=P.dimension[i],n=P.clone(),s=P.clone(),a=x-r,l=o-x;for(a<=l?(o=Math.min(o-1,~~(x+l/2)),o=Math.max(0,o)):(o=Math.max(r,~~(x-1-a/2)),o=Math.min(P.dimension[i],o));!v[o];)o++;for(var c=k[o];!c&&v[o-1];)c=k[--o];return n.dimension[i]=o,s.dimension[e]=o+1,[n,s]}(_)},t}();e.default=n},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){this.pixels=t,this.opts=e;var i=e.sigBits,r=function(t,e,r){return(t<<2*i)+(e<>=d,h>>=d,p>>=d)]+=1,u>o&&(o=u),us&&(s=h),hl&&(l=p),p0?t+1:t}),0),this.hist=m,this.rmax=o,this.rmin=n,this.gmax=s,this.gmin=a,this.bmax=l,this.bmin=c}return Object.defineProperty(t.prototype,"colorCount",{get:function(){return this._colorCount},enumerable:!1,configurable:!0}),t}();e.default=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this._comparator=t,this.contents=[],this._sorted=!1}return t.prototype._sort=function(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)},t.prototype.push=function(t){this.contents.push(t),this._sorted=!1},t.prototype.peek=function(t){return this._sort(),t="number"==typeof t?t:this.contents.length-1,this.contents[t]},t.prototype.pop=function(){return this._sort(),this.contents.pop()},t.prototype.size=function(){return this.contents.length},t.prototype.map=function(t){return this._sort(),this.contents.map(t)},t}();e.default=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),o=i(4),n={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function s(t,e,i,r,o,n,s,a,l,c){var u=null,h=0;return e.forEach((function(e){var p=e.hsl,d=p[1],m=p[2];if(d>=a&&d<=l&&m>=o&&m<=n&&!function(t,e){return t.Vibrant===e||t.DarkVibrant===e||t.LightVibrant===e||t.Muted===e||t.DarkMuted===e||t.LightMuted===e}(t,e)){var g=function(t,e,i,r,o,n,s){function a(t,e){return 1-Math.abs(t-e)}return function(){for(var t=[],e=0;eh)&&(u=e,h=g)}})),u}e.default=function(t,e){e=Object.assign({},n,e);var i=function(t){var e=0;return t.forEach((function(t){e=Math.max(e,t.population)})),e}(t),a=function(t,e,i){var r={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return r.Vibrant=s(r,t,e,i.targetNormalLuma,i.minNormalLuma,i.maxNormalLuma,i.targetVibrantSaturation,i.minVibrantSaturation,1,i),r.LightVibrant=s(r,t,e,i.targetLightLuma,i.minLightLuma,1,i.targetVibrantSaturation,i.minVibrantSaturation,1,i),r.DarkVibrant=s(r,t,e,i.targetDarkLuma,0,i.maxDarkLuma,i.targetVibrantSaturation,i.minVibrantSaturation,1,i),r.Muted=s(r,t,e,i.targetNormalLuma,i.minNormalLuma,i.maxNormalLuma,i.targetMutesSaturation,0,i.maxMutesSaturation,i),r.LightMuted=s(r,t,e,i.targetLightLuma,i.minLightLuma,1,i.targetMutesSaturation,0,i.maxMutesSaturation,i),r.DarkMuted=s(r,t,e,i.targetDarkLuma,0,i.maxDarkLuma,i.targetMutesSaturation,0,i.maxMutesSaturation,i),r}(t,i,e);return function(t,e,i){if(!t.Vibrant&&!t.DarkVibrant&&!t.LightVibrant){if(!t.DarkVibrant&&t.DarkMuted){var n=t.DarkMuted.hsl,s=n[0],a=n[1],l=n[2];l=i.targetDarkLuma,t.DarkVibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.LightVibrant&&t.LightMuted){var c=t.LightMuted.hsl;s=c[0],a=c[1],l=c[2],l=i.targetDarkLuma,t.DarkVibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}}if(!t.Vibrant&&t.DarkVibrant){var u=t.DarkVibrant.hsl;s=u[0],a=u[1],l=u[2],l=i.targetNormalLuma,t.Vibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}else if(!t.Vibrant&&t.LightVibrant){var h=t.LightVibrant.hsl;s=h[0],a=h[1],l=h[2],l=i.targetNormalLuma,t.Vibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.DarkVibrant&&t.Vibrant){var p=t.Vibrant.hsl;s=p[0],a=p[1],l=p[2],l=i.targetDarkLuma,t.DarkVibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.LightVibrant&&t.Vibrant){var d=t.Vibrant.hsl;s=d[0],a=d[1],l=d[2],l=i.targetLightLuma,t.LightVibrant=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.Muted&&t.Vibrant){var m=t.Vibrant.hsl;s=m[0],a=m[1],l=m[2],l=i.targetMutesSaturation,t.Muted=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.DarkMuted&&t.DarkVibrant){var g=t.DarkVibrant.hsl;s=g[0],a=g[1],l=g[2],l=i.targetMutesSaturation,t.DarkMuted=new r.Swatch(o.hslToRgb(s,a,l),0)}if(!t.LightMuted&&t.LightVibrant){var f=t.LightVibrant.hsl;s=f[0],a=f[1],l=f[2],l=i.targetMutesSaturation,t.LightMuted=new r.Swatch(o.hslToRgb(s,a,l),0)}}(a,0,e),a}},function(t,e,i){var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(o,n){function s(t){try{l(r.next(t))}catch(t){n(t)}}function a(t){try{l(r.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var i,r,o,n,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(o=2&n[0]?r.return:n[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,n[1])).done)return o;switch(r=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,r=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){s=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]{const r=[t,e,i].map((t=>{let e=t;return e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4}));return.2126*r[0]+.7152*r[1]+.0722*r[2]},ge=(t,e)=>Math.round(100*(((t,e)=>{const i=me(...t),r=me(...e);return(Math.max(i,r)+.05)/(Math.min(i,r)+.05)})(t,e)+Number.EPSILON))/100;de._pipeline.generator.register("default",(t=>{t.sort(((t,e)=>e.population-t.population));const e=t[0];let i;const r=new Map,o=(t,i)=>(r.has(t)||r.set(t,ge(e.rgb,i)),r.get(t)>4.5);for(let e=1;e150)&&o(e.hex,e.rgb)){i=e.rgb;break}}}return void 0===i&&(i=e.getYiq()<200?[255,255,255]:[0,0,0]),[new e.constructor(i,0).hex,e.hex]}));customElements.get("ha-slider")||customElements.define("ha-slider",class extends(customElements.get("paper-slider")){}),customElements.get("ha-icon-button")||customElements.define("ha-icon-button",class extends(customElements.get("paper-icon-button")){}),customElements.get("ha-icon")||customElements.define("ha-icon",class extends(customElements.get("iron-icon")){});const fe={en:{placeholder:{tts:"Text to speech"},label:{leave:"Leave",ungroup:"Ungroup",group_all:"Group all",send:"Send",master:"Master"},state:{idle:"Idle",unavailable:"Unavailable"},title:{speaker_management:"Group management"}},de:{placeholder:{tts:"Text zum Sprechen"},label:{leave:"Verlassen",ungroup:"Teilen",group_all:"Gruppieren",send:"Senden",master:"Master"},state:{idle:"Pause",unavailable:"Nicht verfügbar"},title:{speaker_management:"Wiedergabe auf"}},fi:{placeholder:{tts:"Teksti puheeksi"},label:{leave:"Jätä",ungroup:"Pura ryhmä",group_all:"Liitä kaikki",send:"Lähetä",master:"Master"},state:{idle:"Tauko",unavailable:"Ei käytettävissä"},title:{speaker_management:"Ryhmän hallinta"}},fr:{placeholder:{tts:"Texte à lire"},label:{leave:"Quitter",ungroup:"Dégrouper",group_all:"Grouper tous",send:"Envoyer"},state:{idle:"Inactif",unavailable:"Indisponible"},title:{speaker_management:"Gestion des groupes"}},he:{placeholder:{tts:"טקסט לדיבור"},label:{leave:"לעזוב",ungroup:"ביטול קבוצה",group_all:"לקבץ את כולם",send:"שליחה",master:"ראשי"},state:{idle:"לא פעיל",unavailable:"לא זמין"},title:{speaker_management:"ניהול קבוצות"}},hu:{placeholder:{tts:"Szövegfelolvasás"},label:{leave:"Kilépés",ungroup:"Összes ki",group_all:"Összes be",send:"Küldés",master:"Forrás"},state:{idle:"Tétlen",unavailable:"Nem elérhető"},title:{speaker_management:"Hangszórók csoportosítása"}},it:{placeholder:{tts:"Conversione testo in voce"},label:{leave:"Lascia",ungroup:"Separa",group_all:"Raggruppa tutti",send:"Invia",master:"Master"},state:{idle:"Inattivo",unavailable:"Non disponibile"},title:{speaker_management:"Gestione gruppo"}},is:{placeholder:{tts:"Texti sem á að segja"},label:{leave:"Yfirgefa",ungroup:"Aðskilja",group_all:"Sameina alla",send:"Senda",master:"Stjórnandi"},state:{idle:"Aðgerðalaus",unavailable:"Ekki tiltækt"},title:{speaker_management:"Stjórnun hópa"}},no:{placeholder:{tts:"Tekst til tale"},label:{leave:"Forlat",ungroup:"Oppløs gruppe",group_all:"Grupper alle",send:"Send",master:"Master"},state:{idle:"Inaktiv",unavailable:"Utilgjengelig"},title:{speaker_management:"Gruppestyring"}},pl:{placeholder:{tts:"Zamień tekst na mowę"},label:{leave:"Opuść",ungroup:"Usuń grupę",group_all:"Grupuj wszystkie",send:"Wyślij"},state:{idle:"brak aktywności",unavailable:"niedostępny"},title:{speaker_management:"Zarządzanie grupą"}},sv:{placeholder:{tts:"Text till tal"},label:{leave:"Lämna",ungroup:"Avgruppera",group_all:"Gruppera alla",send:"Skicka",master:"Master"},state:{idle:"Inaktiv",unavailable:"Otillgänglig"},title:{speaker_management:"Gruppstyrning"}},uk:{placeholder:{tts:"Текст для відтворення"},label:{leave:"Залишити",ungroup:"Розгрупувати",group_all:"Згрупувати всі",send:"Надіслати",master:"Головний"},state:{idle:"бездіяльність",unavailable:"недоступний"},title:{speaker_management:"Управління групою"}},cz:{placeholder:{tts:"Převeď text na řeč"},label:{leave:"Odejít",ungroup:"Zrušit seskupení",group_all:"Seskupit vše",send:"Poslat",master:"Master"},state:{idle:"Nečinný",unavailable:"Nedostupný"},title:{speaker_management:"Správa skupin"}},ru:{placeholder:{tts:"Преобразование текста в речь"},label:{leave:"Покинуть",ungroup:"Разгруппировать",group_all:"Сгруппировать все",send:"Отправить",master:"Мастер"},state:{idle:"Бездействие",unavailable:"Недоступен"},title:{speaker_management:"Управление группой"}},es:{placeholder:{tts:"Texto a voz"},label:{leave:"Salir",ungroup:"Desagrupar",group_all:"Agrupar todos",send:"Enviar",master:"Maestro"},state:{idle:"Inactivo",unavailable:"No disponible"},title:{speaker_management:"Gestión de grupo"}},zh:{placeholder:{tts:"播放文本"},label:{leave:"退出",ungroup:"取消组合",group_all:"组合全部",send:"发送",master:"主要的"},state:{idle:"空闲",unavailable:"不可用"},title:{speaker_management:"组合管理"}},sk:{placeholder:{tts:"Prevod textu na reč"},label:{leave:"Odísť",ungroup:"Zrušiť zoskupenie",group_all:"Zoskupiť všetky",send:"Poslať",master:"Master"},state:{idle:"Nečinný",unavailable:"Nedostupné"},title:{speaker_management:"Manažment skupiny"}},ca:{placeholder:{tts:"Text a veu"},label:{leave:"Sortir",ungroup:"Desagrupar",group_all:"Agrupar-los tots",send:"Enviar",master:"Mestre"},state:{idle:"Inactiu",unavailable:"No disponible"},title:{speaker_management:"Gestió del grup"}},nl:{placeholder:{tts:"Tekst naar spraak"},label:{leave:"Verlaten",ungroup:"Ontgroeperen",group_all:"Alles groeperen",send:"Verzenden",master:"Master"},state:{idle:"Inactief",unavailable:"Niet beschikbaar"},title:{speaker_management:"Groepsbeheer"}},pt:{placeholder:{tts:"Texto para fala"},label:{leave:"Sair",ungroup:"Desagrupar",group_all:"Agrupar tudo",send:"Enviar",master:"Master"},state:{idle:"Ocioso",unavailable:"Indisponível"},title:{speaker_management:"Gerenciamento de grupo"}},cs:{placeholder:{tts:"Převod textu na řeč"},label:{leave:"Opustit",ungroup:"Zrušit seskupení",group_all:"Seskupit vše",send:"Poslat",master:"Master"},state:{idle:"Nečinný",unavailable:"Nedostupné"},title:{speaker_management:"Správa skupiny"}}},ve=(t,e)=>e.split(".").reduce(((t,e)=>t&&t[e]||null),t),_e=(t,e,i,r="unknown")=>{const o=t.selectedLanguage||t.language,n=o.split("-")[0];return fe[o]&&ve(fe[o],e)||t.resources[o]&&i&&t.resources[o][i]||fe[n]&&ve(fe[n],e)||ve(fe.en,e)||r};let ye=class extends ot{render(){return I` ${this.label} @@ -699,20 +704,20 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons span[disabled] { opacity: 0.65; } - `}};t([Z({attribute:!1})],be.prototype,"checked",void 0),t([Z({attribute:!1})],be.prototype,"disabled",void 0),t([Z({attribute:!1})],be.prototype,"label",void 0),be=t([J("mmp-checkbox")],be);let we=class extends ot{render(){return I` + `}};t([Y({attribute:!1})],ye.prototype,"checked",void 0),t([Y({attribute:!1})],ye.prototype,"disabled",void 0),t([Y({attribute:!1})],ye.prototype,"label",void 0),ye=t([J("mmp-checkbox")],ye);let be=class extends ot{render(){return I` - ${this.item.name} ${this.master?I`(${ye(this.hass,"label.master")})`:""} + ${this.item.name} ${this.master?I`(${_e(this.hass,"label.master")})`:""} `}handleClick(t){t.stopPropagation(),t.preventDefault(),this.disabled||this.dispatchEvent(new CustomEvent("change",{detail:{entity:this.item.entity_id,checked:!this.checked}}))}static get styles(){return it` .master { font-weight: 500; } - `}};t([Z({attribute:!1})],we.prototype,"hass",void 0),t([Z({attribute:!1})],we.prototype,"item",void 0),t([Z({attribute:!1})],we.prototype,"checked",void 0),t([Z({attribute:!1})],we.prototype,"disabled",void 0),t([Z({attribute:!1})],we.prototype,"master",void 0),we=t([J("mmp-group-item")],we);let xe=class extends ot{render(){return I` + `}};t([Y({attribute:!1})],be.prototype,"hass",void 0),t([Y({attribute:!1})],be.prototype,"item",void 0),t([Y({attribute:!1})],be.prototype,"checked",void 0),t([Y({attribute:!1})],be.prototype,"disabled",void 0),t([Y({attribute:!1})],be.prototype,"master",void 0),be=t([J("mmp-group-item")],be);let we=class extends ot{render(){return I`
@@ -767,17 +772,17 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons top: 0; bottom: 0; } - `}};xe=t([J("mmp-button")],xe);let ke=class extends ot{get group(){return this.player.group}get master(){return this.player.master}get isMaster(){return this.player.isMaster}get isGrouped(){return this.player.isGrouped}handleGroupChange(t){const{entity:e,checked:i}=t.detail;this.player.handleGroupChange(t,e,i)}render(){if(!this.visible)return I``;const{group:t,isMaster:e,isGrouped:i}=this,{id:r}=this.player;return I` + `}};we=t([J("mmp-button")],we);let xe=class extends ot{get group(){return this.player.group}get master(){return this.player.master}get isMaster(){return this.player.isMaster}get isGrouped(){return this.player.isGrouped}handleGroupChange(t){const{entity:e,checked:i}=t.detail;this.player.handleGroupChange(t,e,i)}render(){if(!this.visible)return I``;const{group:t,isMaster:e,isGrouped:i}=this,{id:r}=this.player;return I`
- ${ye(this.hass,"title.speaker_management")} + ${_e(this.hass,"title.speaker_management")} ${this.entities.map((t=>this.renderItem(t,r)))}
this.player.handleGroupChange(t,r,!1)}> - ${ye(this.hass,"label.leave")} + ${_e(this.hass,"label.leave")} ${i&&e?I` this.player.handleGroupChange(e,t,!1)}> - ${ye(this.hass,"label.ungroup")} + ${_e(this.hass,"label.ungroup")} `:I``} this.player.handleGroupChange(t,this.entities.map((t=>t.entity_id)),!0)} > - ${ye(this.hass,"label.group_all")} + ${_e(this.hass,"label.group_all")}
@@ -820,7 +825,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons width: 50%; --mdc-theme-primary: transparent; } - `}};t([Z({attribute:!1})],ke.prototype,"hass",void 0),t([Z({attribute:!1})],ke.prototype,"entities",void 0),t([Z({attribute:!1})],ke.prototype,"player",void 0),t([Z({attribute:!1})],ke.prototype,"visible",void 0),ke=t([J("mmp-group-list")],ke);customElements.define("mmp-dropdown",class extends ot{static get properties(){return{items:[],label:String,selected:String,id:String,isOpen:Boolean}}get selectedIndex(){return this.items.map((t=>t.id)).indexOf(this.selected)}firstUpdated(){const t=this.shadowRoot.querySelector("#menu"),e=this.shadowRoot.querySelector("#button");t.anchor=e}render(){return I` + `}};t([Y({attribute:!1})],xe.prototype,"hass",void 0),t([Y({attribute:!1})],xe.prototype,"entities",void 0),t([Y({attribute:!1})],xe.prototype,"player",void 0),t([Y({attribute:!1})],xe.prototype,"visible",void 0),xe=t([J("mmp-group-list")],xe);customElements.define("mmp-dropdown",class extends ot{static get properties(){return{items:[],label:String,selected:String,id:String,isOpen:Boolean}}get selectedIndex(){return this.items.map((t=>t.id)).indexOf(this.selected)}firstUpdated(){const t=this.shadowRoot.querySelector("#menu"),e=this.shadowRoot.querySelector("#button");t.anchor=e}render(){return I`
t.stopPropagation()} @@ -829,9 +834,9 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons - + `:I` ${this.selected||this.label} - +
`} @@ -858,7 +863,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons `))}
- `}onChange(t){const{index:e}=t.detail;e!==this.selectedIndex&&this.items[e]&&this.dispatchEvent(new CustomEvent("change",{detail:this.items[e]}))}handleClose(t){t.stopPropagation(),this.isOpen=!1}toggleMenu(){const t=this.shadowRoot.querySelector("#menu");t.open=!t.open,this.isOpen=t.open}static get styles(){return[le,it` + `}onChange(t){const{index:e}=t.detail;e!==this.selectedIndex&&this.items[e]&&this.dispatchEvent(new CustomEvent("change",{detail:this.items[e]}))}handleClose(t){t.stopPropagation(),this.isOpen=!1}toggleMenu(){const t=this.shadowRoot.querySelector("#menu");t.open=!t.open,this.isOpen=t.open}static get styles(){return[ae,it` :host { display: block; } @@ -951,7 +956,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons `:"";return I` ${i} ${e} - `}handleShortcut(t,e){const{type:i,id:r,data:o}=e||t.detail;if("source"===i)return this.player.setSource(t,r);if("service"===i)return this.player.toggleService(t,r,o);if("script"===i)return this.player.toggleScript(t,r,o);if("sound_mode"===i)return this.player.setSoundMode(t,r);const n={media_content_type:i,media_content_id:r};this.player.setMedia(t,n)}shortcutStyle(t){return{"min-height":`${this.height}px`,...t.cover&&{"background-image":`url(${t.cover})`}}}static get styles(){return[le,it` + `}handleShortcut(t,e){const{type:i,id:r,data:o}=e||t.detail;if("source"===i)return this.player.setSource(t,r);if("service"===i)return this.player.toggleService(t,r,o);if("script"===i)return this.player.toggleScript(t,r,o);if("sound_mode"===i)return this.player.setSoundMode(t,r);const n={media_content_type:i,media_content_id:r};this.player.setMedia(t,n)}shortcutStyle(t){return{"min-height":`${this.height}px`,...t.cover&&{"background-image":`url(${t.cover})`}}}static get styles(){return[ae,it` .mmp-shortcuts__buttons { box-sizing: border-box; display: flex; @@ -1007,31 +1012,27 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons .mmp-shortcuts__button > div > img { height: 24px; } - `]}});customElements.define("mmp-tts",class extends ot{static get properties(){return{hass:{},config:{},player:{}}}get label(){return ye(this.hass,"placeholder.tts","ui.card.media_player.text_to_speak","Say")}get input(){return this.shadowRoot.getElementById("tts-input")}get message(){return this.input.value}render(){return I` - t.stopPropagation()} > - + - ${ye(this.hass,"label.send")} + ${_e(this.hass,"label.send")} `}handleTts(t){const{config:e,message:i}=this,r={message:i,entity_id:e.entity_id||this.player.id,..."group"===e.entity_id&&{entity_id:this.player.group},...e.data};switch(e.language&&(r.language=e.language),e.platform){case"alexa":this.hass.callService("notify","alexa_media",{message:i,data:{type:e.type||"tts",...e.data},target:r.entity_id});break;case"sonos":this.hass.callService("script","sonos_say",{sonos_entity:r.entity_id,volume:e.volume||.5,message:i,...e.data});break;case"webos":this.hass.callService("notify",r.entity_id.split(".").slice(-1)[0],{message:i,...e.data});break;case"ga":this.hass.callService("notify","ga_broadcast",{message:i,...e.data});break;case"service":{const[t,o]=(e.data.service||"").split("."),n={[e.data.message_field||"message"]:i,entity_id:r.entity_id,...e.language?{language:r.language}:{},...e.data.service_data||{}};this.hass.callService(t,o,n);break}default:this.hass.callService("tts",`${e.platform}_say`,r)}t.stopPropagation(),this.reset()}reset(){this.input.value=""}static get styles(){return it` :host { align-items: center; - margin-left: 8px; + margin: 8px 4px 0px; display: flex; } .mmp-tts__input { cursor: text; flex: 1; margin-right: 8px; - --paper-input-container-input: { - font-size: 1em; - }; } ha-card[rtl] .mmp-tts__input { margin-right: auto; @@ -1042,25 +1043,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons height: 30px; padding: 0 .4em; } - paper-input { - opacity: .75; - --paper-input-container-color: var(--mmp-text-color); - --paper-input-container-input-color: var(--mmp-text-color); - --paper-input-container-focus-color: var(--mmp-text-color); - --paper-input-container: { - padding: 0; - }; - } - paper-input[focused] { - opacity: 1; - } - - ha-card[artwork*='cover'][has-artwork] paper-input { - --paper-input-container-color: #FFFFFF; - --paper-input-container-input-color: #FFFFFF; - --paper-input-container-focus-color: #FFFFFF; - } - `}});var Se=t=>{let e=Math.abs(parseInt(""+t%60,10)),i=Math.abs(parseInt(""+t/60%60,10)),r=Math.abs(parseInt(""+t/3600%24,10));return r=r<10?`0${r}`:r,i=i<10?`0${i}`:i,e=e<10?`0${e}`:e,`${"00"!==r?`${r}:`:""}${i}:${e}`};customElements.define("mmp-progress",class extends ot{static get properties(){return{_player:{},showTime:Boolean,showRemainingTime:Boolean,progress:Number,duration:Number,tracker:{},seekProgress:Number,seekWidth:Number,track:Boolean}}set player(t){this._player=t,this.hasProgress&&this.trackProgress()}get duration(){return this.player.mediaDuration}get player(){return this._player}get hasProgress(){return this.player.hasProgress}get width(){return this.shadowRoot.querySelector(".mmp-progress").offsetWidth}get offset(){return this.getBoundingClientRect().left}get classes(){return at({transiting:!this.seekProgress,seeking:this.seekProgress})}render(){return I` + `}});var ke=t=>{let e=Math.abs(parseInt(""+t%60,10)),i=Math.abs(parseInt(""+t/60%60,10)),r=Math.abs(parseInt(""+t/3600%24,10));return r=r<10?`0${r}`:r,i=i<10?`0${i}`:i,e=e<10?`0${e}`:e,`${"00"!==r?`${r}:`:""}${i}:${e}`};customElements.define("mmp-progress",class extends ot{static get properties(){return{_player:{},showTime:Boolean,showRemainingTime:Boolean,progress:Number,duration:Number,tracker:{},seekProgress:Number,seekWidth:Number,track:Boolean}}set player(t){this._player=t,this.hasProgress&&this.trackProgress()}get duration(){return this.player.mediaDuration}get player(){return this._player}get hasProgress(){return this.player.hasProgress}get width(){return this.shadowRoot.querySelector(".mmp-progress").offsetWidth}get offset(){return this.getBoundingClientRect().left}get classes(){return at({transiting:!this.seekProgress,seeking:this.seekProgress})}render(){return I`
${this.showTime?I`
- ${Se(this.seekProgress||this.progress)} + ${ke(this.seekProgress||this.progress)}
${this.showTime?I` - -${Se(this.duration-(this.seekProgress||this.progress))} | + -${ke(this.duration-(this.seekProgress||this.progress))} | `:""} - ${Se(this.duration)} + ${ke(this.duration)}
`:""} - - +
- `}trackProgress(){this.progress=this.player.progress,this.tracker||(this.tracker=setInterval((()=>this.trackProgress()),1e3)),this.player.isPlaying||(clearInterval(this.tracker),this.tracker=null)}initSeek(t){const e=t.offsetX||t.touches[0].pageX-this.offset;this.seekWidth=this.width,this.seekProgress=this.calcProgress(e),this.addEventListener("touchmove",this.moveSeek),this.addEventListener("mousemove",this.moveSeek)}resetSeek(){this.seekProgress=null,this.removeEventListener("touchmove",this.moveSeek),this.removeEventListener("mousemove",this.moveSeek)}moveSeek(t){t.preventDefault();const e=t.offsetX||t.touches[0].pageX-this.offset;this.seekProgress=this.calcProgress(e)}handleSeek(t){this.resetSeek();const e=t.offsetX||t.changedTouches[0].pageX-this.offset,i=this.calcProgress(e);this.player.seek(t,i)}disconnectedCallback(){super.disconnectedCallback(),this.resetSeek(),clearInterval(this.tracker),this.tracker=null}connectedCallback(){super.connectedCallback(),this.hasProgress&&this.trackProgress()}calcProgress(t){const e=t/this.seekWidth*this.duration;return Math.min(Math.max(e,.1),this.duration)}static get styles(){return it` + `}progressBarStyle(){return ct({width:(this.seekProgress||this.progress)/this.duration*100+"%"})}trackProgress(){this.progress=this.player.progress,this.tracker||(this.tracker=setInterval((()=>this.trackProgress()),1e3)),this.player.isPlaying||(clearInterval(this.tracker),this.tracker=null)}initSeek(t){const e=t.offsetX||t.touches[0].pageX-this.offset;this.seekWidth=this.width,this.seekProgress=this.calcProgress(e),this.addEventListener("touchmove",this.moveSeek),this.addEventListener("mousemove",this.moveSeek)}resetSeek(){this.seekProgress=null,this.removeEventListener("touchmove",this.moveSeek),this.removeEventListener("mousemove",this.moveSeek)}moveSeek(t){t.preventDefault();const e=t.offsetX||t.touches[0].pageX-this.offset;this.seekProgress=this.calcProgress(e)}handleSeek(t){this.resetSeek();const e=t.offsetX||t.changedTouches[0].pageX-this.offset,i=this.calcProgress(e);this.player.seek(t,i)}disconnectedCallback(){super.disconnectedCallback(),this.resetSeek(),clearInterval(this.tracker),this.tracker=null}connectedCallback(){super.connectedCallback(),this.hasProgress&&this.trackProgress()}calcProgress(t){const e=t/this.seekWidth*this.duration;return Math.min(Math.max(e,.1),this.duration)}static get styles(){return it` .mmp-progress { cursor: pointer; left: 0; right: 0; bottom: 0; @@ -1095,6 +1075,15 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons pointer-events: auto; min-height: calc(var(--mmp-progress-height) + 10px); } + .mmp-progress:before { + content: ''; + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: var(--mmp-progress-height); + background-color: rgba(100,100,100,.15); + } .mmp-progress__duration { left: calc(var(--ha-card-border-radius, 4px) / 2); right: calc(var(--ha-card-border-radius, 4px) / 2); @@ -1109,29 +1098,23 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons .mmp-progress__duration__remaining { opacity: .5; } - paper-progress { + .progress-bar { height: var(--mmp-progress-height); - --paper-progress-height: var(--mmp-progress-height); bottom: 0; position: absolute; - width: 100%; + width: 0; transition: height 0; z-index: 1; - --paper-progress-active-color: var(--mmp-accent-color); - --paper-progress-container-color: rgba(100,100,100,.15); - --paper-progress-transition-duration: 1s; - --paper-progress-transition-timing-function: linear; - --paper-progress-transition-delay: 0s; + background-color: var(--mmp-accent-color); } - paper-progress.seeking { + .progress-bar.seeking { transition: height .15s ease-out; height: calc(var(--mmp-progress-height) + 4px); - --paper-progress-height: calc(var(--mmp-progress-height) + 4px); } - .mmp-progress[paused] paper-progress { - --paper-progress-active-color: var(--disabled-text-color, rgba(150,150,150,.5)); + .mmp-progress[paused] .progress-bar { + background-color: var(--disabled-text-color, rgba(150,150,150,.5)); } - `}});let $e=class extends ot{get source(){return this.player.source}get alternatives(){return this.player.sources.map((t=>({name:t,id:t,type:"source"})))}render(){return I` + `}});let Se=class extends ot{get source(){return this.player.source}get alternatives(){return this.player.sources.map((t=>({name:t,id:t,type:"source"})))}render(){return I` ({name:t,id:t,type:"soundMode"})))}render(){return I` + `}};t([Y({attribute:!1})],Se.prototype,"player",void 0),t([Y({attribute:!1})],Se.prototype,"icon",void 0),Se=t([J("mmp-source-menu")],Se);let $e=class extends ot{constructor(){super(...arguments),this.selected=void 0}get mode(){return this.player.soundMode}get alternatives(){return this.player.soundModes.map((t=>({name:t,id:t,type:"soundMode"})))}render(){return I` this.player.prev(t)} - .icon=${Ft}> - + .icon=${zt}> + `:""} ${this.renderJumpBackwardButton()} ${this.renderPlayButtons()} @@ -1181,8 +1164,8 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons ${!t.next&&this.player.supportsNext?I` this.player.next(t)} - .icon=${It}> - + .icon=${Dt}> + `:""}
`} @@ -1220,27 +1203,27 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons value=${100*this.player.vol} step=${this.config.volume_step||1} dir=${"ltr"} - ignore-bar-touch pin> + ignore-bar-touch pin labeled> `}renderVolButtons(t){return I` ${this.renderMuteButton(t)} this.player.volumeDown(t)} - .icon=${Gt}> - + .icon=${Ft}> + this.player.volumeUp(t)} - .icon=${Ht}> - + .icon=${Gt}> + `}renderVolLevel(){return I` ${this.vol}% `}renderMuteButton(t){if(!this.config.hide.mute)switch(this.config.replace_mute){case"play":case"play_pause":return I` this.player.playPause(t)} - .icon=${Rt[this.player.isPlaying]}> - + .icon=${It[this.player.isPlaying]}> + `;case"stop":return I` this.player.next(t)} - .icon=${It}> - + .icon=${Dt}> + `;default:if(!this.player.supportsMute)return;return I` `}}renderPlayButtons(){const{hide:t}=this.config;return I` - ${t.play_pause?I``:I` + ${t.play_pause?I``:this.player.assumedState?I` + this.player.play(t)} + .icon=${It.false}> + + + this.player.pause(t)} + .icon=${It.true}> + + + `:I` this.player.playPause(t)} - .icon=${Rt[this.player.isPlaying]}> - + .icon=${It[this.player.isPlaying]}> + `} ${t.play_stop?I``:I` @@ -1284,16 +1278,16 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons `}renderJumpForwardButton(){return this.config.hide.jump||!this.player.hasProgress?I``:I` this.player.jump(t,this.jumpAmount)} - .icon=${Wt}> - + .icon=${Ht}> + `}renderJumpBackwardButton(){return this.config.hide.jump||!this.player.hasProgress?I``:I` this.player.jump(t,-this.jumpAmount)} - .icon=${Xt}> - + .icon=${Wt}> + - `}handleStop(t){return this.config.hide.play_pause?this.player.playStop(t):this.player.stop(t)}handleVolumeChange(t){const e=parseFloat(t.target.value)/100;this.player.setVolume(t,e)}static get styles(){return[le,it` + `}handleStop(t){return this.config.hide.play_pause?this.player.playStop(t):this.player.stop(t)}handleVolumeChange(t){const e=parseFloat(t.target.value)/100;this.player.setVolume(t,e)}static get styles(){return[ae,it` :host { display: flex; width: 100%; @@ -1308,8 +1302,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons max-width: none; min-width: 100px; width: 100%; - --paper-slider-active-color: var(--mmp-accent-color); - --paper-slider-knob-color: var(--mmp-accent-color); + --md-sys-color-primary: var(--mmp-accent-color); } ha-icon-button { min-width: var(--mmp-unit); @@ -1337,8 +1330,8 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons flex-shrink: 200; justify-content: center; } - `]}});customElements.define("mmp-powerstrip",class extends ot{static get properties(){return{hass:{},player:{},config:{},groupVisible:Boolean,idle:Boolean}}get icon(){return this.config.speaker_group.icon||Dt}get showGroupButton(){return this.config.speaker_group.entities.length>0}get showPowerButton(){return!this.config.hide.power}get powerColor(){return this.player.isActive&&!this.config.hide.power_state}get sourceSize(){return"icon"===this.config.source||this.hasControls||this.idle}get soundSize(){return"icon"===this.config.sound_mode||this.hasControls||this.idle}get hasControls(){return this.player.isActive&&this.config.hide.controls!==this.config.hide.volume}get hasSource(){return this.player.sources.length>0&&!this.config.hide.source}get hasSoundMode(){return this.player.soundModes.length>0&&!this.config.hide.sound_mode}get showLabel(){return!this.config.hide.state_label}render(){return this.player.isUnavailable&&this.showLabel?I` - ${ye(this.hass,"state.unavailable","state.default.unavailable")} + `]}});customElements.define("mmp-powerstrip",class extends ot{static get properties(){return{hass:{},player:{},config:{},groupVisible:Boolean,idle:Boolean}}get icon(){return this.config.speaker_group.icon||Lt}get showGroupButton(){return this.config.speaker_group.entities.length>0&&!this.config.hide.group_button}get showPowerButton(){return!this.config.hide.power}get powerColor(){return this.player.isActive&&!this.config.hide.power_state}get sourceSize(){return"icon"===this.config.source||this.hasControls||this.idle}get soundSize(){return"icon"===this.config.sound_mode||this.hasControls||this.idle}get hasControls(){return this.player.isActive&&this.config.hide.controls!==this.config.hide.volume}get hasSource(){return this.player.sources.length>0&&!this.config.hide.source}get hasSoundMode(){return this.player.soundModes.length>0&&!this.config.hide.sound_mode}get showLabel(){return!this.config.hide.state_label}render(){return this.player.isUnavailable&&this.showLabel?I` + ${_e(this.hass,"state.unavailable","state.default.unavailable")} `:I` ${this.idle?this.renderIdleView:""} ${this.hasControls?I` `:""} @@ -1361,15 +1354,15 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons `:""} ${this.showPowerButton?I` this.player.toggle(t)} ?color=${this.powerColor} > - + `:""} - `}handleGroupClick(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("toggleGroupList"))}get renderIdleView(){return this.player.isPaused?I` this.player.playPause(t)}> - - `:this.showLabel?I` ${ye(this.hass,"state.idle","state.media_player.idle")} `:I``}static get styles(){return[le,it` + `}handleGroupClick(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("toggleGroupList"))}get renderIdleView(){return this.player.isPaused?I` this.player.playPause(t)}> + + `:this.showLabel?I` ${_e(this.hass,"state.idle","state.media_player.idle")} `:I``}static get styles(){return[ae,it` :host { display: flex; line-height: var(--mmp-unit); @@ -1389,7 +1382,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons ha-icon-button { min-width: var(--mmp-unit); } - `]}});let Ce=class extends ot{constructor(){super(...arguments),this.initial=!0,this.picture=void 0,this.thumbnail="",this.prevThumbnail="",this.edit=!1,this.rtl=!1,this.cardHeight=0,this.foregroundColor="",this.backgroundColor="",this.break=!1}set hass(t){if(!t)return;const e=t.states[this.config.entity];if(this._hass=t,e&&this.entity!==e&&(this.entity=e,this.player=new se(t,this.config,e),this.rtl=this.computeRTL(t),this.idle=this.player.idle,this.player.trackIdle&&this.updateIdleStatus()),this.config&&this.config.speaker_group&&this.config.speaker_group.group_mgmt_entity){const e=t.states[this.config.speaker_group.group_mgmt_entity];e&&this.groupMgmtEntity!==e&&(this.groupMgmtEntity=e,this.groupMgmtPlayer=new se(t,this.config,e))}}get hass(){return this._hass}static async getConfigElement(){return await Promise.resolve().then((function(){return Le})),document.createElement("mini-media-player-editor")}static get styles(){return[le,ae]}set overflow(t){this._overflow!==t&&(this._overflow=t)}get overflow(){return this._overflow}get name(){return this.config.name||this.player.name}setConfig(t){this.config=oe(t)}shouldUpdate(t){return void 0===this.break&&this.computeRect(this),t.has("prevThumbnail")&&this.prevThumbnail&&setTimeout((()=>{this.prevThumbnail=""}),1e3),t.has("player")&&"material"===this.config.artwork&&this.setColors(),Jt.some((e=>t.has(e)))&&Boolean(this.player)}firstUpdated(){new Ot((t=>{t.forEach((t=>{window.requestAnimationFrame((()=>{"scroll"===this.config.info&&this.computeOverflow(),this._resizeTimer||(this.computeRect(t),this._resizeTimer=setTimeout((()=>{this._resizeTimer=void 0,this._resizeEntry&&(this.computeRect(this._resizeEntry),this.measureCard())}),250)),this._resizeEntry=t}))}))})).observe(this),setTimeout((()=>this.initial=!1),250),this.edit=this.config.speaker_group.expanded||!1}updated(){"scroll"===this.config.info&&setTimeout((()=>{this.computeOverflow()}),10)}render({config:t}=this){return this.computeArtwork(),I` + `]}});let Pe=class extends ot{constructor(){super(...arguments),this.initial=!0,this.picture=void 0,this.thumbnail="",this.prevThumbnail="",this.edit=!1,this.rtl=!1,this.cardHeight=0,this.foregroundColor="",this.backgroundColor="",this.break=!1}set hass(t){if(!t)return;const e=t.states[this.config.entity];if(this._hass=t,e&&this.entity!==e&&(this.entity=e,this.player=new ne(t,this.config,e),this.rtl=this.computeRTL(t),this.idle=this.player.idle,this.player.trackIdle&&this.updateIdleStatus()),this.config&&this.config.speaker_group&&this.config.speaker_group.group_mgmt_entity){const e=t.states[this.config.speaker_group.group_mgmt_entity];e&&this.groupMgmtEntity!==e&&(this.groupMgmtEntity=e,this.groupMgmtPlayer=new ne(t,this.config,e))}}get hass(){return this._hass}static async getConfigElement(){return await Promise.resolve().then((function(){return Ne})),document.createElement("mini-media-player-editor")}static get styles(){return[ae,se]}set overflow(t){this._overflow!==t&&(this._overflow=t)}get overflow(){return this._overflow}get name(){return this.config.name||this.player.name}setConfig(t){this.config=re(t)}shouldUpdate(t){return void 0===this.break&&this.computeRect(this),t.has("prevThumbnail")&&this.prevThumbnail&&setTimeout((()=>{this.prevThumbnail=""}),1e3),t.has("player")&&"material"===this.config.artwork&&this.setColors(),Zt.some((e=>t.has(e)))&&Boolean(this.player)}firstUpdated(){new Ot((t=>{t.forEach((t=>{window.requestAnimationFrame((()=>{"scroll"===this.config.info&&this.computeOverflow(),this._resizeTimer||(this.computeRect(t),this._resizeTimer=setTimeout((()=>{this._resizeTimer=void 0,this._resizeEntry&&(this.computeRect(this._resizeEntry),this.measureCard())}),250)),this._resizeEntry=t}))}))})).observe(this),setTimeout((()=>this.initial=!1),250),this.edit=this.config.speaker_group.expanded||!1}updated(){"scroll"===this.config.info&&setTimeout((()=>{this.computeOverflow()}),10)}render({config:t}=this){return this.computeArtwork(),I`
${this.prevThumbnail&&I`
`}`}renderGradient(){if("material"!==this.config.artwork)return;const t={backgroundImage:`linear-gradient(to left,\n transparent 0,\n ${this.backgroundColor} ${this.cardHeight}px,\n ${this.backgroundColor} 100%)`};return I`
`}renderBackground(){if(this.config.background)return I`
- `}handlePopup(t){t.stopPropagation(),ce(this,this._hass,this.config,this.config.tap_action,this.player.id)}renderIcon(){if(this.config.hide.icon)return;if(this.player.isActive&&this.thumbnail&&"default"===this.config.artwork)return I`
`;if(null!=this.config.icon_image)return I`
`;const t=!this.config.hide.icon_state&&this.player.isActive;return I`
- +
`}renderEntityName(){if(!this.config.hide.name)return I`
${this.name} ${this.speakerCount()}
`}renderMediaInfo(){if(this.config.hide.info)return;const t=this.player.mediaInfo;return I`
`:""} ${t.map((t=>I`${t.prefix+t.text}`))} -
`}speakerCount(){if(this.config.speaker_group.show_group_count){const t=this.groupMgmtPlayer?this.groupMgmtPlayer.groupCount:this.player.groupCount;return t>1?" +"+(t-1):""}}computeStyles(){const{scale:t}=this.config;return ct(Object.assign(Object.assign({},t&&{"--mmp-unit":40*t+"px"}),this.foregroundColor&&this.player.isActive&&{"--mmp-text-color":this.foregroundColor,"--mmp-icon-color":this.foregroundColor,"--mmp-icon-active-color":this.foregroundColor,"--mmp-accent-color":this.foregroundColor,"--paper-slider-container-color":this.foregroundColor,"--secondary-text-color":this.foregroundColor,"--mmp-media-cover-info-color":this.foregroundColor}))}async computeArtwork(){const{picture:t,hasArtwork:e}=this.player;if(e&&t!==this.picture){this.picture=t;const e=await this.player.fetchArtwork();this.thumbnail&&(this.prevThumbnail=this.thumbnail),this.thumbnail=e||`url(${t})`}}computeIcon(){return this.config.icon?this.config.icon:this.player.icon||Nt}measureCard(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("ha-card");e&&(this.cardHeight=e.offsetHeight)}computeOverflow(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".marquee");if(e&&e.parentNode){const t=e.clientWidth>e.parentNode.clientWidth;this.overflow=t&&this.player.isActive?7.5+e.clientWidth/50:void 0}}computeRect(t){if("contentRect"in t){const{left:e,width:i}=t.contentRect;this.break=i+2*e<390}else{const{left:e,width:i}=t.getBoundingClientRect();this.break=i+2*e<390}}computeRTL(t){const e=t.language||"en";return t.translationMetadata.translations[e]&&t.translationMetadata.translations[e].isRTL||!1}toggleGroupList(){this.edit=!this.edit}updateIdleStatus(){var t,e;const i=null===(e=null===(t=this.config)||void 0===t?void 0:t.idle_view)||void 0===e?void 0:e.after;if(!i)return;this._idleTracker&&clearTimeout(this._idleTracker);const r=(Date.now()-new Date(this.player.updatedAt).getTime())/1e3;this._idleTracker=setTimeout((()=>{this.idle=this.player.checkIdleAfter(i),this.player.idle=this.idle,this._idleTracker=void 0}),1e3*(60*i-r))}getCardSize(){return this.config.collapse?1:2}async setColors(){if(this.player.picture!==this.picture){if(!this.player.picture)return this.foregroundColor="",void(this.backgroundColor="");try{[this.foregroundColor,this.backgroundColor]=await(async t=>new me(t,{colorCount:16}).getPalette())(this.player.picture)}catch(t){console.error("Error getting Image Colors",t),this.foregroundColor="",this.backgroundColor=""}}}};t([Z({attribute:!1})],Ce.prototype,"hass",null),t([K()],Ce.prototype,"_overflow",void 0),t([K()],Ce.prototype,"initial",void 0),t([K()],Ce.prototype,"picture",void 0),t([K()],Ce.prototype,"thumbnail",void 0),t([K()],Ce.prototype,"prevThumbnail",void 0),t([K()],Ce.prototype,"edit",void 0),t([K()],Ce.prototype,"rtl",void 0),t([K()],Ce.prototype,"cardHeight",void 0),t([K()],Ce.prototype,"foregroundColor",void 0),t([K()],Ce.prototype,"backgroundColor",void 0),t([K()],Ce.prototype,"config",void 0),t([K()],Ce.prototype,"_hass",void 0),t([K()],Ce.prototype,"entity",void 0),t([K()],Ce.prototype,"player",void 0),t([K()],Ce.prototype,"idle",void 0),t([K()],Ce.prototype,"groupMgmtPlayer",void 0),t([K()],Ce.prototype,"groupMgmtEntity",void 0),t([K()],Ce.prototype,"break",void 0),t([K()],Ce.prototype,"_resizeEntry",void 0),t([K()],Ce.prototype,"_resizeTimer",void 0),t([K()],Ce.prototype,"_idleTracker",void 0),Ce=t([J("mini-media-player")],Ce),window.customCards=window.customCards||[],window.customCards.push({type:"mini-media-player",name:"Mini Media Player",preview:!1,description:"A minimalistic yet customizable media player card"});const Ee=["cover","full-cover","material","cover-fit","none"],Me=["icon","full"],Te=["icon","full"],Oe=["short","scroll"],Ae=["play_pause","stop","play_stop","next"],Ve=(t,e=!1)=>{const i=t.map((t=>({name:t,id:t})));return e&&i.push({name:"Default",id:void 0}),i};class Ne extends ot{static get styles(){return[ae,it` +
`}speakerCount(){if(this.config.speaker_group.show_group_count){const t=this.groupMgmtPlayer?this.groupMgmtPlayer.groupCount:this.player.groupCount;return t>1?" +"+(t-1):""}}computeStyles(){const{scale:t}=this.config;return ct(Object.assign(Object.assign({},t&&{"--mmp-unit":40*t+"px"}),this.foregroundColor&&this.player.isActive&&{"--mmp-text-color":this.foregroundColor,"--mmp-icon-color":this.foregroundColor,"--mmp-icon-active-color":this.foregroundColor,"--mmp-accent-color":this.foregroundColor,"--paper-slider-container-color":this.foregroundColor,"--secondary-text-color":this.foregroundColor,"--mmp-media-cover-info-color":this.foregroundColor}))}async computeArtwork(){const{picture:t,hasArtwork:e}=this.player;if(e&&t!==this.picture){this.picture=t;const e=await this.player.fetchArtwork();this.thumbnail&&(this.prevThumbnail=this.thumbnail),this.thumbnail=e||`url(${t})`}}measureCard(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("ha-card");e&&(this.cardHeight=e.offsetHeight)}computeOverflow(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".marquee");if(e&&e.parentNode){const t=e.clientWidth>e.parentNode.clientWidth;this.overflow=t&&this.player.isActive?7.5+e.clientWidth/50:void 0}}computeRect(t){if("contentRect"in t){const{left:e,width:i}=t.contentRect;this.break=i+2*e<390}else{const{left:e,width:i}=t.getBoundingClientRect();this.break=i+2*e<390}}computeRTL(t){const e=t.language||"en";return t.translationMetadata.translations[e]&&t.translationMetadata.translations[e].isRTL||!1}toggleGroupList(){this.edit=!this.edit}updateIdleStatus(){var t,e;const i=null===(e=null===(t=this.config)||void 0===t?void 0:t.idle_view)||void 0===e?void 0:e.after;if(!i)return;this._idleTracker&&clearTimeout(this._idleTracker);const r=(Date.now()-new Date(this.player.updatedAt).getTime())/1e3;this._idleTracker=setTimeout((()=>{this.idle=this.player.checkIdleAfter(i),this.player.idle=this.idle,this._idleTracker=void 0}),1e3*(60*i-r))}getCardSize(){return this.config.collapse?1:2}async setColors(){if(this.player.picture!==this.picture){if(!this.player.picture)return this.foregroundColor="",void(this.backgroundColor="");try{[this.foregroundColor,this.backgroundColor]=await(async t=>new de(t,{colorCount:16}).getPalette())(this.player.picture)}catch(t){console.error("Error getting Image Colors",t),this.foregroundColor="",this.backgroundColor=""}}}};t([Y({attribute:!1})],Pe.prototype,"hass",null),t([K()],Pe.prototype,"_overflow",void 0),t([K()],Pe.prototype,"initial",void 0),t([K()],Pe.prototype,"picture",void 0),t([K()],Pe.prototype,"thumbnail",void 0),t([K()],Pe.prototype,"prevThumbnail",void 0),t([K()],Pe.prototype,"edit",void 0),t([K()],Pe.prototype,"rtl",void 0),t([K()],Pe.prototype,"cardHeight",void 0),t([K()],Pe.prototype,"foregroundColor",void 0),t([K()],Pe.prototype,"backgroundColor",void 0),t([K()],Pe.prototype,"config",void 0),t([K()],Pe.prototype,"_hass",void 0),t([K()],Pe.prototype,"entity",void 0),t([K()],Pe.prototype,"player",void 0),t([K()],Pe.prototype,"idle",void 0),t([K()],Pe.prototype,"groupMgmtPlayer",void 0),t([K()],Pe.prototype,"groupMgmtEntity",void 0),t([K()],Pe.prototype,"break",void 0),t([K()],Pe.prototype,"_resizeEntry",void 0),t([K()],Pe.prototype,"_resizeTimer",void 0),t([K()],Pe.prototype,"_idleTracker",void 0),Pe=t([J("mini-media-player")],Pe),window.customCards=window.customCards||[],window.customCards.push({type:"mini-media-player",name:"Mini Media Player",preview:!1,description:"A minimalistic yet customizable media player card"});const Ce=["cover","full-cover","material","cover-fit","none"],Me=["icon","full"],Ee=["icon","full"],Te=["short","scroll"],Oe=["play_pause","stop","play_stop","next"],Ae=(t,e=!1)=>{const i=t.map((t=>({name:t,id:t})));return e&&i.push({name:"Default",id:void 0}),i};class Ve extends ot{static get styles(){return[se,it` .editor-side-by-side { display: flex; margin: 16px 0; @@ -1481,7 +1479,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons font-size: 0.8em; opacity: 0.75; } - `]}static get properties(){return{hass:{},_config:{}}}setConfig(t){this._config=Object.assign({},oe,t)}get getMediaPlayerEntities(){return Object.keys(this.hass.states).filter((t=>"media_player"===t.substr(0,t.indexOf("."))))}get _group(){return this._config.group||!1}get _volume_stateless(){return this._config.volume_stateless||!1}get _toggle_power(){return this._config.toggle_power||!0}render(){if(!this.hass)return I``;const t=this.getMediaPlayerEntities.map((t=>({name:t,id:t})));return I` + `]}static get properties(){return{hass:{},_config:{}}}setConfig(t){this._config=Object.assign({},re,t)}get getMediaPlayerEntities(){return Object.keys(this.hass.states).filter((t=>"media_player"===t.substr(0,t.indexOf("."))))}get _group(){return this._config.group||!1}get _volume_stateless(){return this._config.volume_stateless||!1}get _toggle_power(){return this._config.toggle_power||!0}render(){if(!this.hass)return I``;const t=this.getMediaPlayerEntities.map((t=>({name:t,id:t})));return I`
Entity (required) @@ -1545,7 +1543,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons this.valueChanged({target:{configValue:"artwork",value:t.id}})} - .items=${Ve(Ee,!0)} + .items=${Ae(Ce,!0)} .label=${"Default"} .selected=${this._config.artwork} > @@ -1556,7 +1554,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons this.valueChanged({target:{configValue:"source",value:t.id}})} - .items=${Ve(Me,!0)} + .items=${Ae(Me,!0)} .label=${"Default"} .selected=${this._config.source} > @@ -1567,7 +1565,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons this.valueChanged({target:{configValue:"sound_mode",value:t.id}})} - .items=${Ve(Te,!0)} + .items=${Ae(Ee,!0)} .label=${"Default"} .selected=${this._config.sound_mode} > @@ -1581,7 +1579,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons this.valueChanged({target:{configValue:"info",value:t.id}})} - .items=${Ve(Oe,!0)} + .items=${Ae(Te,!0)} .label=${"Default"} .selected=${this._config.info} > @@ -1593,7 +1591,7 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons this.valueChanged({target:{configValue:"replace_mute",value:t.id}})} - .items=${Ve(Ae,!0)} + .items=${Ae(Oe,!0)} .label=${"Default"} .selected=${this._config.replace_mute} > @@ -1646,4 +1644,4 @@ class nt{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;cons
- `}valueChanged(t){if(!this._config||!this.hass)return;const{target:e}=t;this[`_${e.configValue}`]!==e.value&&(e.configValue&&(""===e.value?delete this._config[e.configValue]:this._config={...this._config,[e.configValue]:void 0!==e.checked?e.checked:e.value}),((t,e,i={},r={})=>{const o=new Event(e,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed});o.detail=i,t.dispatchEvent(o)})(this,"config-changed",{config:this._config}))}}customElements.define("mini-media-player-editor",Ne);var Le=Object.freeze({__proto__:null,default:Ne}); + `}valueChanged(t){if(!this._config||!this.hass)return;const{target:e}=t;this[`_${e.configValue}`]!==e.value&&(e.configValue&&(""===e.value?delete this._config[e.configValue]:this._config={...this._config,[e.configValue]:void 0!==e.checked?e.checked:e.value}),((t,e,i={},r={})=>{const o=new Event(e,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed});o.detail=i,t.dispatchEvent(o)})(this,"config-changed",{config:this._config}))}}customElements.define("mini-media-player-editor",Ve);var Ne=Object.freeze({__proto__:null,default:Ve}); diff --git a/custom_components/ui_lovelace_minimalist/cards/my-cards/my-cards.js b/custom_components/ui_lovelace_minimalist/cards/my-cards/my-cards.js index 8f61b88a0..031f67f91 100644 --- a/custom_components/ui_lovelace_minimalist/cards/my-cards/my-cards.js +++ b/custom_components/ui_lovelace_minimalist/cards/my-cards/my-cards.js @@ -1,4 +1,4 @@ -var t={version:"Version",invalid_configuration:"Invalid configuration",show_warning:"Show Warning",show_error:"Show Error"},e={common:t},i={version:"Versjon",invalid_configuration:"Ikke gyldig konfiguration",show_warning:"Vis advarsel"},s={common:i};const n={en:Object.freeze({__proto__:null,common:t,default:e}),nb:Object.freeze({__proto__:null,common:i,default:s})};function o(t,e="",i=""){const s=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let o;try{o=t.split(".").reduce((t,e)=>t[e],n[s])}catch(e){o=t.split(".").reduce((t,e)=>t[e],n.en)}return void 0===o&&(o=t.split(".").reduce((t,e)=>t[e],n.en)),""!==e&&""!==i&&(o=o.replace(e,i)),o} +const t=(e=["unavailable","unknown"],(t,i)=>e.includes(t,i));var e,i={version:"Version",invalid_configuration:"Invalid configuration",show_warning:"Show Warning",show_error:"Show Error"},n={common:i},s={version:"Versjon",invalid_configuration:"Ikke gyldig konfiguration",show_warning:"Vis advarsel"},o={common:s};const r={en:Object.freeze({__proto__:null,common:i,default:n}),nb:Object.freeze({__proto__:null,common:s,default:o})};function a(t,e="",i=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let s;try{s=t.split(".").reduce((t,e)=>t[e],r[n])}catch(e){s=t.split(".").reduce((t,e)=>t[e],r.en)}return void 0===s&&(s=t.split(".").reduce((t,e)=>t[e],r.en)),""!==e&&""!==i&&(s=s.replace(e,i)),s} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -12,7 +12,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */function r(t,e,i,s){var n,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o<3?n(r):o>3?n(e,i,r):n(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r +***************************************************************************** */function l(t,e,i,n){var s,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,i,r):s(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -25,7 +25,7 @@ PERFORMANCE OF THIS SOFTWARE. * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */}const a="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,l=(t,e,i=null)=>{for(;e!==i;){const i=e.nextSibling;t.removeChild(e),e=i}},c=`{{lit-${String(Math.random()).slice(2)}}}`,h=`\x3c!--${c}--\x3e`,d=new RegExp(`${c}|${h}`);class u{constructor(t,e){this.parts=[],this.element=e;const i=[],s=[],n=document.createTreeWalker(e.content,133,null,!1);let o=0,r=-1,a=0;const{strings:l,values:{length:h}}=t;for(;a0;){const e=l[a],i=f.exec(e)[2],s=i.toLowerCase()+"$lit$",n=t.getAttribute(s);t.removeAttribute(s);const o=n.split(d);this.parts.push({type:"attribute",index:r,name:i,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(s.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(c)>=0){const s=t.parentNode,n=e.split(d),o=n.length-1;for(let e=0;e{const i=t.length-e.length;return i>=0&&t.slice(i)===e},m=t=>-1!==t.index,g=()=>document.createComment(""),f=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function v(t,e){const{element:{content:i},parts:s}=t,n=document.createTreeWalker(i,133,null,!1);let o=_(s),r=s[o],a=-1,l=0;const c=[];let h=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===h&&(h=null),e.has(t)&&(c.push(t),null===h&&(h=t)),null!==h&&l++;void 0!==r&&r.index===a;)r.index=null!==h?-1:r.index-l,o=_(s,o),r=s[o]}c.forEach(t=>t.parentNode.removeChild(t))}const y=t=>{let e=11===t.nodeType?0:1;const i=document.createTreeWalker(t,133,null,!1);for(;i.nextNode();)e++;return e},_=(t,e=-1)=>{for(let i=e+1;i{for(;e!==i;){const i=e.nextSibling;t.removeChild(e),e=i}},h=`{{lit-${String(Math.random()).slice(2)}}}`,u=`\x3c!--${h}--\x3e`,g=new RegExp(`${h}|${u}`);class p{constructor(t,e){this.parts=[],this.element=e;const i=[],n=[],s=document.createTreeWalker(e.content,133,null,!1);let o=0,r=-1,a=0;const{strings:l,values:{length:c}}=t;for(;a0;){const e=l[a],i=v.exec(e)[2],n=i.toLowerCase()+"$lit$",s=t.getAttribute(n);t.removeAttribute(n);const o=s.split(g);this.parts.push({type:"attribute",index:r,name:i,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(n.push(t),s.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(h)>=0){const n=t.parentNode,s=e.split(g),o=s.length-1;for(let e=0;e{const i=t.length-e.length;return i>=0&&t.slice(i)===e},f=t=>-1!==t.index,_=()=>document.createComment(""),v=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function y(t,e){const{element:{content:i},parts:n}=t,s=document.createTreeWalker(i,133,null,!1);let o=w(n),r=n[o],a=-1,l=0;const c=[];let d=null;for(;s.nextNode();){a++;const t=s.currentNode;for(t.previousSibling===d&&(d=null),e.has(t)&&(c.push(t),null===d&&(d=t)),null!==d&&l++;void 0!==r&&r.index===a;)r.index=null!==d?-1:r.index-l,o=w(n,o),r=n[o]}c.forEach(t=>t.parentNode.removeChild(t))}const b=t=>{let e=11===t.nodeType?0:1;const i=document.createTreeWalker(t,133,null,!1);for(;i.nextNode();)e++;return e},w=(t,e=-1)=>{for(let i=e+1;i(...e)=>{const i=t(...e);return b.set(i,!0),i},S=t=>"function"==typeof t&&b.has(t),x={},C={}; +const x=new WeakMap,S=t=>(...e)=>{const i=t(...e);return x.set(i,!0),i},k=t=>"function"==typeof t&&x.has(t),$={},T={}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -53,7 +53,7 @@ const b=new WeakMap,w=t=>(...e)=>{const i=t(...e);return b.set(i,!0),i},S=t=>"fu * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class ${constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this.options=i}update(t){let e=0;for(const i of this.__parts)void 0!==i&&i.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=a?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],i=this.template.parts,s=document.createTreeWalker(t,133,null,!1);let n,o=0,r=0,l=s.nextNode();for(;ot}),k=` ${c} `;class M{constructor(t,e,i,s){this.strings=t,this.values=e,this.type=i,this.processor=s}getHTML(){const t=this.strings.length-1;let e="",i=!1;for(let s=0;s-1||i)&&-1===t.indexOf("--\x3e",n+1);const o=f.exec(t);e+=null===o?t+(i?k:h):t.substr(0,o.index)+o[1]+o[2]+"$lit$"+o[3]+c}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==T&&(e=T.createHTML(e)),t.innerHTML=e,t}} + */const C=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),E=` ${h} `;class P{constructor(t,e,i,n){this.strings=t,this.values=e,this.type=i,this.processor=n}getHTML(){const t=this.strings.length-1;let e="",i=!1;for(let n=0;n-1||i)&&-1===t.indexOf("--\x3e",s+1);const o=v.exec(t);e+=null===o?t+(i?E:u):t.substr(0,o.index)+o[1]+o[2]+"$lit$"+o[3]+h}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==C&&(e=C.createHTML(e)),t.innerHTML=e,t}} /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -79,7 +79,7 @@ class ${constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const E=t=>null===t||!("object"==typeof t||"function"==typeof t),P=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class N{constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let t=0;t{try{const t={get capture(){return H=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class L{constructor(t,e,i){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;S(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=x,t(this)}if(this.__pendingValue===x)return;const t=this.__pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),s=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=Y(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=x}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const Y=t=>t&&(H?{capture:t.capture,passive:t.passive,once:t.once}:t.capture) + */const N=t=>null===t||!("object"==typeof t||"function"==typeof t),O=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class V{constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let t=0;t{try{const t={get capture(){return R=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class Y{constructor(t,e,i){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;k(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=$,t(this)}if(this.__pendingValue===$)return;const t=this.__pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),n=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),n&&(this.__options=I(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=$}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const I=t=>t&&(R?{capture:t.capture,passive:t.passive,once:t.once}:t.capture) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -92,7 +92,7 @@ class ${constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */;function R(t){let e=I.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},I.set(t.type,e));let i=e.stringsArray.get(t.strings);if(void 0!==i)return i;const s=t.strings.join(c);return i=e.keyString.get(s),void 0===i&&(i=new u(t,t.getTemplateElement()),e.keyString.set(s,i)),e.stringsArray.set(t.strings,i),i}const I=new Map,U=new WeakMap; + */;function z(t){let e=F.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},F.set(t.type,e));let i=e.stringsArray.get(t.strings);if(void 0!==i)return i;const n=t.strings.join(h);return i=e.keyString.get(n),void 0===i&&(i=new p(t,t.getTemplateElement()),e.keyString.set(n,i)),e.stringsArray.set(t.strings,i),i}const F=new Map,U=new WeakMap; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -105,7 +105,7 @@ class ${constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const z=new + */const B=new /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -119,7 +119,7 @@ class ${constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class{handleAttributeExpressions(t,e,i,s){const n=e[0];if("."===n){return new j(t,e.slice(1),i).parts}if("@"===n)return[new L(t,e.slice(1),s.eventContext)];if("?"===n)return[new A(t,e.slice(1),i)];return new N(t,e,i).parts}handleTextExpression(t){return new V(t)}}; +class{handleAttributeExpressions(t,e,i,n){const s=e[0];if("."===s){return new D(t,e.slice(1),i).parts}if("@"===s)return[new Y(t,e.slice(1),n.eventContext)];if("?"===s)return[new L(t,e.slice(1),i)];return new V(t,e,i).parts}handleTextExpression(t){return new H(t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -132,7 +132,7 @@ class{handleAttributeExpressions(t,e,i,s){const n=e[0];if("."===n){return new j( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const F=(t,...e)=>new M(t,e,"html",z) + */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const q=(t,...e)=>new P(t,e,"html",B) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -145,7 +145,7 @@ class{handleAttributeExpressions(t,e,i,s){const n=e[0];if("."===n){return new j( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */,B=(t,e)=>`${t}--${e}`;let W=!0;void 0===window.ShadyCSS?W=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),W=!1);const q=t=>e=>{const i=B(e.type,t);let s=I.get(i);void 0===s&&(s={stringsArray:new WeakMap,keyString:new Map},I.set(i,s));let n=s.stringsArray.get(e.strings);if(void 0!==n)return n;const o=e.strings.join(c);if(n=s.keyString.get(o),void 0===n){const i=e.getTemplateElement();W&&window.ShadyCSS.prepareTemplateDom(i,t),n=new u(e,i),s.keyString.set(o,n)}return s.stringsArray.set(e.strings,n),n},J=["html","svg"],Z=new Set,X=(t,e,i)=>{Z.add(t);const s=i?i.element:document.createElement("template"),n=e.querySelectorAll("style"),{length:o}=n;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(s,t);const r=document.createElement("style");for(let t=0;t{J.forEach(e=>{const i=I.get(B(e,t));void 0!==i&&i.keyString.forEach(t=>{const{element:{content:e}}=t,i=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{i.add(t)}),v(t,i)})})})(t);const a=s.content;i?function(t,e,i=null){const{element:{content:s},parts:n}=t;if(null==i)return void s.appendChild(e);const o=document.createTreeWalker(s,133,null,!1);let r=_(n),a=0,l=-1;for(;o.nextNode();){l++;for(o.currentNode===i&&(a=y(e),i.parentNode.insertBefore(e,i));-1!==r&&n[r].index===l;){if(a>0){for(;-1!==r;)n[r].index+=a,r=_(n,r);return}r=_(n,r)}}}(i,r,a.firstChild):a.insertBefore(r,a.firstChild),window.ShadyCSS.prepareTemplateStyles(s,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(i){a.insertBefore(r,a.firstChild);const t=new Set;t.add(r),v(i,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const G={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},K=(t,e)=>e!==t&&(e==e||t==t),Q={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:K};class tt extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,i)=>{const s=this._attributeNameForProperty(i,e);void 0!==s&&(this._attributeToPropertyMap.set(s,i),t.push(s))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=Q){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const n=this[t];this[e]=s,this.requestUpdateInternal(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||Q}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const i of e)this.createProperty(i,t[i])}}static _attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,i=K){return i(t,e)}static _propertyValueFromAttribute(t,e){const i=e.type,s=e.converter||G,n="function"==typeof s?s:s.fromAttribute;return n?n(t,i):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const i=e.type,s=e.converter;return(s&&s.toAttribute||G.toAttribute)(t,i)}initialize(){this._updateState=0,this._updatePromise=new Promise(t=>this._enableUpdatingResolver=t),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,i){e!==i&&this._attributeToProperty(t,i)}_propertyToAttribute(t,e,i=Q){const s=this.constructor,n=s._attributeNameForProperty(t,i);if(void 0!==n){const t=s._propertyValueToAttribute(e,i);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(n):this.setAttribute(n,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const i=this.constructor,s=i._attributeToPropertyMap.get(t);if(void 0!==s){const t=i.getPropertyOptions(s);this._updateState=16|this._updateState,this[s]=i._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,i){let s=!0;if(void 0!==t){const n=this.constructor;i=i||n.getPropertyOptions(t),n._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}tt.finalized=!0; + */,W=(t,e)=>`${t}--${e}`;let X=!0;void 0===window.ShadyCSS?X=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),X=!1);const J=t=>e=>{const i=W(e.type,t);let n=F.get(i);void 0===n&&(n={stringsArray:new WeakMap,keyString:new Map},F.set(i,n));let s=n.stringsArray.get(e.strings);if(void 0!==s)return s;const o=e.strings.join(h);if(s=n.keyString.get(o),void 0===s){const i=e.getTemplateElement();X&&window.ShadyCSS.prepareTemplateDom(i,t),s=new p(e,i),n.keyString.set(o,s)}return n.stringsArray.set(e.strings,s),s},Z=["html","svg"],G=new Set,K=(t,e,i)=>{G.add(t);const n=i?i.element:document.createElement("template"),s=e.querySelectorAll("style"),{length:o}=s;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(n,t);const r=document.createElement("style");for(let t=0;t{Z.forEach(e=>{const i=F.get(W(e,t));void 0!==i&&i.keyString.forEach(t=>{const{element:{content:e}}=t,i=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{i.add(t)}),y(t,i)})})})(t);const a=n.content;i?function(t,e,i=null){const{element:{content:n},parts:s}=t;if(null==i)return void n.appendChild(e);const o=document.createTreeWalker(n,133,null,!1);let r=w(s),a=0,l=-1;for(;o.nextNode();){l++;for(o.currentNode===i&&(a=b(e),i.parentNode.insertBefore(e,i));-1!==r&&s[r].index===l;){if(a>0){for(;-1!==r;)s[r].index+=a,r=w(s,r);return}r=w(s,r)}}}(i,r,a.firstChild):a.insertBefore(r,a.firstChild),window.ShadyCSS.prepareTemplateStyles(n,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(i){a.insertBefore(r,a.firstChild);const t=new Set;t.add(r),y(i,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const Q={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},tt=(t,e)=>e!==t&&(e==e||t==t),et={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:tt};class it extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,i)=>{const n=this._attributeNameForProperty(i,e);void 0!==n&&(this._attributeToPropertyMap.set(n,i),t.push(n))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=et){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;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 s=this[t];this[e]=n,this.requestUpdateInternal(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||et}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const i of e)this.createProperty(i,t[i])}}static _attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,i=tt){return i(t,e)}static _propertyValueFromAttribute(t,e){const i=e.type,n=e.converter||Q,s="function"==typeof n?n:n.fromAttribute;return s?s(t,i):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const i=e.type,n=e.converter;return(n&&n.toAttribute||Q.toAttribute)(t,i)}initialize(){this._updateState=0,this._updatePromise=new Promise(t=>this._enableUpdatingResolver=t),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,i){e!==i&&this._attributeToProperty(t,i)}_propertyToAttribute(t,e,i=et){const n=this.constructor,s=n._attributeNameForProperty(t,i);if(void 0!==s){const t=n._propertyValueToAttribute(e,i);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(s):this.setAttribute(s,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const i=this.constructor,n=i._attributeToPropertyMap.get(t);if(void 0!==n){const t=i.getPropertyOptions(n);this._updateState=16|this._updateState,this[n]=i._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,i){let n=!0;if(void 0!==t){const s=this.constructor;i=i||s.getPropertyOptions(t),s._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):n=!1}!this._hasRequestedUpdate&&n&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}it.finalized=!0; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -159,7 +159,7 @@ class{handleAttributeExpressions(t,e,i,s){const n=e[0];if("."===n){return new j( * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const et=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e),it=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function st(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):it(t,e)}function nt(t){return st({attribute:!1,hasChanged:null==t?void 0:t.hasChanged})}const ot=t=>nt(t) +const nt=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){window.customElements.define(t,e)}}})(t,e),st=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function ot(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):st(t,e)}function rt(t){return ot({attribute:!1,hasChanged:null==t?void 0:t.hasChanged})}const at=t=>rt(t) /** @license Copyright (c) 2019 The Polymer Project Authors. All rights reserved. @@ -169,7 +169,7 @@ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/,rt=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,at=Symbol();class lt{constructor(t,e){if(e!==at)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(rt?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const ct=(t,...e)=>{const i=e.reduce((e,i,s)=>e+(t=>{if(t instanceof lt)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[s+1],t[0]);return new lt(i,at)}; +*/,lt=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ct=Symbol();class dt{constructor(t,e){if(e!==ct)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(lt?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const ht=(t,...e)=>{const i=e.reduce((e,i,n)=>e+(t=>{if(t instanceof dt)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[n+1],t[0]);return new dt(i,ct)}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -183,81 +183,81 @@ found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const ht={};class dt extends tt{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,i)=>t.reduceRight((t,i)=>Array.isArray(i)?e(i,t):(t.add(i),t),i),i=e(t,new Set),s=[];i.forEach(t=>s.unshift(t)),this._styles=s}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map(t=>{if(t instanceof CSSStyleSheet&&!rt){const e=Array.prototype.slice.call(t.cssRules).reduce((t,e)=>t+e.cssText,"");return new lt(String(e),at)}return t})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?rt?this.renderRoot.adoptedStyleSheets=t.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==ht&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){return ht}}dt.finalized=!0,dt.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const s=i.scopeName,n=U.has(e),o=W&&11===e.nodeType&&!!e.host,r=o&&!Z.has(s),a=r?document.createDocumentFragment():e;if(((t,e,i)=>{let s=U.get(e);void 0===s&&(l(e,e.firstChild),U.set(e,s=new V(Object.assign({templateFactory:R},i))),s.appendInto(e)),s.setValue(t),s.commit()})(t,a,Object.assign({templateFactory:q(s)},i)),r){const t=U.get(a);U.delete(a);const i=t.value instanceof $?t.value.template:void 0;X(s,a,i),l(e,e.firstChild),e.appendChild(a),U.set(e,t)}!n&&o&&window.ShadyCSS.styleElement(e.host)},dt.shadowRootOptions={mode:"open"};var ut=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,pt="[^\\s]+",mt=/\[([^]*?)\]/gm;function gt(t,e){for(var i=[],s=0,n=t.length;s-1?s:null}};function vt(t){for(var e=[],i=1;i3?0:(t-t%10!=10?1:0)*t%10]}},St=vt({},wt),xt=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+xt(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+xt(Math.floor(Math.abs(e)/60),2)+":"+xt(Math.abs(e)%60,2)}},$t=function(t){return+t-1},Tt=[null,"[1-9]\\d?"],kt=[null,pt],Mt=["isPm",pt,function(t,e){var i=t.toLowerCase();return i===e.amPm[0]?0:i===e.amPm[1]?1:null}],Et=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var i=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?i:-i}return 0}],Pt=(ft("monthNamesShort"),ft("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});var Nt,Ot,Vt=function(t,e,i){if(void 0===e&&(e=Pt.default),void 0===i&&(i={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var s=[];e=(e=Pt[e]||e).replace(mt,(function(t,e){return s.push(e),"@@@"}));var n=vt(vt({},St),i);return(e=e.replace(ut,(function(e){return Ct[e](t,n)}))).replace(/@@@/g,(function(){return s.shift()}))};(function(){try{(new Date).toLocaleDateString("i")}catch(t){return"RangeError"===t.name}})(),function(){try{(new Date).toLocaleString("i")}catch(t){return"RangeError"===t.name}}(),function(){try{(new Date).toLocaleTimeString("i")}catch(t){return"RangeError"===t.name}}();function At(){return(At=Object.assign||function(t){for(var e=1;e1),zt=[],Ft=!1,Bt=-1,Wt=void 0,qt=void 0,Jt=void 0,Zt=function(t){return zt.some((function(e){return!(!e.options.allowTouchMove||!e.options.allowTouchMove(t))}))},Xt=function(t){var e=t||window.event;return!!Zt(e.target)||(e.touches.length>1||(e.preventDefault&&e.preventDefault(),!1))},Gt=function(t,e){if(t){if(!zt.some((function(e){return e.targetElement===t}))){var i={targetElement:t,options:e||{}};zt=[].concat(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e=s&&(document.body.style.top=-(e+t))}))}),300)}})):function(t){if(void 0===Jt){var e=!!t&&!0===t.reserveScrollBarGap,i=window.innerWidth-document.documentElement.clientWidth;if(e&&i>0){var s=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);Jt=document.body.style.paddingRight,document.body.style.paddingRight=s+i+"px"}}void 0===Wt&&(Wt=document.body.style.overflow,document.body.style.overflow="hidden")}(e),Ut&&(t.ontouchstart=function(t){1===t.targetTouches.length&&(Bt=t.targetTouches[0].clientY)},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){var i=t.targetTouches[0].clientY-Bt;!Zt(t.target)&&(e&&0===e.scrollTop&&i>0||function(t){return!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight}(e)&&i<0?Xt(t):t.stopPropagation())}(e,t)},Ft||(document.addEventListener("touchmove",Xt,Rt?{passive:!1}:void 0),Ft=!0))}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},Kt=function(t){t?(zt=zt.filter((function(e){return e.targetElement!==t})),Ut&&(t.ontouchstart=null,t.ontouchmove=null,Ft&&0===zt.length&&(document.removeEventListener("touchmove",Xt,Rt?{passive:!1}:void 0),Ft=!1)),Ut?function(){if(void 0!==qt){var t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=qt.position,document.body.style.top=qt.top,document.body.style.left=qt.left,window.scrollTo(e,t),qt=void 0}}():(void 0!==Jt&&(document.body.style.paddingRight=Jt,Jt=void 0),void 0!==Wt&&(document.body.style.overflow=Wt,Wt=void 0))):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")};console.info(`%c ---- MY-SLIDER ---- \n%c ${o("common.version")} 3.0.3 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: green"),window.customCards=window.customCards||[],window.customCards.push({type:"my-slider",name:"Slider Card",description:"Custom Slider Card for Lovelace."});let Qt=class extends dt{static getStubConfig(){return{}}static get properties(){return{hass:{},config:{},active:{}}}setConfig(t){const e=["input_number","number","light","media_player","cover","fan","switch","lock"];if(!t.entity)throw new Error("You need to define entity");if(!e.includes(t.entity.split(".")[0]))throw new Error("Entity has to be one of the following: "+e.map(t=>" "+t));this.config=Object.assign({name:"MySlider",disabled_scroll:!1},t)}shouldUpdate(t){return!!this.config&&Yt(this,t,!1)}render(){var t,e=JSON.parse(JSON.stringify(this.config));const i=this.config.entity?this.config.entity:"ERROR: NO ENTITY ID",s=(null===(t=this.config.entity)||void 0===t||t.split(".")[1],this.hass.states[""+i]);var n=e.step?e.step:"1",o=e.minBar?e.minBar:0,r=e.maxBar?e.maxBar:100,a=e.minSet?e.minSet:0,l=e.maxSet?e.maxSet:100;(i.includes("input_number.")||i.includes("number."))&&(n=e.step?e.step:s.attributes.step,a=e.minSet?e.minSet:s.attributes.min,l=e.maxSet?e.maxSet:s.attributes.max);var c=e.width?e.width:"100%",h=e.height?e.height:"50px",d=e.radius?e.radius:"4px",u=e.top?e.top:"0px",p=e.bottom?e.bottom:"0px",m=e.right?e.right:"0px",g=e.left?e.left:"0px",f=e.rotate?e.rotate:"0",v=e.containerHeight?e.containerHeight:h;"0"!=f&&(f+="deg");var y=e.mainSliderColor?e.mainSliderColor:"var(--accent-color)",_=e.secondarySliderColor?e.secondarySliderColor:"#4d4d4d",b=e.mainSliderColorOff?e.mainSliderColorOff:"#636363",w=e.secondarySliderColorOff?e.secondarySliderColorOff:"#4d4d4d",S=e.border?e.border:"0",x=e.thumbWidth?e.thumbWidth:"25px",C=e.thumbHeight?e.thumbHeight:"80px",$=e.thumbColor?e.thumbColor:"#FFFFFF",T=e.thumbColorOff?e.thumbColorOff:"#969696",k=e.thumbHorizontalPadding?e.thumbHorizontalPadding:"10px",M=e.thumbVerticalPadding?e.thumbVerticalPadding:"20px",E=e.thumpTop?e.thumpTop:"calc((var(--slider-width) - var(--thumb-height)) / 2)",P=e.thumbBorderRight?e.thumbBorderRight:"var(--thumb-horizontal-padding) solid var(--slider-main-color)",N=e.thumbBorderLeft?e.thumbBorderLeft:"var(--thumb-horizontal-padding) solid var(--slider-main-color)",O=e.thumbBorderTop?e.thumbBorderTop:"var(--thumb-vertical-padding) solid var(--slider-main-color)",V=e.thumbBorderBotton?e.thumbBorderBotton:"var(--thumb-vertical-padding) solid var(--slider-main-color)",A=!!e.lockTrack&&e.lockTrack,j=`\n\t\t\t--slider-width: ${c};\n\t\t\t--slider-width-inverse: -${c};\n\t\t\t--slider-height: ${h};\n\t\t\t--slider-main-color: ${"off"===s.state||"locked"===s.state||null==s.state?"var(--slider-main-color-off)":"var(--slider-main-color-on)"};\n\t\t\t--slider-main-color-on: ${y};\n\t\t\t--slider-main-color-off: ${b};\n\t\t\t--slider-secondary-color: ${"off"===s.state||"locked"===s.state||null==s.state?"var(--slider-secondary-color-off)":"var(--slider-secondary-color-on)"};\n\t\t\t--slider-secondary-color-on: ${_};\n\t\t\t--slider-secondary-color-off: ${w};\n\t\t\t--slider-radius: ${d};\n\t\t\t--border: ${S};\n\n\t\t\t--thumb-width: ${x};\n\t\t\t--thumb-height: ${C};\n\t\t\t--thumb-color: ${"off"===s.state||null==s.state?"var(--thumb-color-off)":"var(--thumb-color-on)"};\n\t\t\t--thumb-color-on: ${$};\n\t\t\t--thumb-color-off: ${T};\n\t\t\t--thumb-horizontal-padding: ${k};\n\t\t\t--thumb-vertical-padding: ${M};\n\n\t\t\t--rotate: ${f};\n\t\t\t--top: ${u};\n\t\t\t--bottom: ${p};\n\t\t\t--right: ${m};\n\t\t\t--left: ${g};\n\t\t\t--container-height: ${v};\n\t\t\t--thumb-top: ${E};\n\t\t\t--thumb-border-right: ${P};\n\t\t\t--thumb-border-left: ${N};\n\t\t\t--thumb-border-top: ${O};\n\t\t\t--thumb-border-bottom: ${V};\n\t\t\t\n\t\t\t--lock-track-container: ${A?"none":"auto"};\n\t\t`;const D=t=>{i.includes("light.")?"Warmth"==e.function?this._setWarmth(s,t.target,a,l):this._setBrightness(s,t.target,a,l):i.includes("input_number.")||i.includes("number.")?this._setInputNumber(s,t.target,a,l):i.includes("media_player.")?this._setMediaVolume(s,t.target,a,l):i.includes("cover.")?this._setCover(s,t.target,a,l):i.includes("fan.")?this._setFan(s,t.target,a,l):i.includes("switch.")?this._setSwitch(s,t.target,a,l,o,r):i.includes("lock.")&&this._setLock(s,t.target,a,l,o,r)},H=t=>{e.intermediate&&D(t)},L=t=>{e.intermediate||D(t)},Y=()=>{this.config.disabled_scroll=!this.config.disabled_scroll,this.config.disabled_scroll?Gt(window):Kt(window)};if(i.includes("light."))return"Warmth"==e.function?F` +(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const ut={};class gt extends it{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,i)=>t.reduceRight((t,i)=>Array.isArray(i)?e(i,t):(t.add(i),t),i),i=e(t,new Set),n=[];i.forEach(t=>n.unshift(t)),this._styles=n}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map(t=>{if(t instanceof CSSStyleSheet&&!lt){const e=Array.prototype.slice.call(t.cssRules).reduce((t,e)=>t+e.cssText,"");return new dt(String(e),ct)}return t})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?lt?this.renderRoot.adoptedStyleSheets=t.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==ut&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){return ut}}gt.finalized=!0,gt.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,s=U.has(e),o=X&&11===e.nodeType&&!!e.host,r=o&&!G.has(n),a=r?document.createDocumentFragment():e;if(((t,e,i)=>{let n=U.get(e);void 0===n&&(d(e,e.firstChild),U.set(e,n=new H(Object.assign({templateFactory:z},i))),n.appendInto(e)),n.setValue(t),n.commit()})(t,a,Object.assign({templateFactory:J(n)},i)),r){const t=U.get(a);U.delete(a);const i=t.value instanceof M?t.value.template:void 0;K(n,a,i),d(e,e.firstChild),e.appendChild(a),U.set(e,t)}!s&&o&&window.ShadyCSS.styleElement(e.host)},gt.shadowRootOptions={mode:"open"};var pt=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,mt="[^\\s]+",ft=/\[([^]*?)\]/gm;function _t(t,e){for(var i=[],n=0,s=t.length;n-1?n:null}};function yt(t){for(var e=[],i=1;i3?0:(t-t%10!=10?1:0)*t%10]}},kt=yt({},St),$t=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+$t(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+$t(Math.floor(Math.abs(e)/60),2)+":"+$t(Math.abs(e)%60,2)}},Mt=function(t){return+t-1},Ct=[null,"[1-9]\\d?"],Et=[null,mt],Pt=["isPm",mt,function(t,e){var i=t.toLowerCase();return i===e.amPm[0]?0:i===e.amPm[1]?1:null}],Nt=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var i=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?i:-i}return 0}],Ot=(vt("monthNamesShort"),vt("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});var Vt,At,Ht=function(t,e,i){if(void 0===e&&(e=Ot.default),void 0===i&&(i={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var n=[];e=(e=Ot[e]||e).replace(ft,(function(t,e){return n.push(e),"@@@"}));var s=yt(yt({},kt),i);return(e=e.replace(pt,(function(e){return Tt[e](t,s)}))).replace(/@@@/g,(function(){return n.shift()}))};(function(){try{(new Date).toLocaleDateString("i")}catch(t){return"RangeError"===t.name}})(),function(){try{(new Date).toLocaleString("i")}catch(t){return"RangeError"===t.name}}(),function(){try{(new Date).toLocaleTimeString("i")}catch(t){return"RangeError"===t.name}}();function Lt(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}(At=Vt||(Vt={})).language="language",At.system="system",At.comma_decimal="comma_decimal",At.decimal_comma="decimal_comma",At.space_comma="space_comma",At.none="none";var Dt=!1;if("undefined"!=typeof window){var jt={get passive(){Dt=!0}};window.addEventListener("testPassive",null,jt),window.removeEventListener("testPassive",null,jt)}var Rt="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),Yt=[],It=!1,zt=-1,Ft=void 0,Ut=void 0,Bt=void 0,qt=function(t){return Yt.some((function(e){return!(!e.options.allowTouchMove||!e.options.allowTouchMove(t))}))},Wt=function(t){var e=t||window.event;return!!qt(e.target)||(e.touches.length>1||(e.preventDefault&&e.preventDefault(),!1))},Xt=function(t,e){if(t){if(!Yt.some((function(e){return e.targetElement===t}))){var i={targetElement:t,options:e||{}};Yt=[].concat(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e=n&&(document.body.style.top=-(e+t))}))}),300)}})):function(t){if(void 0===Bt){var e=!!t&&!0===t.reserveScrollBarGap,i=window.innerWidth-document.documentElement.clientWidth;if(e&&i>0){var n=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);Bt=document.body.style.paddingRight,document.body.style.paddingRight=n+i+"px"}}void 0===Ft&&(Ft=document.body.style.overflow,document.body.style.overflow="hidden")}(e),Rt&&(t.ontouchstart=function(t){1===t.targetTouches.length&&(zt=t.targetTouches[0].clientY)},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){var i=t.targetTouches[0].clientY-zt;!qt(t.target)&&(e&&0===e.scrollTop&&i>0||function(t){return!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight}(e)&&i<0?Wt(t):t.stopPropagation())}(e,t)},It||(document.addEventListener("touchmove",Wt,Dt?{passive:!1}:void 0),It=!0))}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},Jt=function(t){t?(Yt=Yt.filter((function(e){return e.targetElement!==t})),Rt&&(t.ontouchstart=null,t.ontouchmove=null,It&&0===Yt.length&&(document.removeEventListener("touchmove",Wt,Dt?{passive:!1}:void 0),It=!1)),Rt?function(){if(void 0!==Ut){var t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=Ut.position,document.body.style.top=Ut.top,document.body.style.left=Ut.left,window.scrollTo(e,t),Ut=void 0}}():(void 0!==Bt&&(document.body.style.paddingRight=Bt,Bt=void 0),void 0!==Ft&&(document.body.style.overflow=Ft,Ft=void 0))):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")};console.info(`%c ---- MY-SLIDER ---- \n%c ${a("common.version")} 3.0.6 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: green"),window.customCards=window.customCards||[],window.customCards.push({type:"my-slider",name:"Slider Card",description:"Custom Slider Card for Lovelace."});let Zt=class extends gt{static getStubConfig(){return{}}static get properties(){return{hass:{},config:{},active:{}}}setConfig(t){const e=["input_number","number","light","media_player","cover","fan","switch","lock"];if(!t.entity)throw new Error("You need to define entity");if(!e.includes(t.entity.split(".")[0]))throw new Error("Entity has to be one of the following: "+e.map(t=>" "+t));this.config=Object.assign({name:"MySlider",disabled_scroll:!1},t)}shouldUpdate(t){return!!this.config&&Lt(this,t,!1)}render(){var t,e=JSON.parse(JSON.stringify(this.config));const i=this.config.entity?this.config.entity:"ERROR: NO ENTITY ID",n=(null===(t=this.config.entity)||void 0===t||t.split(".")[1],this.hass.states[""+i]);var s=e.step?e.step:"1",o=e.minBar?e.minBar:0,r=e.maxBar?e.maxBar:100,a=e.minSet?e.minSet:0,l=e.maxSet?e.maxSet:100;(i.includes("input_number.")||i.includes("number."))&&(s=e.step?e.step:n.attributes.step,a=e.minSet?e.minSet:n.attributes.min,l=e.maxSet?e.maxSet:n.attributes.max);var c=e.width?e.width:"100%",d=e.height?e.height:"50px",h=e.radius?e.radius:"4px",u=e.top?e.top:"0px",g=e.bottom?e.bottom:"0px",p=e.right?e.right:"0px",m=e.left?e.left:"0px",f=e.rotate?e.rotate:"0",_=e.containerHeight?e.containerHeight:d;"0"!=f&&(f+="deg");var v=e.mainSliderColor?e.mainSliderColor:"var(--accent-color)",y=e.secondarySliderColor?e.secondarySliderColor:"#4d4d4d",b=e.mainSliderColorOff?e.mainSliderColorOff:"#636363",w=e.secondarySliderColorOff?e.secondarySliderColorOff:"#4d4d4d",x=e.border?e.border:"0",S=e.thumbWidth?e.thumbWidth:"25px",k=e.thumbHeight?e.thumbHeight:"80px",$=e.thumbColor?e.thumbColor:"#FFFFFF",T=e.thumbColorOff?e.thumbColorOff:"#969696",M=e.thumbHorizontalPadding?e.thumbHorizontalPadding:"10px",C=e.thumbVerticalPadding?e.thumbVerticalPadding:"20px",E=e.thumpTop?e.thumpTop:"calc((var(--slider-width) - var(--thumb-height)) / 2)",P=e.thumbBorderRight?e.thumbBorderRight:"var(--thumb-horizontal-padding) solid var(--slider-main-color)",N=e.thumbBorderLeft?e.thumbBorderLeft:"var(--thumb-horizontal-padding) solid var(--slider-main-color)",O=e.thumbBorderTop?e.thumbBorderTop:"var(--thumb-vertical-padding) solid var(--slider-main-color)",V=e.thumbBorderBotton?e.thumbBorderBotton:"var(--thumb-vertical-padding) solid var(--slider-main-color)",A=!!e.lockTrack&&e.lockTrack,H=`\n\t\t\t--slider-width: ${c};\n\t\t\t--slider-width-inverse: -${c};\n\t\t\t--slider-height: ${d};\n\t\t\t--slider-main-color: ${"off"===n.state||"locked"===n.state||null==n.state?"var(--slider-main-color-off)":"var(--slider-main-color-on)"};\n\t\t\t--slider-main-color-on: ${v};\n\t\t\t--slider-main-color-off: ${b};\n\t\t\t--slider-secondary-color: ${"off"===n.state||"locked"===n.state||null==n.state?"var(--slider-secondary-color-off)":"var(--slider-secondary-color-on)"};\n\t\t\t--slider-secondary-color-on: ${y};\n\t\t\t--slider-secondary-color-off: ${w};\n\t\t\t--slider-radius: ${h};\n\t\t\t--border: ${x};\n\n\t\t\t--thumb-width: ${S};\n\t\t\t--thumb-height: ${k};\n\t\t\t--thumb-color: ${"off"===n.state||null==n.state?"var(--thumb-color-off)":"var(--thumb-color-on)"};\n\t\t\t--thumb-color-on: ${$};\n\t\t\t--thumb-color-off: ${T};\n\t\t\t--thumb-horizontal-padding: ${M};\n\t\t\t--thumb-vertical-padding: ${C};\n\n\t\t\t--rotate: ${f};\n\t\t\t--top: ${u};\n\t\t\t--bottom: ${g};\n\t\t\t--right: ${p};\n\t\t\t--left: ${m};\n\t\t\t--container-height: ${_};\n\t\t\t--thumb-top: ${E};\n\t\t\t--thumb-border-right: ${P};\n\t\t\t--thumb-border-left: ${N};\n\t\t\t--thumb-border-top: ${O};\n\t\t\t--thumb-border-bottom: ${V};\n\t\t\t\n\t\t\t--lock-track-container: ${A?"none":"auto"};\n\t\t`;const L=t=>{i.includes("light.")?"Warmth"==e.function?this._setWarmth(n,t.target,a,l):this._setBrightness(n,t.target,a,l):i.includes("input_number.")||i.includes("number.")?this._setInputNumber(n,t.target,a,l):i.includes("media_player.")?this._setMediaVolume(n,t.target,a,l):i.includes("cover.")?this._setCover(n,t.target,a,l):i.includes("fan.")?this._setFan(n,t.target,a,l):i.includes("switch.")?this._setSwitch(n,t.target,a,l,o,r):i.includes("lock.")&&this._setLock(n,t.target,a,l,o,r)},D=t=>{e.intermediate&&L(t)},j=t=>{e.intermediate||L(t)},R=()=>{this.config.disabled_scroll=!this.config.disabled_scroll,this.config.disabled_scroll?Xt(window):Jt(window)};if(i.includes("light."))return"Warmth"==e.function?q` -
- +
+
- `:F` + `:q` -
- +
+
- `;if(i.includes("input_number.")||i.includes("number."))return F` + `;if(i.includes("input_number.")||i.includes("number."))return q` -
- + + step="${s}" .value="${n.state}" + @input=${D} @change=${j} + @touchstart=${e.toggle_scroll?R:null} + @touchend=${e.toggle_scroll?R:null} >
- `;if(i.includes("media_player.")){var R=0;if(null!=s.attributes.volume_level)R=Number(100*s.attributes.volume_level);return F` + `;if(i.includes("media_player.")){var Y=0;if(null!=n.attributes.volume_level)Y=Number(100*n.attributes.volume_level);return q` -
- +
+
- `}return i.includes("cover.")?F` + `}return i.includes("cover.")?q` -
- +
+
- `:i.includes("fan.")?F` + `:i.includes("fan.")?q` -
- +
+
- `:i.includes("switch.")||i.includes("lock.")?F` + `:i.includes("switch.")||i.includes("lock.")?q` -
- +
+
- `:void 0}_setBrightness(t,e,i,s){var n=e.value;n>s?n=s:ns?n=s:ns?n=s:ns?n=s:ns?n=s:ns?n=s:nn?s=n:sn?s=n:sn?s=n:sn?s=n:sn?s=n:sn?s=n:se=>{if(!(e instanceof O)||e instanceof D||"style"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:i}=e,{style:s}=i.element;let n=te.get(e);void 0===n&&(s.cssText=i.strings.join(" "),te.set(e,n=new Set)),n.forEach(e=>{e in t||(n.delete(e),-1===e.indexOf("-")?s[e]=null:s.removeProperty(e))});for(const e in t)n.add(e),-1===e.indexOf("-")?s[e]=t[e]:s.setProperty(e,t[e])}),ie=(t,e={})=>{switch(t){case"card":return se(e);case"container":return ne(e);case"track":return oe(e);case"progress":return re(e);case"thumb":return ae(e);default:return void console.log("Getting default styles")}},se=t=>Object.assign({height:"30px"},t),ne=t=>Object.assign({width:"100%",height:"100%",position:"relative",overflow:"hidden","border-radius":"5px"},t),oe=t=>Object.assign({width:"100%",height:"100%",position:"relative",background:"var(--card-background-color)"},t),re=t=>Object.assign({height:"100%",background:"var(--paper-item-icon-active-color)",position:"absolute",width:"0.00%"},t),ae=t=>Object.assign({height:"100%",background:"black",position:"absolute",right:"-5px",width:"10px"},t),le=function(t,e,i){var s,n;for(var o in e=void 0===e?[]:e,i=void 0===i?{}:i,t)t.hasOwnProperty(o)&&(s=o,n=t[o],e.push(s),"object"==typeof n&&null!==n?i=le(n,e,i):i[e[e.length-1]]=n,e.pop());return i},ce=(t,e=100,i=0)=>t/(e-i)*100,he=t=>Math.round(100*(t+Number.EPSILON))/100;console.info(`%c ---- MY-SLIDER-V2 ---- \n%c ${o("common.version")} 3.0.3 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: green"),console.info("HELLO FROM SLIDER-V2"),window.customCards=window.customCards||[],window.customCards.push({type:"my-slider-v2",name:"Slider Card V2",description:"Custom Slider Card V2 for Lovelace."});let de=class extends dt{constructor(){super(...arguments),this.colorMode="brightness",this.sliderId="",this.touchInput=!1,this.disableScroll=!0,this.allowTapping=!0,this.thumbTapped=!1,this.actionTaken=!1,this.vertical=!1,this.flipped=!1,this.inverse=!1,this.showMin=!1,this.zero=0,this.savedMin=1,this.min=0,this.max=100,this.minThreshold=0,this.maxThreshold=100,this.step=1,this.sliderVal=0,this.sliderValPercent=0}setSliderValues(t,e){this.inverse?(this.sliderVal=this.max-t,this.sliderValPercent=100-e):(this.sliderVal=t,this.sliderValPercent=e)}static getStubConfig(){return{}}static get properties(){return{hass:{},config:{},active:{}}}setConfig(t){const e=["light","input_number","number","media_player","cover","fan","switch","lock"];if(!t.entity)throw new Error("You need to define entity");if(!e.includes(t.entity.split(".")[0]))throw new Error("Entity has to be one of the following: "+e.map(t=>" "+t));this.config=Object.assign({name:"MySliderV2"},t)}shouldUpdate(t){return!!this.config&&Yt(this,t,!1)}render(){var t,e,i,s,n,o,r,a,l,c;const h=this.initializeConfig();if(null!==h)return h;const d=le(null===(t=this._config.styles)||void 0===t?void 0:t.card)?le(null===(e=this._config.styles)||void 0===e?void 0:e.card):{},u=le(null===(i=this._config.styles)||void 0===i?void 0:i.container)?le(null===(s=this._config.styles)||void 0===s?void 0:s.container):{},p=le(null===(n=this._config.styles)||void 0===n?void 0:n.track)?le(null===(o=this._config.styles)||void 0===o?void 0:o.track):{},m=le(null===(r=this._config.styles)||void 0===r?void 0:r.progress)?le(null===(a=this._config.styles)||void 0===a?void 0:a.progress):{},g=le(null===(l=this._config.styles)||void 0===l?void 0:l.thumb)?le(null===(c=this._config.styles)||void 0===c?void 0:c.thumb):{},f=ie("card",d),v=ie("container",u),y=ie("track",p),_=ie("progress",m),b=ie("thumb",g);this.vertical?(_.height=this.sliderValPercent.toString()+"%",f.height=d.height?d.height:"100%",f.width=d.width?d.width:"30px",_.width=m.width?m.width:"100%",_.right=m.right?m.right:"auto",b.right=g.right?g:"auto",b.width=g.width?g.width:"100%",b.height=g.height?g.height:"10px",this.flipped?(_.top=m.top?m.top:"0",b.bottom=g.bottom?g.bottom:"-5px"):(_.bottom=m.bottom?m.bottom:"0",b.top=g.top?g.top:"-5px")):(_.width=this.sliderValPercent.toString()+"%",this.flipped&&(_.right=m.right?m.right:"0",b.right=g.right?g.right:"auto",b.left=g.left?g.left:"-5px"));const w=t=>{const e=t.composedPath().find(t=>t.classList.contains("my-slider-custom-container"));this.sliderEl=e||t.target},S=t=>{switch(t.type){case"mousedown":if(this.touchInput)return;x(t);break;case"touchstart":this.touchInput=!0,x(t);break;case"mousemove":if(this.touchInput)return;$(t);break;case"touchmove":this.disableScroll&&t.preventDefault(),$(t);break;case"mouseup":case"touchend":case"touchcancel":C(t)}},x=t=>{this.actionTaken||(w(t),this.allowTapping?(this.actionTaken=!0,this.calcProgress(t)):t.path[0].classList.contains("my-slider-custom-thumb")&&(this.thumbTapped=!0,this.actionTaken=!0,this.calcProgress(t)))},C=t=>{this.actionTaken&&((this.allowTapping||this.thumbTapped)&&this.calcProgress(t),this.thumbTapped=!1,this.actionTaken=!1,this.touchInput=!1)},$=t=>{this.actionTaken&&this.calcProgress(t)};return this.createAndCleanupEventListeners(S),F` - -
e=>{if(!(e instanceof A)||e instanceof j||"style"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:i}=e,{style:n}=i.element;let s=Gt.get(e);void 0===s&&(n.cssText=i.strings.join(" "),Gt.set(e,s=new Set)),s.forEach(e=>{e in t||(s.delete(e),-1===e.indexOf("-")?n[e]=null:n.removeProperty(e))});for(const e in t)s.add(e),-1===e.indexOf("-")?n[e]=t[e]:n.setProperty(e,t[e])}),Qt=(t,e={})=>{const i=te[t];return i?Object.assign(Object.assign({},i),e):void console.log(t+": Not found in styles")},te={card:{height:"30px"},container:{width:"100%",height:"100%",position:"relative",overflow:"hidden","border-radius":"5px"},track:{width:"100%",height:"100%",position:"relative",background:"var(--card-background-color)"},progress:{height:"100%",background:"var(--paper-item-icon-active-color)",position:"absolute",width:"0.00%"},thumb:{height:"100%",background:"black",position:"absolute",right:"-5px",width:"10px"}},ee=function(t,e,i){var n,s;for(var o in e=void 0===e?[]:e,i=void 0===i?{}:i,t)t.hasOwnProperty(o)&&(n=o,s=t[o],e.push(n),"object"==typeof s&&null!==s?i=ee(s,e,i):i[e[e.length-1]]=s,e.pop());return i},ie=(t,e=100,i=0)=>t/(e-i)*100,ne=t=>Math.round(100*(t+Number.EPSILON))/100;function se(t,e){if(!oe(t))return oe(e)?e:{};if(!oe(e))return oe(t)?t:{};if(oe(t)&&oe(e)){const i=Object.assign({},t);return Object.keys(e).forEach(n=>{Array.isArray(e[n])?i[n]=e[n].map((e,i)=>t[n]&&oe(t[n][i])&&oe(e)?se(t[n][i],e):e):oe(e[n])?n in t?i[n]=se(t[n],e[n]):Object.assign(i,{[n]:e[n]}):Object.assign(i,{[n]:e[n]})}),i}return{}}function oe(t){return t&&"object"==typeof t&&!Array.isArray(t)}function re(e,i){if(void 0===e)return!1;const n=(s=e.entity_id).substring(0,s.indexOf("."));var s;const o=void 0!==i?i:null==e?void 0:e.state;if(["button","event","input_button","scene"].includes(n))return"unavailable"!==o;if(t(o))return!1;if("off"===o&&"alert"!==n)return!1;switch(n){case"alarm_control_panel":return"disarmed"!==o;case"alert":return"idle"!==o;case"cover":return"closed"!==o;case"device_tracker":case"person":return"not_home"!==o;case"lock":return"locked"!==o;case"media_player":return"standby"!==o;case"vacuum":return!["idle","docked","paused"].includes(o);case"plant":return"problem"===o;case"group":return["on","home","open","locked","problem"].includes(o);case"timer":return"active"===o;case"camera":return"streaming"===o}return!0}const ae=(t,e)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let i,n;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(!ae(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!ae(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(t[i]!==e[i])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const s=Object.keys(t);if(n=s.length,n!==Object.keys(e).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(e,s[i]))return!1;for(i=n;0!=i--;){const n=s[i];if(!ae(t[n],e[n]))return!1}return!0}return t!=t&&e!=e},le=(t,e,i)=>{const n=JSON.parse(JSON.stringify(i));return ce(t,e,n)},ce=(t,e,i)=>{if(["number","boolean"].includes(typeof i))return i;if(!i)return i;if("object"==typeof i)return Object.keys(i).forEach(n=>{i[n]=ce(t,e,i[n])}),i;const n=i.trim();if("[[["===n.substring(0,3)&&"]]]"===n.slice(-3)){return de(t,e,n.slice(3,-3))}return i},de=(t,e,i)=>{try{return new Function("states","entity","user","hass","html","'use strict'; "+i).call(t,t.hass.states,e,t.hass.user,t.hass,q)}catch(t){if(t instanceof Error){const e=i.length<=100?i.trim():i.trim().substring(0,98)+"...";throw t.message=`${t.name}: ${t.message} in '${e}'`,t.name="MyCardJSTemplateError",t}console.log("Unexpected error (_evalTemplate)",t)}};console.info(`%c ---- MY-SLIDER-V2 ---- \n%c ${a("common.version")} 3.0.6 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: green"),window.customCards=window.customCards||[],window.customCards.push({type:"my-slider-v2",name:"Slider Card V2",description:"Custom Slider Card V2 for Lovelace."});let he=class extends gt{constructor(){super(...arguments),this.touchInput=!1,this.thumbTapped=!1,this.isSliding=!1,this.clientXLast=0,this.clientYLast=0,this.actionTaken=!1,this.zero=0,this.oldVal=0,this.sliderVal=0,this.sliderValPercent=0,this.initialTransition=""}setSliderValues(t,e){this._config.inverse?(this.sliderVal=this._config.max-t,this.sliderValPercent=100-e):(this.sliderVal=t,this.sliderValPercent=e)}static getStubConfig(){return{}}static get properties(){return{hass:{},config:{},active:{}}}setConfig(t){const e=["light","input_number","number","media_player","cover","fan","switch","input_boolean","lock"];if(!t.entity)throw new Error("You need to define entity");if(!e.includes(t.entity.split(".")[0]))throw new Error("Entity has to be one of the following: "+e.map(t=>" "+t));this.config=Object.assign({name:"MySliderV2"},t)}shouldUpdate(t){return!!this.config&&(void 0!==this._config&&"seekbar"===this._config.mode&&this.entity.state,Lt(this,t,!1))}updated(t){super.updated(t),requestAnimationFrame(()=>{if(void 0===this.sliderEl&&null!==this.shadowRoot){this.sliderEl=this.shadowRoot.querySelector(".my-slider-custom-container");const t=this.sliderEl.querySelector(".my-slider-custom-progress");this.initialTransition=t.style.transition}})}render(){var t,e,i,n,s,o,r,a,l;const c=this.initializeConfig();if(null!==c)return c;const d=[{transition:this._config.vertical?"height 0.2s ease 0s":"width 0.2s ease 0s"}],h=(null===(t=this._config.styles)||void 0===t?void 0:t.progress)?Object.assign(Object.assign({},d),this._config.styles.progress):d,u=ee(null===(e=this._config.styles)||void 0===e?void 0:e.card)?ee(null===(i=this._config.styles)||void 0===i?void 0:i.card):{},g=ee(null===(n=this._config.styles)||void 0===n?void 0:n.container)?ee(null===(s=this._config.styles)||void 0===s?void 0:s.container):{},p=ee(null===(o=this._config.styles)||void 0===o?void 0:o.track)?ee(null===(r=this._config.styles)||void 0===r?void 0:r.track):{},m=ee(h),f=ee(null===(a=this._config.styles)||void 0===a?void 0:a.thumb)?ee(null===(l=this._config.styles)||void 0===l?void 0:l.thumb):{},_=Qt("card",u),v=Qt("container",g),y=Qt("track",p),b=Qt("progress",m),w=Qt("thumb",f);this._config.vertical?(b.height=this.sliderValPercent.toString()+"%",_.height=u.height?u.height:"100%",_.width=u.width?u.width:"30px",b.width=m.width?m.width:"100%",b.right=m.right?m.right:"auto",w.right=f.right?f:"auto",w.width=f.width?f.width:"100%",w.height=f.height?f.height:"10px",this._config.flipped?(b.top=m.top?m.top:"0",w.bottom=f.bottom?f.bottom:"-5px"):(b.bottom=m.bottom?m.bottom:"0",w.top=f.top?f.top:"-5px")):(b.width=this.sliderValPercent.toString()+"%",this._config.flipped&&(b.right=m.right?m.right:"0",w.right=f.right?f.right:"auto",w.left=f.left?f.left:"-5px"));const x=t=>{switch(t.type){case"mousedown":if(this.touchInput)return;S(t);break;case"touchstart":this.touchInput=!0,S(t);break;case"mousemove":if(this.touchInput)return;$(t);break;case"touchmove":this._config.disableScroll&&t.preventDefault(),$(t);break;case"mouseup":case"touchend":case"touchcancel":k(t)}},S=t=>{var e;if(this.actionTaken)return;const i=t.clientX||t.touches[0].clientX,n=t.clientY||t.touches[0].clientY;if(0===this.clientXLast&&(this.clientXLast=i),0===this.clientYLast&&(this.clientYLast=n),this._config.allowTapping)return this.actionTaken=!0,void this.calcProgress(t);{const s=t.composedPath()[0],o=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".my-slider-custom-thumb");if(s.classList.contains("my-slider-custom-thumb"))return this.thumbTapped=!0,this.actionTaken=!0,void this.calcProgress(t);if(o){const e=o.getBoundingClientRect();if(i>=e.left-this._config.marginOfError&&i<=e.right+this._config.marginOfError&&n>=e.top-this._config.marginOfError&&n<=e.bottom+this._config.marginOfError)return this.thumbTapped=!0,this.actionTaken=!0,void this.calcProgress(t)}}this._config.allowSliding&&(this.actionTaken=!0),this.clientYLast=n,this.clientXLast=i},k=t=>{if(!this.actionTaken)return;this.sliderEl.querySelector(".my-slider-custom-progress").style.transition=this.initialTransition,(this._config.allowTapping||this.thumbTapped||this.isSliding)&&this.calcProgress(t),this.thumbTapped=!1,this.touchInput=!1,this.isSliding=!1,setTimeout(()=>{this.actionTaken=!1},50)},$=t=>{if(this.actionTaken){this.sliderEl.querySelector(".my-slider-custom-progress").style.transition="";const e=t.clientX||t.touches[0].clientX,i=t.clientY||t.touches[0].clientY;this._config.allowTapping||this.isSliding||!this._config.allowTapping&&this.thumbTapped?(this.calcProgress(t),this.clientXLast=e,this.clientYLast=i):this._config.allowSliding&&(this._config.vertical?Math.abs(i-this.clientYLast)>=this._config.slideDistance&&(this.isSliding=!0,this.clientXLast=e,this.clientYLast=i):Math.abs(e-this.clientXLast)>=this._config.slideDistance&&(this.isSliding=!0,this.clientXLast=e,this.clientYLast=i))}};return this.createAndCleanupEventListeners(x),q` + +
-
-
-
+
+
+
- `}initializeConfig(){this.entity=this.hass.states[""+this.config.entity];try{this._config=this._objectEvalTemplate(this.entity,this.config)}catch(t){if(t instanceof Error){t.stack?console.error(t.stack):console.error(t);const e=document.createElement("hui-error-card");return e.setConfig({type:"error",error:t.toString(),origConfig:this.config}),e}console.log("Unexpected error evaluating config on init:",t)}this.sliderId="slider-"+this._config.entity.replace(".","-"),this.colorMode=void 0!==this._config.colorMode?this._config.colorMode:"brightness",this.vertical=void 0!==this._config.vertical&&this._config.vertical,this.flipped=void 0!==this._config.flipped&&this._config.flipped,this.inverse=void 0!==this._config.inverse&&this._config.inverse,this.disableScroll=void 0===this._config.disableScroll||this._config.disableScroll,this.allowTapping=void 0===this._config.allowTapping||this._config.allowTapping,this.showMin=void 0!==this._config.showMin&&this._config.showMin,this.min=this._config.min?this._config.min:0,this.max=this._config.max?this._config.max:100,this.minThreshold=this._config.minThreshold?this._config.minThreshold:0,this.maxThreshold=this._config.maxThreshold?this._config.maxThreshold:100,this.step=this._config.step?this._config.step:1;let t=0;switch(this._config.entity.split(".")[0]){case"light":if("brightness"===this.colorMode)"on"===this.entity.state?(t=Math.round(this.entity.attributes.brightness/2.56),this.showMin||(t-=this.min)):t=0;else if("temperature"===this.colorMode){if("on"!==this.entity.state)break;this.min=this._config.min?this._config.min:this.entity.attributes.min_mireds,this.max=this._config.max?this._config.max:this.entity.attributes.max_mireds,t=parseFloat(this.entity.attributes.color_temp),this.showMin||(this.max=this.max-this.min,t-=this.min)}else if("hue"===this.colorMode&&"hs"===this.entity.attributes.color_mode){if("on"!==this.entity.state)break;this.min=this._config.min?this._config.min:0,this.max=this._config.max?this._config.max:360,t=parseFloat(this.entity.attributes.hs_color[0]),this.showMin||(this.max=this.max-this.min,t-=this.min)}else if("saturation"===this.colorMode&&"hs"===this.entity.attributes.color_mode){if("on"!==this.entity.state)break;this.min=this._config.min?this._config.min:0,this.max=this._config.max?this._config.max:100,t=parseFloat(this.entity.attributes.hs_color[1]),this.showMin||(this.max=this.max-this.min,t-=this.min)}this.setSliderValues(t,he(ce(t,this.max)));break;case"input_number":case"number":this.step=this._config.step?this._config.step:this.entity.attributes.step,this.min=this._config.min?this._config.min:this.entity.attributes.min,this.max=this._config.max?this._config.max:this.entity.attributes.max,t=parseFloat(this.entity.state),this.showMin||(this.max=this.max-this.min,t-=this.min),this.setSliderValues(t,he(ce(t,this.max)));break;case"media_player":t=0,null!=this.entity.attributes.volume_level&&(t=Number(100*this.entity.attributes.volume_level)),this.showMin||(this.max=this.max-this.min,t-=this.min),this.setSliderValues(t,he(ce(t,this.max)));break;case"cover":t=0,null!=this.entity.attributes.current_position&&(t=Number(this.entity.attributes.current_position)),this.showMin||(this.max=this.max-this.min,t-=this.min),this.inverse=void 0===this._config.inverse||this._config.inverse,this.vertical=void 0===this._config.vertical||this._config.vertical,this.flipped=void 0===this._config.flipped||this._config.flipped,this.setSliderValues(t,he(ce(t,this.max)));break;case"fan":t=0,null!=this.entity.attributes.percentage&&(t=Number(this.entity.attributes.percentage)),this.showMin||(this.max=this.max-this.min,t-=this.min),this.setSliderValues(t,he(ce(t,this.max)));break;case"switch":case"lock":this.minThreshold=this._config.minThreshold?this._config.minThreshold:15,this.maxThreshold=this._config.maxThreshold?this._config.maxThreshold:75,t=Number(Math.max(this.zero,this.minThreshold)),this.setSliderValues(t,t);break;default:console.log("No Entity type initiated... ("+this._config.entity.split(".")[0]+")")}return null}calcProgress(t){if(null==this.sliderEl||null===this.sliderEl)return;const e=((t,e)=>{let i={x:0,y:0};if("touchstart"==t.type||"touchmove"==t.type||"touchend"==t.type||"touchcancel"==t.type){let e=void 0===t.originalEvent?t:t.originalEvent,s=e.touches[0]||e.changedTouches[0];i.x=s.clientX,i.y=s.clientY}else"mousedown"!=t.type&&"mouseup"!=t.type&&"mousemove"!=t.type&&"mouseover"!=t.type&&"mouseout"!=t.type&&"mouseenter"!=t.type&&"mouseleave"!=t.type||(i.x=t.clientX,i.y=t.clientY);let s=e.getBoundingClientRect(),n=i.x-s.left,o=i.y-s.top;return o=e.offsetHeight-o,{x:n,y:o}})(t,this.sliderEl),i=this.sliderEl.offsetWidth,s=this.sliderEl.offsetHeight,n=(this.vertical?he(e.y/s*100):he(e.x/i*100))/100*(this.max-0),o=this.max-n;let r=this.flipped?Math.round(o):Math.round(n);r=rthis.max?this.max:rthis.step)&&this.hass.callService("light","turn_on",{entity_id:t.entity_id,brightness:2.56*e})}_setColorTemp(t,e){let i=parseFloat(t.attributes.color_temp);("off"===t.state||Math.abs(e-i)>this.step)&&this.hass.callService("light","turn_on",{entity_id:t.entity_id,color_temp:e})}_setHue(t,e){let i=0,s=0;t.attributes.hs_color&&(i=parseFloat(t.attributes.hs_color[0]),s=parseFloat(t.attributes.hs_color[1])),("off"===t.state||Math.abs(e-i)>this.step)&&this.hass.callService("light","turn_on",{entity_id:t.entity_id,hs_color:[e,s]})}_setSaturation(t,e){let i=0,s=0;t.attributes.hs_color&&(i=parseFloat(t.attributes.hs_color[1]),s=parseFloat(t.attributes.hs_color[0])),("off"===t.state||Math.abs(e-i)>this.step)&&this.hass.callService("light","turn_on",{entity_id:t.entity_id,hs_color:[s,e]})}_setInputNumber(t,e){let i=parseFloat(t.state);this.showMin||(i-=this.min),Math.abs(e-i)>this.step&&this.hass.callService(t.entity_id.split(".")[0],"set_value",{entity_id:t.entity_id,value:e})}_setMediaVolume(t,e){let i=Number(100*this.entity.attributes.volume_level);this.showMin||(i-=this.min),Math.abs(e-i)>this.step&&this.hass.callService("media_player","volume_set",{entity_id:t.entity_id,volume_level:e/100})}_setCover(t,e){this.hass.callService("cover","set_cover_position",{entity_id:t.entity_id,position:e})}_setFan(t,e){this.hass.callService("fan","set_percentage",{entity_id:t.entity_id,percentage:e})}_setSwitch(t,e){var i=Math.min(this.max,this.maxThreshold);Number(i)<=e&&this.hass.callService("homeassistant","toggle",{entity_id:t.entity_id});const s=Number(Math.max(this.zero,this.minThreshold)),n=he(ce(s,this.max));this.setSliderValues(s,n);const o=this.sliderEl.querySelector(".my-slider-custom-progress");o.style.transition="width 0.2s ease 0s",o.style.width=n.toString()+"%",setTimeout(()=>{o.style.transition="initial"},200)}_setLock(t,e){var i=Math.min(this.max,this.maxThreshold);if(Number(i)<=e){var s="locked"===t.state?"unlock":"lock";this.hass.callService("lock",s,{entity_id:t.entity_id})}const n=Number(Math.max(this.zero,this.minThreshold)),o=he(ce(n,this.max));this.setSliderValues(n,o);const r=this.sliderEl.querySelector(".my-slider-custom-progress");r.style.transition="width 0.2s ease 0s",r.style.width=o.toString()+"%",setTimeout(()=>{r.style.transition="initial"},200)}createAndCleanupEventListeners(t){document.removeEventListener("mouseup",t),document.removeEventListener("touchend",t),document.removeEventListener("touchcancel",t),document.addEventListener("mouseup",t),document.addEventListener("touchend",t),document.addEventListener("touchcancel",t),document.addEventListener("mousemove",t)}_objectEvalTemplate(t,e){const i=JSON.parse(JSON.stringify(e));return this._getTemplateOrValue(t,i)}_getTemplateOrValue(t,e){if(["number","boolean"].includes(typeof e))return e;if(!e)return e;if("object"==typeof e)return Object.keys(e).forEach(i=>{e[i]=this._getTemplateOrValue(t,e[i])}),e;const i=e.trim();if("[[["===i.substring(0,3)&&"]]]"===i.slice(-3)){return this._evalTemplate(t,i.slice(3,-3))}return e}_evalTemplate(t,e){try{return new Function("states","entity","user","hass","html","'use strict'; "+e).call(this,this.hass.states,t,this.hass.user,this.hass,F)}catch(t){if(t instanceof Error){const i=e.length<=100?e.trim():e.trim().substring(0,98)+"...";throw t.message=`${t.name}: ${t.message} in '${i}'`,t.name="MyCardJSTemplateError",t}console.log("Unexpected error (_evalTemplate)",t)}}static get styles(){return ct` - `}};r([st()],de.prototype,"_config",void 0),r([st({attribute:!1})],de.prototype,"hass",void 0),r([ot()],de.prototype,"config",void 0),de=r([et("my-slider-v2")],de);const ue="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;class pe extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:ue?"100px":"50px",height:ue?"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)},s=i=>{i.preventDefault(),["touchend","touchcancel"].includes(i.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?Dt(t,"action",{action:"hold"}):e.hasDoubleClick?"click"===i.type&&i.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout(()=>{this.dblClickTimeout=void 0,Dt(t,"action",{action:"tap"})},250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,Dt(t,"action",{action:"double_tap"})):Dt(t,"action",{action:"tap"}))};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",s),t.addEventListener("touchcancel",s),t.addEventListener("mousedown",i,{passive:!0}),t.addEventListener("click",s),t.addEventListener("keyup",t=>{13===t.keyCode&&s(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-my-footer",pe);const me=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("action-handler-my-footer"))return t.querySelector("action-handler-my-footer");const e=document.createElement("action-handler-my-footer");return t.appendChild(e),e})();i&&i.bind(t,e)},ge=w((t={})=>e=>{me(e.committer.element,t)}),fe=(t,e={})=>{switch(t){case"card":return ve(e);case"icon":return ye(e);case"label-wrapper":return _e(e);case"label":return be(e);case"container":return we(e);case"container-column":return $e(e);case"row1":return Se(e);case"row2":return xe(e);case"row3":return Ce(e);case"column1":return Te(e);case"column2":return ke(e);default:return void console.log("Getting default styles")}},ve=t=>Object.assign({height:"125px",width:"100%","min-width":"fit-content",background:"var(--card-background-color)"},t),ye=t=>Object.assign({"--mdc-icon-size":"100%",height:"35px",width:"35px",display:"inline-block",padding:"10px 10px 10px 10px",cursor:"pointer",color:"var(--paper-item-active-icon-color)"},t),_e=t=>Object.assign({width:"100%",height:"100%",display:"flex"},t),be=t=>Object.assign({padding:"0",margin:"0 10px",color:"var(--primary-text-color)","font-weight":"bold"},t),we=t=>Object.assign({padding:"0",margin:"0",display:"flex","flex-flow":"column",height:"100%"},t),Se=t=>Object.assign({flex:"0 1 auto"},t),xe=t=>Object.assign({flex:"1 1 auto"},t),Ce=t=>Object.assign({flex:"0 1 auto",margin:"0 2px 2px 2px"},t),$e=t=>Object.assign({padding:"0",margin:"0",display:"flex","flex-flow":"row",height:"100%"},t),Te=t=>Object.assign({flex:"1"},t),ke=t=>Object.assign({flex:"0",padding:"3px 3px 3px 0"},t);console.info(`%c ---- MY-BUTTON ---- \n%c ${o("common.version")} 1.0.0 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: green"),window.customCards=window.customCards||[],window.customCards.push({type:"my-button",name:"My Button Card",description:"Custom Button Card for Lovelace."});let Me=class extends dt{constructor(){super(...arguments),this.lastAction=0,this.layout="vertical",this.iconConfig={},this.labelConfig={},this.sliderConfig={},this.cardStl={},this.containerStl={},this.containerColumnStl={},this.iconStl={},this.labelWrapperStl={},this.labelStl={},this.row1Stl={},this.row2Stl={},this.row3Stl={},this.column1Stl={},this.column2Stl={}}static getStubConfig(){return{}}static get properties(){return{hass:{},config:{},active:{}}}setConfig(t){const e=["light","cover"];if(!t.entity)throw new Error("You need to define entity");if(!e.includes(t.entity.split(".")[0]))throw new Error("Entity has to be one of the following: "+e.map(t=>" "+t));this.config=Object.assign({name:"MyButton"},t)}shouldUpdate(t){return!!this.config&&Yt(this,t,!1)}render(){const t=this.initializeConfig();return null!==t?t:this.entity&&this._config?"vertical"===this.layout?this.verticalLayoutCard():this.horizontalLayoutCard():F``}verticalLayoutCard(){var t,e,i,s,n,o,r,a;return F` - -
-
this._handleAction(t,this.config)} - .actionHandler=${ge({hasDoubleClick:"none"!==(null===(e=null===(t=this.config)||void 0===t?void 0:t.double_tap_action)||void 0===e?void 0:e.action),hasHold:"none"!==(null===(s=null===(i=this.config)||void 0===i?void 0:i.hold_action)||void 0===s?void 0:s.action)})}> - ${this.iconElement()} + `}initializeConfig(){var t;if(this.actionTaken)return null;this.entity=this.hass.states[""+this.config.entity];try{this._config=le(this,this.entity,this.config)}catch(t){if(t instanceof Error){t.stack?console.error(t.stack):console.error(t);const e=document.createElement("hui-error-card");return e.setConfig({type:"error",error:t.toString(),origConfig:this.config}),e}console.log("Unexpected error evaluating config on init:",t)}if(!this._config)return q`Error with evaluated _config`;const e=this._config.entity?null===(t=this._config.entity)||void 0===t?void 0:t.split(".")[0]:this._config.entity?this._config.entity.split(".")[0]:"none",i={sliderId:`slider-${this._config.entity.replace(".","-")}-${this._config.mode}`,type:this._config.type,disableScroll:void 0===this._config.disableScroll||this._config.disableScroll,allowTapping:void 0===this._config.allowTapping||this._config.allowTapping,allowSliding:void 0!==this._config.allowSliding&&this._config.allowSliding,marginOfError:void 0!==this._config.marginOfError?this._config.marginOfError:10,slideDistance:void 0!==this._config.slideDistance?this._config.slideDistance:10,showMin:void 0!==this._config.showMin&&this._config.showMin,minThreshold:0,maxThreshold:100,sliderMin:this._config.sliderMin?this._config.sliderMin:0,vertical:void 0!==this._config.vertical&&this._config.vertical,flipped:void 0!==this._config.flipped&&this._config.flipped,inverse:void 0!==this._config.inverse&&this._config.inverse,intermediate:void 0!==this._config.intermediate&&this._config.intermediate,min:this._config.min?this._config.min:0,max:this._config.max?this._config.max:100,step:this._config.step?this._config.step:1,mode:void 0!==this._config.mode?this._config.mode:void 0!==this._config.colorMode?this._config.colorMode:void 0!==this._config.coverMode?this._config.coverMode:"light"===e?"brightness":"cover"===e?"position":"media_player"===e?"volume":"brightness"};let n=0,s=0,o=0;switch(e){case"light":if("brightness"===i.mode)this.oldVal=Math.ceil(ie(this.entity.attributes.brightness,256)),"on"===this.entity.state&&(n=Math.ceil(ie(this.entity.attributes.brightness,256)),!i.showMin&&i.min&&(n-=i.min)),n=n*(100-i.sliderMin)/100+i.sliderMin,n=nthis.updateSeekbar(),500);if("playing"!==this.entity.state)return;let t=0;this._config.max=this.entity.attributes.media_duration;const e=new Date,i=new Date(this.entity.attributes.media_position_updated_at);let n=this.entity.attributes.media_position+(e.getTime()-i.getTime())/1e3;n=Math.min(n,this._config.max),t=n,this.setSliderValues(t,ne(ie(t,this._config.max))),this.setProgress(this.sliderEl,Math.round(t),"updateSeekbar"),setTimeout(()=>this.updateSeekbar(),1e3)}calcProgress(t){if(void 0===this.sliderEl||null===this.sliderEl)return;const e=((t,e)=>{let i={x:0,y:0};if("touchstart"==t.type||"touchmove"==t.type||"touchend"==t.type||"touchcancel"==t.type){let e=void 0===t.originalEvent?t:t.originalEvent,n=e.touches[0]||e.changedTouches[0];i.x=n.clientX,i.y=n.clientY}else"mousedown"!=t.type&&"mouseup"!=t.type&&"mousemove"!=t.type&&"mouseover"!=t.type&&"mouseout"!=t.type&&"mouseenter"!=t.type&&"mouseleave"!=t.type||(i.x=t.clientX,i.y=t.clientY);let n=e.getBoundingClientRect(),s=i.x-n.left,o=i.y-n.top;return o=e.offsetHeight-o,{x:s,y:o}})(t,this.sliderEl),i=this.sliderEl.offsetWidth,n=this.sliderEl.offsetHeight,s=(this._config.vertical?ne(e.y/n*100):ne(e.x/i*100))/100*(this._config.max-0),o=this._config.max-s;let r=this._config.flipped?o:s;r=rthis._config.max?this._config.max:r{o.style.transition=this.initialTransition},200)}_setLock(t,e){var i=Math.min(this._config.max,this._config.maxThreshold);if(Number(i)<=e){var n="locked"===t.state?"unlock":"lock";this.hass.callService("lock",n,{entity_id:t.entity_id})}const s=Number(Math.max(this.zero,this._config.minThreshold)),o=ne(ie(s,this._config.max)),r=this.sliderEl.querySelector(".my-slider-custom-progress");this._config.vertical?r.style.transition="height 0.2s ease 0s":r.style.transition="width 0.2s ease 0s",this.setSliderValues(s,o),this.setProgress(this.sliderEl,s,"setLock"),setTimeout(()=>{r.style.transition=this.initialTransition},200)}createAndCleanupEventListeners(t){document.removeEventListener("mouseup",t),document.removeEventListener("touchend",t),document.removeEventListener("touchcancel",t),document.addEventListener("mouseup",t),document.addEventListener("touchend",t),document.addEventListener("touchcancel",t),document.addEventListener("mousemove",t)}static get styles(){return ht` + `}};l([ot()],he.prototype,"_config",void 0),l([ot({attribute:!1})],he.prototype,"hass",void 0),l([at()],he.prototype,"config",void 0),he=l([nt("my-slider-v2")],he);const ue=(t,e,i,n)=>{n=n||{},i=null==i?{}:i;const s=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return s.detail=i,t.dispatchEvent(s),s},ge=1,pe=2,me=3,fe=4,_e=5; +/** + * @license + * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */class ve{constructor(t){this.type=pe,this.options=t.options,this.legacyPart=t}get parentNode(){return this.legacyPart.startNode.parentNode}get startNode(){return this.legacyPart.startNode}get endNode(){return this.legacyPart.endNode}}class ye{constructor(t){this.legacyPart=t,this.type=t instanceof j?me:ge}get options(){}get name(){return this.legacyPart.committer.name}get element(){return this.legacyPart.committer.element}get strings(){return this.legacyPart.committer.strings}get tagName(){return this.element.tagName}}class be{constructor(t){this.type=fe,this.legacyPart=t}get options(){}get name(){return this.legacyPart.name}get element(){return this.legacyPart.element}get strings(){return this.legacyPart.strings}get tagName(){return this.element.tagName}}class we{constructor(t){this.type=_e,this.legacyPart=t}get options(){}get name(){return this.legacyPart.eventName}get element(){return this.legacyPart.element}get strings(){}get tagName(){return this.element.tagName}handleEvent(t){this.legacyPart.handleEvent(t)}}const xe="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;class Se extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.cancelled=!1,this.isRepeating=!1,this.repeatCount=0}connectedCallback(){Object.assign(this.style,{position:"fixed",width:xe?"100px":"50px",height:xe?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach(t=>{document.addEventListener(t,()=>{this.cancelled=!0,this.timer&&(this.stopAnimation(),clearTimeout(this.timer),this.timer=void 0,this.isRepeating&&this.repeatTimeout&&(clearInterval(this.repeatTimeout),this.isRepeating=!1))},{passive:!0})})}bind(t,e){t.actionHandler&&ae(e,t.actionHandler.options)||(t.actionHandler?(t.removeEventListener("touchstart",t.actionHandler.start),t.removeEventListener("touchend",t.actionHandler.end),t.removeEventListener("touchcancel",t.actionHandler.end),t.removeEventListener("mousedown",t.actionHandler.start),t.removeEventListener("click",t.actionHandler.end),t.removeEventListener("keyup",t.actionHandler.handleEnter)):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}),t.actionHandler={options:e},e.disabled||(t.actionHandler.start=i=>{let n,s;this.cancelled=!1,i.touches?(n=i.touches[0].clientX,s=i.touches[0].clientY):(n=i.clientX,s=i.clientY),e.hasHold&&(this.held=!1,this.timer=window.setTimeout(()=>{this.startAnimation(n,s),this.held=!0,e.repeat&&!this.isRepeating&&(this.repeatCount=0,this.isRepeating=!0,this.repeatTimeout=setInterval(()=>{ue(t,"action",{action:"hold"}),this.repeatCount++,this.repeatTimeout&&e.repeatLimit&&this.repeatCount>=e.repeatLimit&&(clearInterval(this.repeatTimeout),this.isRepeating=!1)},e.repeat))},this.holdTime))},t.actionHandler.end=t=>{if(["touchend","touchcancel"].includes(t.type)&&this.cancelled)return void(this.isRepeating&&this.repeatTimeout&&(clearInterval(this.repeatTimeout),this.isRepeating=!1));const i=t.target;t.cancelable&&t.preventDefault(),e.hasHold&&(clearTimeout(this.timer),this.isRepeating&&this.repeatTimeout&&clearInterval(this.repeatTimeout),this.isRepeating=!1,this.stopAnimation(),this.timer=void 0),e.hasHold&&this.held?e.repeat||ue(i,"action",{action:"hold"}):e.hasDoubleClick?"click"===t.type&&t.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout(()=>{this.dblClickTimeout=void 0,ue(i,"action",{action:"tap"})},250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,ue(i,"action",{action:"double_tap"})):ue(i,"action",{action:"tap"})},t.actionHandler.handleEnter=t=>{13===t.keyCode&&t.currentTarget.actionHandler.end(t)},t.addEventListener("touchstart",t.actionHandler.start,{passive:!0}),t.addEventListener("touchend",t.actionHandler.end),t.addEventListener("touchcancel",t.actionHandler.end),t.addEventListener("mousedown",t.actionHandler.start,{passive:!0}),t.addEventListener("click",t.actionHandler.end),t.addEventListener("keyup",t.actionHandler.handleEnter)))}startAnimation(t,e){Object.assign(this.style,{left:t+"px",top:e+"px",display:null})}stopAnimation(){}}customElements.define("my-card-action-handler",Se);const ke=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("my-card-action-handler"))return t.querySelector("my-card-action-handler");const e=document.createElement("my-card-action-handler");return t.appendChild(e),e})();i&&i.bind(t,e)},$e=function(t){const e=new WeakMap;return S((...i)=>n=>{const s=e.get(n);let o,r;void 0===s?(o=function(t){if(t instanceof H)return new ve(t);if(t instanceof Y)return new we(t);if(t instanceof L)return new be(t);if(t instanceof j||t instanceof A)return new ye(t);throw new Error("Unknown part type")}(n),r=new t(o),e.set(n,[o,r])):(o=s[0],r=s[1]),n.setValue(r.update(o,i)),n.commit()})}(class extends class{constructor(t){}update(t,e){return this.render(...e)}}{update(t,[e]){return ke(t.element,e),$}render(t){}}),Te=(t,e={})=>{const i=Me[t];return i?se(i,e):(console.log(t+": Not found in styles"),e)},Me={card:{height:"125px",width:"100%",background:"var(--card-background-color)",overflow:"hidden",cursor:"pointer",display:"flex","flex-direction":"column"},icon:{"--mdc-icon-size":"100%",height:"35px",width:"35px",display:"inline-block",color:"var(--paper-item-icon-color)","border-radius":"50%",margin:"7px 0px 0px 7px"},stats:{margin:"5px 2px 0px auto",color:"var(--primary-text-color)",display:"inline-block","font-family":'"Arial", sans-serif',"font-size":"11px","text-align":"center","text-shadow":"2px 2px 4px rgba(0, 0, 0, .9)",width:"50px",height:"50px",padding:"0px 3px"},camera:{"border-radius":"3px",overflow:"hidden"},labelContainer:{width:"100%",height:"100%",display:"flex","flex-direction":"column","align-items":"flex-start",overflow:"hidden"},label:{padding:"0",margin:"0 10px",color:"var(--primary-text-color)","font-weight":"bold",cursor:"pointer"},extraText:{margin:"0 10px",color:"var(--primary-text-color)","font-weight":"normal","font-size":"12px","white-space":"nowrap",overflow:"hidden"},row1:{display:"flex","justify-content":"space-between","min-height":"55px"},row2:{},buttonsContainer:{display:"flex","align-items":"flex-start","flex-direction":"row",padding:"0px 5px"},button:{padding:"3px 5px 3px 5px","aspect-ratio":"1 / 1",display:"flex","align-items":"center","justify-content":"center"},buttonText:{padding:"0px",margin:"0px"},buttonIcon:{padding:"0px",margin:"0px",position:"relative","--mdc-icon-size":"100%",display:"flex",height:"20px",width:"20px"},sliderCard:{"border-radius":"0px",background:"transparent","box-shadow":"none",cursor:"default"},sliderContainer:{"border-radius":"0px"},sliderTrack:{background:"transparent"},sliderThumbHor:{height:"20px",width:"3px",top:"6px",right:"2px","border-radius":"50px"},sliderThumbVer:{width:"20px",height:"3px",top:"2px",left:"7px","border-radius":"50px"},sliderProgressHor:{background:"linear-gradient(to top, var(--paper-item-icon-active-color), transparent)"},sliderProgressVer:{background:"linear-gradient(to left, var(--paper-item-icon-active-color), transparent)"},seekbarCard:{"border-radius":"0px",background:"transparent","box-shadow":"none",cursor:"default","margin-left":"30px"},seekbarContainer:{"border-radius":"0px"},seekbarTrack:{background:"transparent"},seekbarThumb:{height:"100%",width:"3px",right:"0px","border-radius":"50px",background:"linear-gradient(to top, var(--paper-item-icon-active-color) -20%, transparent 70%)"},seekbarProgress:{background:"transparent"}};console.info(`%c ---- MY-BUTTON ---- \n%c ${a("common.version")} 1.0.2 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: green"),window.customCards=window.customCards||[],window.customCards.push({type:"my-button",name:"My Button Card",description:"Custom Button Card for Lovelace."});let Ce=class extends gt{constructor(){super(...arguments),this.lastAction=0}static getStubConfig(){return{}}static get properties(){return{hass:{},config:{},active:{}}}setConfig(t){const e=["","light","cover","switch","input_boolean","button","lock","media_player"];if(t.entity&&!e.includes(t.entity.split(".")[0]))throw new Error("Entity has to be one of the following: "+e.map(t=>" "+t));this.config=Object.assign({name:"MyButton"},t)}shouldUpdate(t){return!!this.config&&Lt(this,t,!1)}updated(t){super.updated(t),requestAnimationFrame(()=>{var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('[data-container="label-row"]'),i=null==e?void 0:e.querySelector("p");if(e&&i){const t=window.getComputedStyle(i),n=window.getComputedStyle(e),s=e.offsetWidth,o=i.offsetWidth+parseFloat(t.marginLeft)+parseFloat(t.marginRight),r=s-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight);i.style.animation=o +
+
this._handleAction(t,this._config)} + .actionHandler=${$e({hasDoubleClick:"none"!==(null===(e=null===(t=this._config)||void 0===t?void 0:t.double_tap_action)||void 0===e?void 0:e.action),hasHold:"none"!==(null===(n=null===(i=this._config)||void 0===i?void 0:i.hold_action)||void 0===n?void 0:n.action),repeat:null===(o=null===(s=this._config)||void 0===s?void 0:s.hold_action)||void 0===o?void 0:o.repeat,repeatLimit:null===(a=null===(r=this._config)||void 0===r?void 0:r.hold_action)||void 0===a?void 0:a.repeat_limit})}> +
+ ${this.iconElement()} + ${this.statsElement()} +
+
+ ${this.labelElement()} +
+
-
this._handleAction(t,this.config)} - .actionHandler=${ge({hasDoubleClick:"none"!==(null===(o=null===(n=this.config)||void 0===n?void 0:n.double_tap_action)||void 0===o?void 0:o.action),hasHold:"none"!==(null===(a=null===(r=this.config)||void 0===r?void 0:r.hold_action)||void 0===a?void 0:a.action)})}> - ${this.labelElement()} +
+ ${!1===this._config.buttons.vertical?this.buttonsElement():""}
-
- ${this.sliderElement()} +
+ ${!1===this._config.slider.vertical?this.sliderElement():""} + ${this._config.seekbar.show?this.seekbarElement():""} +
+
+ ${!0===this._config.buttons.vertical?this.buttonsElement():""} +
+
+ ${!0===this._config.slider.vertical?this.sliderElement():""}
- `}horizontalLayoutCard(){var t,e,i,s,n,o,r,a;return F` - -
-
-
-
this._handleAction(t,this.config)} - .actionHandler=${ge({hasDoubleClick:"none"!==(null===(e=null===(t=this.config)||void 0===t?void 0:t.double_tap_action)||void 0===e?void 0:e.action),hasHold:"none"!==(null===(s=null===(i=this.config)||void 0===i?void 0:i.hold_action)||void 0===s?void 0:s.action)})}> - ${this.iconElement()} -
-
this._handleAction(t,this.config)} - .actionHandler=${ge({hasDoubleClick:"none"!==(null===(o=null===(n=this.config)||void 0===n?void 0:n.double_tap_action)||void 0===o?void 0:o.action),hasHold:"none"!==(null===(a=null===(r=this.config)||void 0===r?void 0:r.hold_action)||void 0===a?void 0:a.action)})}> - ${this.labelElement()} -
-
-
+ `}iconElement(){var t,e,i,n;return this._config.icon.show?this._config.icon.tap_action||this._config.icon.double_tap_action||this._config.icon.hold_action?q` + this._handleAction(t,this._config.icon)} + .actionHandler=${$e({hasDoubleClick:"none"!==(null===(t=this._config.icon.double_tap_action)||void 0===t?void 0:t.action),hasHold:"none"!==(null===(e=this._config.icon.hold_action)||void 0===e?void 0:e.action),repeat:null===(i=this._config.icon.hold_action)||void 0===i?void 0:i.repeat,repeatLimit:null===(n=this._config.icon.hold_action)||void 0===n?void 0:n.repeat_limit})} /> + `:q` + + `:q``}statsElement(){var t,e,i,n,s,o,r,a;return this._config.stats.show?this._config.stats.tap_action||this._config.stats.double_tap_action||this._config.stats.hold_action?this._config.camera?q` +
this._handleAction(t,this._config.stats)} + .actionHandler=${$e({hasDoubleClick:"none"!==(null===(t=this._config.stats.double_tap_action)||void 0===t?void 0:t.action),hasHold:"none"!==(null===(e=this._config.stats.hold_action)||void 0===e?void 0:e.action),repeat:null===(i=this._config.stats.hold_action)||void 0===i?void 0:i.repeat,repeatLimit:null===(n=this._config.stats.hold_action)||void 0===n?void 0:n.repeat_limit})}> +
+ + ${this._config.stats.text}
-
- ${this.sliderElement()} + `:q` +
this._handleAction(t,this._config.stats)} + .actionHandler=${$e({hasDoubleClick:"none"!==(null===(s=this._config.stats.double_tap_action)||void 0===s?void 0:s.action),hasHold:"none"!==(null===(o=this._config.stats.hold_action)||void 0===o?void 0:o.action),repeat:null===(r=this._config.stats.hold_action)||void 0===r?void 0:r.repeat,repeatLimit:null===(a=this._config.stats.hold_action)||void 0===a?void 0:a.repeat_limit})}> + +
+ ${this._config.stats.text} +
+
+ `:this._config.camera?q` +
+
+ +
+
+ `:q` +
+
+ ${this._config.stats.text} +
+
+ `:q``}labelElement(){var t,e,i,n;return this._config.label.show?this._config.label.tap_action||this._config.label.double_tap_action||this._config.label.hold_action?q` +
+ + ${this._config.label.extra?q`

${this._config.label.extra}

`:""} +
- - `}iconElement(){var t,e;return this.iconConfig.show?this.iconConfig.tap_action||this.iconConfig.double_tap_action||this.iconConfig.hold_action?F` - this._handleAction(t,this.iconConfig)} - .actionHandler=${ge({hasDoubleClick:"none"!==(null===(t=this.iconConfig.double_tap_action)||void 0===t?void 0:t.action),hasHold:"none"!==(null===(e=this.iconConfig.hold_action)||void 0===e?void 0:e.action)})} /> - `:F` - - `:F``}labelElement(){var t,e;return this.labelConfig.show?this.labelConfig.tap_action||this.labelConfig.double_tap_action||this.labelConfig.hold_action?F` -
- -
- `:F` -
- + `:q` +
+ + ${this._config.label.extra?q`

${this._config.label.extra}

`:""}
- `:F``}sliderElement(){return this.sliderConfig.show?("horizontal"===this.layout&&(this.sliderConfig.vertical=void 0===this.sliderConfig.vertical||this.sliderConfig.vertical,this.sliderConfig.styles=this.sliderConfig.styles?this.sliderConfig.styles:{},this.sliderConfig.styles.card=this.sliderConfig.styles.card?this.sliderConfig.styles.card:{},this.sliderConfig.styles.card.width=this.sliderConfig.styles.card.width?this.sliderConfig.styles.card.width:"35px"),F` - - `):F``}initializeConfig(){var t,e,i,s,n,o,r,a,l,c,h,d,u,p,m,g,f,v,y,_,b,w,S;this.entity=this.hass.states[""+this.config.entity],0===this.lastAction&&(this.lastAction=(new Date).getTime());try{this._config=this._objectEvalTemplate(this.entity,this.config)}catch(t){if(t instanceof Error){t.stack?console.error(t.stack):console.error(t);const e=document.createElement("hui-error-card");return e.setConfig({type:"error",error:t.toString(),origConfig:this.config}),e}console.log("Unexpected error evaluating config on init:",t)}if(!this._config)return F`Error with this._config...`;const x={show:!0,icon:"mdi:lightbulb-outline"};"cover"===this._config.entity.split(".")[0]&&(x.icon=(null===(t=this.entity.attributes)||void 0===t?void 0:t.current_position)>=50?"mdi:blinds-open":"mdi:blinds");const C={show:!0,text:this.entity.attributes.friendly_name},$={show:!0,entity:this.entity.entity_id};this.layout=this._config.layout?this._config.layout:"vertical","cover"===this._config.entity.split(".")[0]&&(this.layout=this._config.layout?this._config.layout:"horizontal"),this.iconConfig="string"==typeof this._config.icon?Object.assign(Object.assign({},x),{icon:this._config.icon}):"object"==typeof this._config.icon?Object.assign(Object.assign({},x),this._config.icon):x,this.labelConfig="string"==typeof this._config.label?Object.assign(Object.assign({},C),{text:this._config.label}):"object"==typeof this._config.label?Object.assign(Object.assign({},C),this._config.label):C,this.sliderConfig=this._config.slider?Object.assign(Object.assign({},$),this._config.slider):$;const T=le(null===(e=this._config.styles)||void 0===e?void 0:e.card)?le(null===(i=this._config.styles)||void 0===i?void 0:i.card):{},k=le(null===(s=this._config.styles)||void 0===s?void 0:s.container)?le(null===(n=this._config.styles)||void 0===n?void 0:n.container):{},M=le(null===(o=this._config.styles)||void 0===o?void 0:o.containerColumn)?le(null===(r=this._config.styles)||void 0===r?void 0:r.containerColumn):{},E=le(null===(a=this._config.styles)||void 0===a?void 0:a.icon)?le(null===(l=this._config.styles)||void 0===l?void 0:l.icon):{},P=le(null===(c=this._config.styles)||void 0===c?void 0:c.labelWrapper)?le(null===(h=this._config.styles)||void 0===h?void 0:h.labelWrapper):{},N=le(null===(d=this._config.styles)||void 0===d?void 0:d.label)?le(null===(u=this._config.styles)||void 0===u?void 0:u.label):{},O=le(null===(p=this._config.styles)||void 0===p?void 0:p.row1)?le(null===(m=this._config.styles)||void 0===m?void 0:m.row1):{},V=le(null===(g=this._config.styles)||void 0===g?void 0:g.row2)?le(null===(f=this._config.styles)||void 0===f?void 0:f.row2):{},A=le(null===(v=this._config.styles)||void 0===v?void 0:v.row3)?le(null===(y=this._config.styles)||void 0===y?void 0:y.row3):{},j=le(null===(_=this._config.styles)||void 0===_?void 0:_.column1)?le(null===(b=this._config.styles)||void 0===b?void 0:b.column1):{},D=le(null===(w=this._config.styles)||void 0===w?void 0:w.column2)?le(null===(S=this._config.styles)||void 0===S?void 0:S.column2):{};return this.cardStl=fe("card",T),this.containerStl=fe("container",k),this.containerColumnStl=fe("container-column",M),this.iconStl=fe("icon",E),this.labelWrapperStl=fe("label-wrapper",P),this.labelStl=fe("label",N),this.row1Stl=fe("row1",O),this.row2Stl=fe("row2",V),this.row3Stl=fe("row3",A),this.column1Stl=fe("column1",j),this.column2Stl=fe("column2",D),null}_handleAction(t,e){var i;t.stopPropagation(),t.stopImmediatePropagation();if(!((new Date).getTime()-this.lastAction<100)&&(this.lastAction=(new Date).getTime(),e.entity||(e.entity=this._config.entity),null===(i=t.detail)||void 0===i?void 0:i.action))switch(t.detail.action){case"tap":e.tap_action&&this._handleTap(e);break;case"hold":e.hold_action&&this._handleHold(e);break;case"double_tap":e.double_tap_action&&this._handleDblTap(e)}}_handleTap(t){Lt(this,this.hass,this._evalActions(this._config,"tap_action"),!1,!1)}_handleHold(t){Lt(this,this.hass,this._evalActions(this._config,"hold_action"),!0,!1)}_handleDblTap(t){Lt(this,this.hass,this._evalActions(this._config,"double_tap_action"),!1,!0)}_evalActions(t,e){const i=JSON.parse(JSON.stringify(t)),s=t=>t?(Object.keys(t).forEach(e=>{"object"==typeof t[e]?t[e]=s(t[e]):t[e]=this._getTemplateOrValue(this.entity,t[e])}),t):t;return i[e]=s(i[e]),!i[e].confirmation&&i.confirmation&&(i[e].confirmation=s(i.confirmation)),i}_objectEvalTemplate(t,e){const i=JSON.parse(JSON.stringify(e));return this._getTemplateOrValue(t,i)}_getTemplateOrValue(t,e){if(["number","boolean"].includes(typeof e))return e;if(!e)return e;if("object"==typeof e)return Object.keys(e).forEach(i=>{e[i]=this._getTemplateOrValue(t,e[i])}),e;const i=e.trim();if("[[["===i.substring(0,3)&&"]]]"===i.slice(-3)){return this._evalTemplate(t,i.slice(3,-3))}return e}_evalTemplate(t,e){try{return new Function("states","entity","user","hass","html","'use strict'; "+e).call(this,this.hass.states,t,this.hass.user,this.hass,F)}catch(t){if(t instanceof Error){const i=e.length<=100?e.trim():e.trim().substring(0,98)+"...";throw t.message=`${t.name}: ${t.message} in '${i}'`,t.name="MyCardJSTemplateError",t}console.log("Unexpected error (_evalTemplate)",t)}}static get styles(){return ct``}};r([st()],Me.prototype,"_config",void 0),r([st({attribute:!1})],Me.prototype,"hass",void 0),r([ot()],Me.prototype,"config",void 0),Me=r([et("my-button")],Me),console.info(`%c ---- MY-CARDS ---- \n%c ${o("common.version")} 2.0.1 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: green");export{Me as MyButton,Qt as MySlider,de as MySliderV2}; + `:q``}sliderElement(){return this._config.slider.show?q` + + `:q``}buttonsElement(){if(!this._config.buttons.show)return q``;let t=Object.keys(this._config.buttons).filter(t=>t.startsWith("button")).map(t=>{var e,i,n,s;return this._config.buttons[t].show?this._config.buttons[t].tap_action||this._config.buttons[t].double_tap_action||this._config.buttons[t].hold_action?q` +
this._handleAction(e,this._config.buttons[t])} + .actionHandler=${$e({hasDoubleClick:"none"!==(null===(e=this._config.buttons[t].double_tap_action)||void 0===e?void 0:e.action),hasHold:"none"!==(null===(i=this._config.buttons[t].hold_action)||void 0===i?void 0:i.action),repeat:null===(n=this._config.buttons[t].hold_action)||void 0===n?void 0:n.repeat,repeatLimit:null===(s=this._config.buttons[t].hold_action)||void 0===s?void 0:s.repeat_limit})}> + ${this._config.buttons[t].text?q`

${this._config.buttons[t].text}

`:""} + ${this._config.buttons[t].icon?q``:""} +
`:q` +
+ ${this._config.buttons[t].text?q`

${this._config.buttons[t].text}

`:""} + ${this._config.buttons[t].icon?q``:""} +
`:q``});return q` +
+ ${t} + +
+ `}seekbarElement(){return this._config.slider.show?q` + + `:q``}initializeConfig(){var t,e;this.entity=this.hass.states[""+this.config.entity],0===this.lastAction&&(this.lastAction=(new Date).getTime());try{this._config=le(this,this.entity,this.config)}catch(t){if(t instanceof Error){t.stack?console.error(t.stack):console.error(t);const e=document.createElement("hui-error-card");return e.setConfig({type:"error",error:t.toString(),origConfig:this.config}),e}console.log("Unexpected error evaluating config on init:",t)}if(!this._config)return q`Error with this._config...`;const i=this._config.entity?null===(t=this._config.entity)||void 0===t?void 0:t.split(".")[0]:"none",n={},s={show:!0,icon:"mdi:power"},o={show:!0},r={show:!1},a={show:!1,vertical:!0,styles:{}},l={show:!0,vertical:!1,entity:this._config.entity,allowTapping:!1,marginOfError:10},c={show:!1,entity:this._config.entity};if("none"!==i){const t="cover"===i,d="cover"===i,h=this.entity.state;o.text=this.entity.attributes.friendly_name,r.text=h.charAt(0).toUpperCase()+h.slice(1),l.entity=this.entity.entity_id,l.vertical=t,l.flipped=d,"light"===i?(n.tap_action={action:"toggle"},n.hold_action={action:"more-info"},this.entity.attributes.brightness&&(n.hold_action={action:"more-info"},r.text=Math.ceil(ie(this.entity.attributes.brightness,256))+"%"),r.show=!0,l.allowSliding=!0,l.slideDistance=15):"cover"===i?(n.hold_action={action:"more-info"},s.icon=(null===(e=this.entity.attributes)||void 0===e?void 0:e.current_position)>=50?"mdi:blinds-open":"mdi:blinds"):"switch"===i||"input_boolean"===i?(n.tap_action={action:"toggle"},n.hold_action={action:"more-info"},r.show=!0,l.show=!1,s.icon="on"===this.entity.state?"mdi:power-plug":"mdi:power-plug-off"):"button"===i?(n.tap_action={action:"call-service",service:"button.press",service_data:{entity_id:this.entity.entity_id}},n.hold_action={action:"more-info"},l.show=!1):"lock"===i?(n.hold_action={action:"more-info"},l.show=!1,r.show=!0,this._config.camera&&"string"==typeof this._config.camera&&(this._config.camera=this.hass.states[this._config.camera],r.entity=this._config.camera.entity_id,r.tap_action={action:"more-info"}),"locked"===this.entity.state?(s.icon="mdi:lock-outline",n.tap_action={action:"call-service",service:"lock.unlock",service_data:{entity_id:this.entity.entity_id}}):"unlocked"===this.entity.state&&(s.icon="mdi:lock-open-variant-outline",n.tap_action={action:"call-service",service:"lock.lock",service_data:{entity_id:this.entity.entity_id}})):"media_player"===i&&(n.tap_action={action:"more-info"},"speaker"===this.entity.attributes.device_class?(s.icon=re(this.entity,this.entity.state)?"mdi:speaker":"mdi:speaker-off","playing"===this.entity.state?s.icon="mdi:speaker-play":"paused"===this.entity.state&&(s.icon="mdi:speaker-pause")):"tv"===this.entity.attributes.device_class&&(s.icon=re(this.entity,this.entity.state)?"mdi:television":"mdi:television-off","playing"===this.entity.state?s.icon="mdi:television-play":"paused"===this.entity.state&&(s.icon="mdi:television-pause")),l.show="paused"!==this.entity.state&&re(this.entity,this.entity.state),l.vertical=!0,l.sliderMin=5,l.min=1,l.allowTapping=!1,l.marginOfError=10,c.show=re(this.entity,this.entity.state),c.vertical=!1,c.allowTapping=!1,c.marginOfError=5,c.mode="seekbar",this.entity.attributes.media_title&&(o.extra=this.entity.attributes.media_title+" - "+this.entity.attributes.media_artist),a.vertical=!1,a.show=!0,a.button0={show:!0,icon:"playing"===this.entity.state?"mdi:pause":"mdi:play",styles:{container:{position:"absolute"}},tap_action:{action:"call-service",service:"playing"===this.entity.state?"media_player.media_pause":"media_player.media_play",service_data:{entity_id:this.entity.entity_id}}})}else l.show=!1;const d=se(n,this._config);return this._config=void 0!==d?d:this._config,this._config.icon="string"==typeof this._config.icon?Object.assign(Object.assign({},s),{icon:this._config.icon}):"object"==typeof this._config.icon?se(s,this._config.icon):s,this._config.label="string"==typeof this._config.label?Object.assign(Object.assign({},o),{text:this._config.label}):"object"==typeof this._config.label?se(o,this._config.label):o,this._config.stats="string"==typeof this._config.stats?Object.assign(Object.assign({},r),{text:this._config.stats}):"object"==typeof this._config.stats?se(r,this._config.stats):r,this._config.buttons="object"==typeof this._config.buttons?se(a,this._config.buttons):a,this._config.slider=this._config.slider?se(l,this._config.slider):l,this._config.seekbar=this._config.seekbar?se(c,this._config.seekbar):c,void 0!==this._config.styles&&null!==this._config.styles||(this._config.styles={}),this.initializeStyles(),null}initializeStyles(){var t,e,i,n,s,o,r,a,l,c,d,h,u,g,p,m,f,_,v,y,b,w,x,S,k,$,T,M,C,E,P,N,O,V,A,H,L,D,j,R,Y,I,z,F,U,B,q,W,X,J,Z,G,K,Q,tt,et;if(!this._config)return;const it=this._config.entity?null===(t=this._config.entity)||void 0===t?void 0:t.split(".")[0]:"none",nt={background:"radial-gradient(circle at top left, rgba(230, 230, 230, 0.25), var(--card-background-color) 40%)"},st={filter:"drop-shadow(3px 3px 2px rgba(0,0,0,0.3)"},ot={card:Te("sliderCard",ee(null===(e=this._config.styles)||void 0===e?void 0:e.sliderCard)?ee(null===(i=this._config.styles)||void 0===i?void 0:i.sliderCard):{}),container:Te("sliderContainer",ee(null===(n=this._config.styles)||void 0===n?void 0:n.sliderContainer)?ee(null===(s=this._config.styles)||void 0===s?void 0:s.sliderContainer):{}),track:Te("sliderTrack",ee(null===(o=this._config.styles)||void 0===o?void 0:o.sliderTrack)?ee(null===(r=this._config.styles)||void 0===r?void 0:r.sliderTrack):{}),progress:this._config.slider.vertical?Te("sliderProgressVer",ee(null===(a=this._config.styles)||void 0===a?void 0:a.sliderProgressVer)?ee(null===(l=this._config.styles)||void 0===l?void 0:l.sliderProgressVer):{}):Te("sliderProgressHor",ee(null===(c=this._config.styles)||void 0===c?void 0:c.sliderProgressHor)?ee(null===(d=this._config.styles)||void 0===d?void 0:d.sliderProgressHor):{}),thumb:this._config.slider.vertical?Te("sliderThumbVer",ee(null===(h=this._config.styles)||void 0===h?void 0:h.sliderThumbVer)?ee(null===(u=this._config.styles)||void 0===u?void 0:u.sliderThumbVer):{}):Te("sliderThumbHor",ee(null===(g=this._config.styles)||void 0===g?void 0:g.sliderThumbHor)?ee(null===(p=this._config.styles)||void 0===p?void 0:p.sliderThumbHor):{})},rt={container:Te("stats",ee(null===(m=this._config.styles)||void 0===m?void 0:m.stats)?ee(null===(f=this._config.styles)||void 0===f?void 0:f.stats):{}),camera:Te("camera",ee(null===(_=this._config.styles)||void 0===_?void 0:_.camera)?ee(null===(v=this._config.styles)||void 0===v?void 0:v.camera):{})},at={container:Te("labelContainer",ee(null===(y=this._config.styles)||void 0===y?void 0:y.labelContainer)?ee(null===(b=this._config.styles)||void 0===b?void 0:b.labelContainer):{}),label:Te("label",ee(null===(w=this._config.styles)||void 0===w?void 0:w.label)?ee(null===(x=this._config.styles)||void 0===x?void 0:x.label):{}),extraText:Te("extraText",ee(null===(S=this._config.styles)||void 0===S?void 0:S.extraText)?ee(null===(k=this._config.styles)||void 0===k?void 0:k.extraText):{})},lt={container:Te("buttonsContainer",ee(null===($=this._config.styles)||void 0===$?void 0:$.buttonsContainer)?ee(null===(T=this._config.styles)||void 0===T?void 0:T.buttonsContainer):{}),button:Te("button",ee(null===(M=this._config.styles)||void 0===M?void 0:M.button)?ee(null===(C=this._config.styles)||void 0===C?void 0:C.button):{}),text:Te("buttonText",ee(null===(E=this._config.styles)||void 0===E?void 0:E.buttonText)?ee(null===(P=this._config.styles)||void 0===P?void 0:P.buttonText):{}),icon:Te("buttonIcon",ee(null===(N=this._config.styles)||void 0===N?void 0:N.buttonIcon)?ee(null===(O=this._config.styles)||void 0===O?void 0:O.buttonIcon):{})},ct={card:Te("seekbarCard",ee(null===(V=this._config.styles)||void 0===V?void 0:V.seekbarCard)?ee(null===(A=this._config.styles)||void 0===A?void 0:A.seekbarCard):{}),container:Te("seekbarContainer",ee(null===(H=this._config.styles)||void 0===H?void 0:H.seekbarContainer)?ee(null===(L=this._config.styles)||void 0===L?void 0:L.seekbarContainer):{}),track:Te("seekbarTrack",ee(null===(D=this._config.styles)||void 0===D?void 0:D.seekbarTrack)?ee(null===(j=this._config.styles)||void 0===j?void 0:j.seekbarTrack):{}),progress:Te("seekbarProgress",ee(null===(R=this._config.styles)||void 0===R?void 0:R.seekbarProgress)?ee(null===(Y=this._config.styles)||void 0===Y?void 0:Y.seekbarProgress):{}),thumb:Te("seekbarThumb",ee(null===(I=this._config.styles)||void 0===I?void 0:I.seekbarThumb)?ee(null===(z=this._config.styles)||void 0===z?void 0:z.seekbarThumb):{})};if(this._config.slider.vertical&&this._config.slider.flipped&&(ot.thumb.top="initial",ot.thumb.bottom="2px"),this._config.buttons.vertical&&(lt.container["flex-direction"]="column"),"none"!==it)if(re(this.entity,this.entity.state)&&(st.color="var(--paper-item-icon-active-color)",st.filter="drop-shadow(2px 2px 2px rgba(0,0,0,0.75)",nt.background="radial-gradient(circle at top left, rgba(230, 230, 230, 0.7), var(--card-background-color) 40%)"),"light"===it){if(this.entity.attributes.brightness){let t=1+this.entity.attributes.brightness/256;nt.background=`radial-gradient(circle at top left, rgba(230, 230, 230, 0.7), var(--card-background-color) ${Math.ceil(ie(this.entity.attributes.brightness,256))/t+"%"})`}}else"switch"===it||"input_boolean"===it||("lock"===it?"locked"===this.entity.state||"unlocked"===this.entity.state&&(st.color="var(--paper-item-icon-active-color)",nt.background="radial-gradient(circle at top left, rgba(230, 230, 230, 0.7), var(--card-background-color) 40%)"):"media_player"===it||"cover"===it&&(this.entity.attributes.current_position<=50?nt.background="radial-gradient(circle at top left, rgba(230, 230, 230, 0.25), var(--card-background-color) 40%)":st.color="var(--paper-item-icon-color)"));Object.keys(this._config.buttons).filter(t=>t.startsWith("button")).map(t=>(this._config.buttons[t].styles?(this._config.buttons[t].styles.container?this._config.buttons[t].styles.container=se(lt.button,this._config.buttons[t].styles.container?ee(this._config.buttons[t].styles.container):{}):this._config.buttons[t].styles.container=se(lt.button,this._config.buttons.styles.button?ee(this._config.buttons.styles.button):{}),this._config.buttons[t].styles.text?this._config.buttons[t].styles.text=se(lt.text,this._config.buttons[t].styles.text?ee(this._config.buttons[t].styles.text):{}):this._config.buttons[t].styles.text=se(lt.text,this._config.buttons.styles.text?ee(this._config.buttons.styles.text):{}),this._config.buttons[t].styles.icon?this._config.buttons[t].styles.icon=se(lt.text,this._config.buttons[t].styles.text?ee(this._config.buttons[t].styles.text):{}):this._config.buttons[t].styles.icon=se(lt.icon,this._config.buttons.styles.icon?ee(this._config.buttons.styles.icon):{})):this._config.buttons[t].styles={container:se(lt.button,this._config.buttons.styles.button?ee(this._config.buttons.styles.button):{}),text:se(lt.text,this._config.buttons.styles.text?ee(this._config.buttons.styles.text):{}),icon:se(lt.icon,this._config.buttons.styles.icon?ee(this._config.buttons.styles.icon):{})},null));const dt=(null===(F=this._config.styles)||void 0===F?void 0:F.card)?Object.assign(Object.assign({},nt),ee(this._config.styles.card)):nt,ht=(null===(U=this._config.styles)||void 0===U?void 0:U.icon)?Object.assign(Object.assign({},st),ee(this._config.styles.icon)):st;this._config.styles.card=Te("card",ee(dt)),this._config.styles.icon=Te("icon",ee(ht)),this._config.styles.row1=Te("row1",ee(null===(B=this._config.styles)||void 0===B?void 0:B.row1)?ee(null===(q=this._config.styles)||void 0===q?void 0:q.row1):{}),this._config.styles.row2=Te("row2",ee(null===(W=this._config.styles)||void 0===W?void 0:W.row2)?ee(null===(X=this._config.styles)||void 0===X?void 0:X.row2):{}),this._config.styles.button=Te("button",ee(null===(J=this._config.styles)||void 0===J?void 0:J.button)?ee(null===(Z=this._config.styles)||void 0===Z?void 0:Z.button):{}),this._config.slider.styles=(null===(G=this._config.slider)||void 0===G?void 0:G.styles)?se(ot,this._config.slider.styles):ot,this._config.stats.styles=(null===(K=this._config.stats)||void 0===K?void 0:K.styles)?se(rt,this._config.stats.styles):rt,this._config.label.styles=(null===(Q=this._config.label)||void 0===Q?void 0:Q.styles)?se(at,this._config.label.styles):at,this._config.buttons.styles=(null===(tt=this._config.buttons)||void 0===tt?void 0:tt.styles)?se(lt,this._config.buttons.styles):lt,this._config.seekbar.styles=(null===(et=this._config.seekbar)||void 0===et?void 0:et.styles)?se(ct,this._config.seekbar.styles):ct}_handleAction(t,e){var i;t.stopPropagation(),t.stopImmediatePropagation();if(!((new Date).getTime()-this.lastAction<25)&&(this.lastAction=(new Date).getTime(),e.entity||(e.entity=this._config.entity),null===(i=t.detail)||void 0===i?void 0:i.action))switch(t.detail.action){case"tap":case"hold":case"double_tap":if(!e)return;const i=t.detail.action,n=((t,e,i)=>{const n=JSON.parse(JSON.stringify(e)),s=e=>e?(Object.keys(e).forEach(i=>{"object"==typeof e[i]?e[i]=s(e[i]):e[i]=ce(t,t.entity,e[i])}),e):e;return n[i]=s(n[i]),!n[i].confirmation&&n.confirmation&&(n[i].confirmation=s(n.confirmation)),n})(this,e,i+"_action");(async(t,e,i,n)=>{ue(t,"hass-action",{config:i,action:n})})(this,this.hass,n,i)}}static get styles(){return ht` + @keyframes marquee { + 0% { text-indent: 100% } + 100% { text-indent: -100% } + } + `}};l([ot()],Ce.prototype,"_hass",void 0),l([ot()],Ce.prototype,"_config",void 0),l([ot({attribute:!1})],Ce.prototype,"hass",void 0),l([at()],Ce.prototype,"config",void 0),Ce=l([nt("my-button")],Ce),console.info(`%c ---- MY-CARDS ---- \n%c ${a("common.version")} 2.0.4 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: green");export{Ce as MyButton,Zt as MySlider,he as MySliderV2}; diff --git a/custom_components/ui_lovelace_minimalist/cards/simple-weather-card/simple-weather-card.js b/custom_components/ui_lovelace_minimalist/cards/simple-weather-card/simple-weather-card.js index cce85207e..f19f7c495 100644 --- a/custom_components/ui_lovelace_minimalist/cards/simple-weather-card/simple-weather-card.js +++ b/custom_components/ui_lovelace_minimalist/cards/simple-weather-card/simple-weather-card.js @@ -1,10 +1,10 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var r,i,o,s,A,a,c=g(n(1)),u=g(n(18)),l=n(19),d=n(20);function g(e){return e&&e.__esModule?e:{default:e}}function f(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function M(e){var t,n=D(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function h(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function w(e){return e.decorators&&e.decorators.length}function y(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function p(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function D(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var A=this.fromElementDescriptor(e),a=this.toElementFinisherExtras((0,i[o])(A)||A);e=a.element,this.addElementPlacement(e,t),a.finisher&&r.push(a.finisher);var c=a.extras;if(c){for(var u=0;u=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s(0,u.default)(T)},{kind:"get",static:!0,key:"properties",value:function(){return{_hass:{type:Object},config:{type:Object},entity:{type:Object},weather:{type:Object},custom:{type:Object}}}},{kind:"set",key:"hass",value:function(e){const{custom:t,entity:n}=this.config;this._hass=e;const r=e.states[n];r&&this.entity!==r&&(this.entity=r,this.weather=new c.default(e,r));const i={};t.forEach(t=>{const[n,r]=Object.entries(t)[0];if(e.states[r]){const t=e.states[r],{state:o}=this.custom[n]||{};o!==t.state&&(i[n]={state:t.state,unit:t.attributes.unit_of_measurement})}}),Object.entries(i).length>0&&(this.custom={...this.custom,...i})}},{kind:"get",key:"hass",value:function(){return this._hass}},{kind:"get",key:"name",value:function(){return this.config.name||this.weather.name}},{kind:"method",key:"setConfig",value:function(e){if(!e.entity)throw new Error("Specify an entity.");this.config={bg:!!e.backdrop,primary_info:["extrema"],secondary_info:["precipitation"],custom:[],tap_action:{action:"more-info"},...e,backdrop:{day:"#45aaf2",night:"#a55eea",text:"var(--text-dark-color)",fade:!1,...e.backdrop}},"string"==typeof e.primary_info&&(this.config.primary_info=[e.primary_info]),"string"==typeof e.secondary_info&&(this.config.secondary_info=[e.secondary_info]),this.config.primary_info||(this.config.primary_info=[]),this.config.secondary_info||(this.config.secondary_info=[])}},{kind:"method",key:"shouldUpdate",value:function(e){return["entity","custom"].some(t=>e.has(t))}},{kind:"method",key:"render",value:function(){return m(r||(r=f(["\n \n \n '," ",'\n \n \n ','\n \n
\n
\n ',"\n ","\n
\n \n "])),this.config.bg,this.config.backdrop.fade,this.weather.isNight,this.config.backdrop.day,this.config.backdrop.night,this.config.backdrop.text,e=>this.handleTap(e),this.renderIcon(),this.renderAttr("temp"),this.name,this.renderAttr("state",!1),this.renderInfoRow(this.config.primary_info),this.renderInfoRow(this.config.secondary_info))}},{kind:"method",key:"renderIcon",value:function(){const e=this.custom["icon-state"]?this.weather.getIcon(this.custom["icon-state"].state):this.weather.icon;return this.weather.hasState&&e?m(i||(i=f(['\n
\n '])),e):""}},{kind:"method",key:"renderExtrema",value:function(){const e=this.custom.high||this.weather.high,t=this.custom.low||this.weather.low;return e||t?m(o||(o=f(['\n \n '," ","\n ","\n \n "])),this.renderAttr("low"),e&&t?" / ":"",this.renderAttr("high")):""}},{kind:"method",key:"renderInfoRow",value:function(e){return m(s||(s=f(['\n
\n ',"\n
\n "])),e.map(e=>this.renderInfo(e)))}},{kind:"method",key:"renderInfo",value:function(e){return"extrema"===e?this.renderExtrema():m(A||(A=f(['\n \n
\n ',"\n \n "])),this.weather.getIcon(j[e].icon),this.renderAttr(e))}},{kind:"method",key:"renderAttr",value:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.custom[e]?this.custom[e].state:this.weather[e];if(!n&&0!==n)return;const{unit:r}=this.custom[e]&&this.custom[e].unit?this.custom[e]:j[e]||{};return m(a||(a=f([" "," "," "])),n,t?this.getUnit(r):"")}},{kind:"method",key:"handleTap",value:function(){(0,l.handleClick)(this,this._hass,this.config,this.config.tap_action)}},{kind:"method",key:"getUnit",value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temperature";const t="speed"===e?"length":e,n=this._hass.config.unit_system[t];return"temperature"===e?n||N:"length"===e?"km"===n?"mm":"in":"speed"===e?n?"".concat(n,"/h"):"km/h":e}}]}}),v)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(n(2)),i=p(n(3)),o=p(n(4)),s=p(n(5)),A=p(n(6)),a=p(n(7)),c=p(n(8)),u=p(n(9)),l=p(n(10)),d=p(n(11)),g=p(n(12)),f=p(n(13)),M=p(n(14)),h=p(n(15)),w=p(n(16)),y=p(n(17));function p(e){return e&&e.__esModule?e:{default:e}}const D={"clear-day":M.default,"clear-night":r.default,cloudy:i.default,overcast:i.default,fog:o.default,hail:f.default,lightning:s.default,"lightning-rainy":A.default,"partly-cloudy-day":c.default,"partly-cloudy-night":u.default,partlycloudy:c.default,pouring:l.default,rain:d.default,rainy:d.default,sleet:f.default,snow:g.default,snowy:g.default,"snowy-rainy":f.default,sunny:M.default,wind:h.default,windy:h.default,"windy-variant":h.default,humidity:w.default,pressure:y.default},E={...D,sunny:r.default,partlycloudy:u.default,"lightning-rainy":a.default},v=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"];t.default=class{constructor(e,t){this.hass=e,this.entity=t,this.attr=t.attributes,this.forecast=t.attributes.forecast||[[]]}get state(){return this.toLocale("component.weather.state._."+this.entity.state,this.entity.state)}get hasState(){return this.entity.state&&"unknown"!==this.entity.state}get temp(){return this.attr.temperature}get name(){return this.attr.friendly_name}get high(){return this.forecast[0].temperature}get low(){return this.forecast[0].templow}get wind_speed(){return this.attr.wind_speed||0}get pressure(){return this.attr.pressure||0}get wind_bearing(){return this.attr.wind_bearing?this.degToDirection(this.attr.wind_bearing):this.toLocale("state.default.unknown")}get precipitation(){return Math.round(100*(this.forecast[0].precipitation||0))/100}get precipitation_probability(){return this.forecast[0].precipitation_probability||0}get humidity(){return this.attr.humidity||0}get isNight(){return!!this.hass.states["sun.sun"]&&"below_horizon"===this.hass.states["sun.sun"].state}get icon(){const e=this.entity.state.toLowerCase();return this.isNight?E[e]:D[e]}getIcon(e){return D[e]}toLocale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unknown";const n=this.hass.selectedLanguage||this.hass.language,r=this.hass.resources[n];return r&&r[e]?r[e]:t}degToDirection(e){const t=Math.floor(e/22.5+.5);return v[t%16]}}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgBAMAAAAQtmoLAAAAHlBMVEUAAADL2/vK2/rH2fnI2vrG2PrJ2/vL3fzG2vzI3PwdWi7LAAAAB3RSTlMAFzNfjrze/OgtNAAAAdhJREFUeAHt17WC3EAMBuBZ3nIZOqcJVGGqwlSFqQpTFY6yVTiZrUJ3Z+tpj3ynBY3Hv6vDr5aGJMOYbetX49CtmsE1bxO9M7DcEVr02aDyt2nJvozxH+H1xPH01oAuUOyvwXRoxRUDKdCqAF9Qlj2XKAaX7TbF0EMqk3gNTiD+GECRBHaqR0lAnZSjMQG4ZVEDiybQFQm8ynjCrqwJzzIm5GkCvAU8oasSoL4QNXDPIgDLhjdfgSadBA9J3DcpKjTpFXiq4g3YSeIdWAbxAXx68ELcpkmDk9kSBvwnW2cw/zd+v6Ym4DkoQeIX7cOWJPGc0hx3SXBsJiWBQwmPhTXjc4kV/wv8uIoP/Wvaw0ro7Y4+a95ve5W1Od+2S6z4S1FgzdseOdYifuDJeMEOUQ0shHgLnCta7hI7RYnVy7PbbC25X12G0UwN6SYRWTsbZNmEXTS33126oXuCRb8eBUglJH5R+PiA3krZuSDBdD91TXaSmuOYP/6b/oXTGxh3MuXVYaf8SCmFnXbF2x6R9U2gd2G1hD6/qMNj341bYWjdEl/+HevkeRscs5qu2ZjcHav8qBmPvMr4Ic2NZeh4fbW0Yx7VkMvrRRl+P3w9vvn0yY0zO8y6tW0BcWLk3nu06KcAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgBAMAAAAQtmoLAAAAHlBMVEUAAADr6+vn5+fo6Ojo6Ojm5ubq6urp6enk5OTf399QNH53AAAACXRSTlMAIneu2P///z8+tLZ6AAACF0lEQVR4Ae2Wt5bUQBBFtfhwIgjxEOJdhHcRtigU4lohtvV2MiW4D1ijr11XpR76lKp3Y45uMq7uvPbq6j9mYmJi6fTD0Ly+PNtr/Zmg3Nvb3z8KiQ9eiFMf8HF343r4B+DDbvW/Qi5guVy/P2Q0QHuiKDwyAn6U6g8EK+BOOcAKH8sBVsDF4pBmYJv2vVd/JIwKCJ0jHHIEPPda5AnfnVUUPAEzZ4w8wZmKo8GOqvLVmTVPcDoRfKEdq99nBSRqakN4fbkzfXaFFd5JulmctgaJuQjAk/IgJeqeINxNwrlCixD7FShdYWFYIUZ8c6ehyYSe9R2GTf7GDRBhRRPSOdKWBPR9zVBFl6LfIkkgkvK0FP0ASVghloSobWrdAEmoiTThx2inAdMkYklANzKsMMIKEcWdBFy0E9cYYbueWBK+2KWBHMz7mraRhGWz+GAFIomIW8jqOOzUi7CyIsZOgggHvPbLBiKB4xbfsy2KMWoawGIiUGAlCbyFCjfgEhcCLU6dYwVhpy5F6B46AJc5cYIAFZYYHjLHKUGXq9+JSMh4rsJBV9CdoKSH3hF2hCHAnDTnSwHggdeL49URpB5Cdv14jDEYecKdqhwRkSfEWVWO0B6khLfZU4W9gJQQ8/vQX6c+xiHhZZVzDQ6sZlflLD3ECHFIoLv2QnCL/YT4ZPSiu2KrmcGM+qZ3lX7aj3D/VFdNTExYNgHAL10vmVlOfQAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAOVBMVEUAAADHx8fKysrJycnIyMjHx8fGxsbDw8PBwcG/v7/CwsLCwsK+vr67u7u4uLi3t7e4uLi5ubm4uLhyXqCUAAAAE3RSTlMAFkaMtND6////CGT//7BAhezMkbzxVAAAAi9JREFUeAHtloeS2zAMRF0JrA60yv9/bBQagS2YpOj05PiS6zvYURk8Hv5vOp1Op9M5ns6XawjXy/l0bM80c7oGIr5D4XrKZ4ihgCzTwPARKMFsHR/DS4axxWdKHM+BFNZ/qeN83GTwFdZ/imWKDMfTJZDBilZcTsfhniFmgPEKp0yREHS6vwK7jLCivQDbv2eYqFjgxkNiFHAevQKJKyJ4RpoKcNMbMt5yHWm83MZ0Q9ZMfLNANo90EvYAiNMmE9sLeH59KWdfkMtISwFjGQ8ZxkXACqSUiVItmJfbNJYXwzjdlrmeGVLmoHS6D1gh+gU+MNn8Gh+kmelf2QdeB+0+SOPcFbD3AfCdPiAd76/A1JkiNl4voN0HOl0/Ia6g6AIGqw+i4IGI1ApsfMUHOt77oKGADZkqPgBQ9kFLQdYHcDeo5APZLZA9HwA1H1QLWnZ9uw863QfExq/wATt+gQ88OR94uN0HRskHWUT2fcBFsEKkPsgiiZoPeIOe/fFYcYaJRmJCtEBpKpDb+M0Hog5g+6fEjQ/knYLMrvdXAJ9pL0DWB+4Ykcs0FVR2PYz4q30wdB98Gh8M4w/5AErFB7aEwO/6AHf0a9YHbsk1+cCf/e0L4HxAMMRo9AFW/BWkTw8fMPx8BTs+sLO/vwLWDiKvA/GAyz6whfa07AUVzAdbagWMxObsn+9wPmgqKO96ZCj4IO4VFM/+G+S7fLC366FIOROrBaVd333Q6XQ6nc4Xua9QVFRZEEsAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAALe0lEQVR4nO2cW4wb1RnH/+fMjB1vdjfkssJbVtAmTTcNIJVeRFFVSF+qKg+tgsRbqcRDxRtVBVXSIiFBpUKkipa3XgKRiiLRUiWt2oaqElXghXBRVKhALJCFJJvdyTrJJnuxPfac8/XBnt1Zey5nbvYs9U8aOVmPZz5///N955zvnDEwYMCAAQMGDBjw/wjr5c0qlcpO27bvY4zdCWCvlHJS1/XV94kIQghwzqcAvEdEr+u6/uLY2Nh0L+3sJZkLMDc3d5Ax9gDnfDLJdaSUU0R0dHx8/HBatuWBTASoVCo7hRAnkzrdDynlCU3THvk0REaqAmTteKCVpgCAMQYp5ZSmafs3shA8rQuZpnmciM5m6Xw3RATG2CQRnTVN83gv7pkFiSNgZmbmnkKhcCq5KWo4EeBFs9ncNzEx8UqvbEmDRBFgmubxXjofaKUePwqFwqm5ubmDPTQnMbEjwDTN93uVbjoJioL2+1PlcnlPj8xJRKwI6KfzVWCMTZqm+X6/7VAhsgB5d74D53xDiBBJgI3ifGBtlJT3EZKyAKZpHs+D88PyvxvGGDjnB/LcMSt1wr0eagYRRQBgbdTUaDRyOUTVw09pDe+yNSM7HME456fQ4+KjCqEpKO85VBVN03L5XQJbRKVS2UlEZ3tljApRU1AnnPNdeaodBUaAEOJkrwzpFXn7Tr4R8Gls/Q55igLfCMhbS0kTIcQv+22Dg68AeRjzZwXn/EC/bXDwHIbmceKSVvpxrjU7O0uWZaFYLAJojZK8Kq22ba9boxZCnE5zPuHZB+Sx5JCmAAAghIBlWQCwTgQV2qtxJ2zbfiapGJ4CzM/Pp/ttE5K28x2q1SqA6AK4IaIp27YfjCtElwCf5tGPG3cEAMlEAFpCxFmf7uqEbdu+L5YFGZFV69c0bdXpANaJEQfG2KSU8uzMzMw9UT7XJUB709QABYQQ614BwDCMSMuiXsPQvYktS4msWr8flmWtc2YYTrpyXp3Pcs6fUhWhSwApZS5GP712vkMUETojwN1/cM6fUklHXQLE7YQ2Il7ftVgsKovgFwHOq2EYpyqVys6ga3j1AaE3zppetX4/Jzudc5gIfhHgFjaspJPazri0SOJ81lyGPv+G8vleEdA5GgoSISwChBBgjE0GpaIuAfqVe9O49+bZl6DXLiqf7+VcJwWFnef+u18EOK+6rv/Wz4YuAaKMAtIk8UJLvYKhCycgeTH85BDc8wMHL7+oRACAwCjoEqBdeOoZRJTY+UQSI9PPA7IBSrjsGzQh83NwWAQAgK7rP/K6plcf8F5Em2OTVrorXv0PigtnAF5Idp1i0bP1uxFC+DraTxgAYIx5lsC9+oDXI1seg9T6GruG0Y+fB5jSBo91dNaCVMsRcSIAaG3v6bxWlwC6rr+oZEVM0kg5boYu/gO8Pg8wDWBAkkuHtX43XpGgkKK+3nmdLgHGxsamsxgJpe14ANBqJoYv/g3QknW8UVq/G9UICJrces4DiCiVjthxeiZDWxIY+fAIQBJrVXX1+3SOaqK0/s7rqEaAV6HTT4CjsaxBxk53Ubz8OgqL77k6XnIdEa4T0/FuIkRAV6HTU4Dx8fHDbkdGOXpCcwWjHx9zOV8iquPd68FpENb6/fAtRRDRibSMS5uRC8fBmtcAxtByfjSymmwGDVHbdA3xfQXQNO2RdM1LB235HErmvwBuJLpOZ+vXNM3ziEpQBHgN8X0FaI+GejorDkXaGP3oWbTSTfwZb+eIR9O0QMeF5Xav4ajKCAgIqYZqmra/X7UhL0qXXoGx/CHA4rd+IYRn7vdyZlheD5qQeQkphDjded9AAcbGxqY557noC1jjOobPv5io3NDZqsPSjF9aCjucz7pfhRDw2roSuh5QLpfvzUMUjJz/E5i9BLAAkxVHoaq5PW4EeLV+v4astCAjpdzXTxH06x9g06VT/q1fwfFe67ZhRM39QSMg27af8bqHkgATExOvMMYOKVueJqKBLWePtIecLiLMu+I4P63WL4QAEU357ZxTXpJsT856Pioqmf+GVj3f6niVnO79ZtS0k1br1zQNtm0/6He/SGvC5XJ5Ty9F4NZVjJz7I8CLCk5vHZ0rYu4hoQqqdR3V16DWDyg+JemmXC7vMU3zfcZYtvuHiDA8fQyQVksA/xPX/sl0bKpOw756BpqoQhID5wHzBQKIcdR3rFWJHcHSaPlCCBiGsT/oayb6sY4sRTAW/out7z7Z7njdZoYlfdE632uBprNWRTYa+g5cu/NXXZHi/D/Jq5Qy9Nnk2NtSyuXyHinloUxGR3YdN5x9trXIAkC9xyWsfiWy1w7ZPqjjEBau726l587Uk7TlM8YOqWxZT7QvaHx8/LCUcp+zzz4thmZPgtVMlwBBeInD1o51mrn+Li2s7PgmxA1fWJe30+gDGGOHVH9cMLVtcKZpHpdSHohTwHJDi+dx47uPt1qop3mKZeeg0jhJEBjmvvwM9KFt696K2ml3flYl7bhJbWdcuVy+1zCMXUQ0FTctEUmMfvScj/MjLLaErUvIBi7f8gBQ2AIAiSPAGesbhrEr6pMyqW5NHBsbmy6Xy3vaQpyoVquRau/cPI1S85P2/wjquR8tpztHELIJa/Nu2ON3Q9f9C3CquZ5zPiWl3Fcul/fEefa4Zz/cWqvVJovFon94Nxax/cxPoMmaullxVuCkhUu3/RxydJfn6MUh6O+WZaFUKmX3kF5WdP50ca1WWx3Gjsz9HdvNv/iXmtNY7pQWrm37FhY+e7/yLvBSqbT6iCrQKiln+phqLzfnXvz9dwAGlAz27a2jdJIxaBGXdtVhBCnIPHfj9w8sbb/rtE6N1bf27r01o5t6mNEhfF+3p19Z1mBrQ6Wt24ynGCg754OAZg2V4TueWPzMV08zYwWi0Fw9+kn0/XwpUhi7GcOYfYjJxh3pZ0N3iQKo1vhr1+ylI2z2bUDU15/6+S+lfG91+puC3nzu1psuHHsTTC91lZv9CDWv4wQGkBDNTy7p91xvFl/TZPcOuNt//E+1e6dAZwrqawSMXHj5B8KSF8GkHXYutRyr60V9F9Y1nDBFJKpL9d/okr+2Vbdy95tl/U1BK3M/Jc4PEqnt7eEG2wFGF0DYFH42ASTQxOYL5me/94QEA8uuk4lNXwUgrktAhKd/ArjBoRU5V0pBRK1rSoEFy/jZ0t67LnPOEXX3XC/oqwBKEMB1Dq3A4f/4i/cMeHFFf/nSkjimvfprBKq8+w/p2BqDfAtAANcZtKLH7uewH/C2m9ZKlR7WySJeS7damyb5FcBxfsF56iJK+iAssvLTjdHi2yMs+t7RXpJPAQhgjvOjwgC7bn0w+8X7n2xs3Q0uwh+8mIhhYlrkTwACuBbT+Wg9rzG/tOlR8fEbS9z8EJAK1didt8e6VxrkSwBqLYKt5fyIMKC6LP56pT78Zzr3Frjvok4H+x+Od78UyI8AbefrxZjlKcZAtr20UhMHbzCWwHI35fImNwIkcj4A2HVc3nLn4crnvjGle5Qb8krfBSAAjDPocdMOADCgURfvLAwNP20P3wRh11KzL2v6K8Bq2knmfBJSzC6PHqpdf6fGP3kn+jVuuzv+/RPSVwEYT+h8ACCJ+krjBbLppc1MADJ/5YYg+ipAsRjzUaPVWTBB8KErlS23PcqGJWKOXPtKfyMAlKw+JptYYNsev/KVh85pFH9l6+YEJiSl751wbBihahlvXl5Z+Z3+xlHEeVx1lVt+kZpZUdm4AkiI5To90rBsS5t5q9/WxGZjCsCAap0fbUr26vZSHXms86uy8QRgpAvB5mcmf/hYs7gDjEJXM0O5KQWz4rLRBGAgpl9dxGP1WmMOrK6ynJxr+j4RiwTDZqsuTprV0SM48wKYs/SYlK99N4WLxKOvAiwsR6z9MCwIgUPDhi1oda//gAEDBgyIyf8A4n6spjurxDYAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAyVBMVEUAAADut0371Uv92kX920b+2kL92T/CyKz92j792Tvvs0jk1s3s4+Hl4d/r6ujp6Ojr6urn5eTk29ji19Po4tjq6urk2tb81jvp6en60z3r49P32Gnr6OHz1pbo6Ojr28Dj4uLm5ubn5+d/xLn8tl7d3d3/sk/k5OTa2tr3v3jh4eH/sErW1dTh4OD/r0f/rUXiwZr9sE/+slD0o0P9qkX1pEIP3/kL4f0q6P8H5f8A5f8n6P/6p0Mc6P8P5/8E4f0F5v8C2/sn6P8h4jSJAAAAQ3RSTlMAH1+bzey9Bf//SR1mpNHj8b5fNZP/T////////////////xH////////////l////0ayG+q0o7k/4/07PPNek3pNP7VonwQAAA8hJREFUeAHs0gWiwjAMgGFWDzBfmD/uf0rcgqV9bv8B8i3NJv/92CIhldZGiugjpluh3SFwWtj3nj/V7hwA6On7fr50jgLg5CuXmM3jJM2yJI+L2XGEVY4Cu1S4YMsqw8vi0pL5BAgXFhnelBV2Iuv7AMig8WWK92rSqm3b2tV3AAi4tM3xfk2DXX8WKKCt92lTfARsGs4CBUD4Pk+Gj4Ft41a4A2jP+YgMgESAc5HX+2Qs0Lz0FwKEvZFNkQe2d6hrAnj/qTn6AM1y+7feAMbnACxwPjQQwO/KqS8wbICNABAGLNj5ZIUaNtXnDH9hDiArbAmS5C/AAmQFWl0LDqhCACQN3XLsIw7ImPlMmK0pLa+FxUEgjLp7Y++9TRjSg255/5f7vwS7IOO55xyqZtD+/Ig/qkMBQDRZfQrMvHYCG4EfTNvfHgEGRopZkyxAo9gbmHr8hyRFgUkUQKH91TPekD5maZrmrIlEARqKL5H1R1lWFEUa3CW6sfoqkJcIgEoemLTFW7QhPmY2kCpxgAbSQ8YG7RIbSNMqJ6GfxsJrilFcwm/qQFUplgaoL3to8Ee135zqgFI5SwMz0U8FNkgl0DeBqg6gIPJ7bmp74jhhYwNpE8AaZIGp4BDsEzAPARS8ayAQPuX52xMwT4G8hqWBwF8mxuijeQl4C0SCLQKrx0F4Ao4A0OHAwhNonx/GcGkeAwoBX4FemXn/9u/z15HxBVAIBPotH8PrCDyB5wAKwFkg8pyxf5NI89G8BPxrkO8Q6E+sP8qeAk0BCYst+BfQ/vj1xXUAT+CB7E6pVPVcoDdWge+7Cv6jeeVPgznd3rT2BYatAP0z7zK3/+8/bFadQIDJ7Z+2WyHaw9KlB0kBbICZyeHfhP3gl1MPotN1BVxDb34ehv3gv0sPylMTUKoJAE1P6POqJeG3yw6yUx24LsBCd/LzrC3yxw65PWEEmgYqL5yni1n/p726QK4YBmIAqgwFrvEHC/kc5vvfqejOZjregrXlvgsoYFl4o0Pud4SN7DL3OsUwEZ9yr20GG8eTyFfOUMQxgq2e/7SBX1GWBR2w3aofqKqbpm6pgO29Dn5986APDtg6kVKZunlQbxBk+0SrwNA4AxdwivUP5PRUQAa/UQJGJkCtwCQBExGgVgC1BNQIoXwg40/UQVVIQBEeEEE3N86MIFIBRewS5hhBpAKqYizLsUAg5Q/bUSpgR6mAnW2m7JeVTtkvMxGeWWS/OMR+Mdj9EsR+Mbj9EsTlTKL3SzD79fWfiNgvGrFfgtgvBrFfX+/fLZ2VqOfdJyPAAAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAllBMVEUAAAC8y87X3OnY3+zU2OXN3/3J3Py5usLW3+7O3ffF2Pnd3eLl5efp6ern5+fl5ebq6urH2vvp6enj5ObC1Pfo6OjU3vLt0rDk5OT7uWfb29vh4eHxw4n/sk/p3c7W1tb/sEr/r0f/rET6qkfqokj3p0b0o0T9rEYR4PoL4f0i6P8H5f8A5f8K5v8J5v8A4v0C2/sC2fne7Ib2AAAAMnRSTlMAF0uOL77/B6Po/2HG6v/f////tf///////////////////9BMrIbrKu5E+f/bnqaTqTOwt04AAAN7SURBVHgB5JiHdqswDEBZwWQgUxM1zNL5/7/4HB+F+hAbqxlnvftG9721lB3918RJmj1Rn23yPI+fphdFfkY8bTrb3PA0/y5/akDQ73/3iLJ9cSgB5CHdx5FFQfq7liyytKwsoMjm7sscSG72J2S3KUm3yedCcateVi6UTMyGX6hw6xJEXblRqipElOysQnqDP5aVL6CRcXqkwo1rzqBaCyjcHu3C5s/+yo8yVK924eWPe45hLUDsTEEH/l4QsmIEcGcCdIR8E/MDdcUJKDhSgUgFewG8gHqlwoW8SGJORHIDaAUIztUu4fjtI1iNnSa0blHyA+qo2Rn0G3ovY2yAG0B9hCVpFCBl+YnlF+F1G9wye0JuqnK/nshW1eGAQiyTtcDea0eNYvg1tfjrCpTCUwMAyAug9BcOHn/Tdj2ngKGCdAYQhrHr+kYXkBXA2hcAt/9t1AHGGXDGt+nGGWhaHTAFdqAU7BEphNNIgZ4dwD1vyTQgzWQCDTL9WDIvpspseBzfKQDcAMa8KxoN6P0SaIAbcM8ou/Y3rdabQK8DVAj7sXAGROO4CrxbASowAofwEmjD77+BxgAcv2/L2dVV4N0OUIEVCN8hqPOG3x0BZwEX1J5AoixoQFaAgHAg9QSEtH4GhndHwFnAJfvIQ6YuAA3IMSIqrAXiyEdx+QmgDS8upgSs+yXZ/ENCoAHZAeeU+BMi4t74zYaXAYIKfn8ZeIKj1DwgYvxluCTA68ckWi/02n96X/JheH/rrYI7UISfBNKAln7N0M37BnT7D5yXaga3/rOdOo0JAAA6/SIKkzn1mtM0UQDO4JUfiojDl1v/OUznQE+BMwu9TFj+76WdGCfrANeFRu4jFsJhpwMQnYU+j/5f1vSKD4efpZn4115dHEYQA0EULZ0Ux7AY8g/ObLep56Aye18A/RendnyMVbl/WHwIe0zvW/Ex9llMz2xQWIthk5i1M857xwf0DyjElGLgA4t2P90JbGA2eJeJ6U40XGDe8b6cHmQiMM/zYfUP6EEYDMx3VryvSKBgxHxvgyJLIDMBC0WUQCQCKzRVAnU8sEDlJODGAwa6lh40DAd2nGnUfah/AeG6991hPLDiM8lf4NMC9pMD6+l+8Zbz/eIZZb94xH4x2P0SxH4x2P0SxH5RyP0SxH5xqP0SxH7RiP0SxH7RZL9+l4tr2oowXbK2IEgAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAsVBMVEUAAAD0z2L93U/93lL93Ev81D/93Ef+3Uz72k75zEP93Ej93Ej920X920P920L92kH70z/92j/92kP92j381EP92Tv92D7+2Tv92Tn70jf810L44Yv15afx6c3x7uTv7+/43G371Dzu7u792Dfp49zcxLbt7Ovm29Xs6+vp4t/x8fH70jXq5OL5zzT4yjP4yzPq05fyvzP4zTP2xjPvyWD0wjHo3L/2xjD4yjLm5eTkxIAPtip5AAAAO3RSTlMAF1V5o7zT5foJl///////R/9w/yT//+L/8v/////////////bL8tJ6Ib//6P/nP///9P//1f/deP/x8TGymgAAAPmSURBVHgB7JSFduswEESfGSSHE7Nkx4///wPrVVm0ktvDuaWDczOzOv3x4MEDZ4IwipM0y1eyNImjMPjG8CIsU0JoVe12u/0LFUnLsPiW+EOckwr4KDgCVR4fvvzho4zQFdlwfKHKTsXX480CIIs2K0KIf0G7EXA+H7NwU/wlIYQ6CFb2yWXDx88JEQZko7Mg9y1RlIT4CK7H0usSQUokAUUE11saeMyfEj8BGK7pxTk/I1sE1/rinr9JAAb3/X1vIHC5Q/Ga7/eKXg0FKijJZgFQYvkhIfaFEME1RA6cY4K9XdC09kMnUj66kCJoki0D+QhsIxWZnI+fQBE0dWEURJTK8WoBVNCczAWohPdCIDBXOJmy993685qPC4wV3guQfhgZ45yN49Dn3cpegC8kqPX5B/pM3o+Mf2QUjv07R0TQHLSCmAJkYFyBDa8KfCEg1p44h/yecS2sh6GwAq+CVnfmENYZuZFxAkOHLwSEGkFJu4lxC2yaRYsjshBQagRp1d+5nX4GBbYQkKr5Ae05gBpuN3yhZgnURzrdOc40zzcwIAWaRX2oEeMOsGcDJliWkyL4yZ0Y5xkUWIFFufIv7kgPAjCcrYJEFvx2FbBcGJACi/yM/nBnBhA8A/kGQS0J/roLWPdqMBUAQYtcALsCKK4A/FUKAJ8F/7gP/wHGxmGCMk2jFAA2LyT/GxcKuYA8UcA3cx9moZAL1E/tmYVuI0EMQKfcFa5OWG4nrInHy3D//2Fn3ST1MjnivID4PXkZGtuQgI9nQ4lV1c+bKa8CAZ9UMFxwgQdV5SgK6M9nMIakzu+wjd1YgNb6A6lQD/wRb0TsJwI0tJAoQX6HLw6wn/h8QbeQVmdu5IuI/cR76ApnIlXjKPXrzzAGDrROBwehn0iosOJE2jxYS/20jGJkf/PC60bs11kcIxesarCX+vUHBbjgqwYHqV9/xlQAMHykq7GR+V0AEU6FXLVYC/y8iMAVum6hdiI9kZ0nMMYNIBlBdxBwoPBUBxst0BMJBYAwBlLVyUGi1yX5T4EH1cN2oZ6XEIIB0/8w5Ga/QM/HOgp0LyBmU87X8wCngFUDbPaz7Ez2O0DkqSFu1vPtxEfoBiD/jRrGO+rJcvYnZ38x4bHmZq0nm3n5uAU06Gd2az2DMvj1R9P8xOawn2h3evJTgJf/pMbfICuHybIgYT1aT80jDYchN4ExEgAv6ZJXLORogW0AcNYrFiYtTk73h51yokjVQry8qGoBoYWBIuelvyiBVRthKgj0jG9j/C83TeDF+uoSeKmNECnAFQCMbOqpy3Hj5/YhKl4QX4roweb+jZrKlStX/gHY0DfPBrPHXQAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAS1BMVEUAAADO1fHO1ejZ4fLR2ezd5vbB0vXDzufS4vzP4PzN3vvV3fDk5+/Ayerc5vfu7u7v7+/t7e7k5eavwOrT2OO4y/DAzOi2ye+/0vYf7YBFAAAAGHRSTlMAByNNhqbMO////2bRFP///+v/////9qxLSnpnAAACKklEQVR4Ae3U2YKzKgzA8QRBXECgdTnv/6RH+2V2LWLgzl/n+h8NOHDe7XZDUUlVY6G4Vk276voi9cps9U2HkJ1QW51UpfKkg8ws5Uu9QP+ZL3IC1rS/KMhJN+1vAjKS1C91xKr5O0BCNqianQE65/PvDcC8/abcEcjmpdglrf72s37Gdk1TvcxXYNoDFrLo2yOYa0FHIAvVlh0g/mS7f3INqFuyMyPnC3R7cp0A5YfB+Y1zw9C9ILAhxVuKf3JDngFV220TBr9j6CywmW43T3rgst3K+UMKgUd3XePfCQJY1PF6iNPAEe2vOBOw8XGOsSXt/AkB4SrjT1FwkfYnVSVfgLGkyvuyrxD8aQEuED6BhnTSJwtG9YK/oYjQ8zcUEap8d4jxb1x6DhOfoDyDc/EJhjfAKYgIrP6qKjfAvQQstSJH+kKH7D6EMtfUfbElPjRH4juyzH78pgZu35nsh+DIuVMWvH58ABhWP74i0Ix85JCJ4fVdDxHaMfIrATGSk/ePZy0rYRHhEJpLeTI+N9NqPpxhw6U8vcDnAAuHxCM9T+aP/KThDREu1GlBNEHCW9ak1cnjcz8LRKB0iXHqr2J9oo07Wybjn+ePj0jwmFOen2gZ0vLTpocUQo7j471xpPr6o/uZBJdnFMVXtYV0ejqtgktwmU5ZEK6yy/Tfron+1t8igGQdQabFAhfq+ihfa4QsUMvp77NTPRe0ul+Wep7rRfbaJsRvt9v/h4jJKdZPEXkAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAATlBMVEUAAADj4+Pp6enn5+fp6enp6enp6enq6urm5ubm5ubg4ODg4ODm5ubo6Ojc3Nww6v8Y6P8T5/8m6P8H5v8A5f8L5v8N4PoF4f0C4P0D2/uDNJb/AAAAGnRSTlMAE2SS0e7//7smT/////0a6ehI///bMaX0k6g43vIAAAKLSURBVHgB7JjpmuQgCEVjiBdTgu//trMPX5uuoLSzT5/6f09xyb6984eTdjoymBm57OmHpxO4A+VHOs6DXwHOjx/17ws/A+D8Q6Ygfg4+wWU9/2BHAOTVejL7AvC5tF2+Bz/AkNgBxtsNeU7AaXG/jmBp08SzAqYfvgDLXyipjAVLJZ0cEeCMbzgmyD94A4wrtYooM+dC+8w4FBXIF4PiM6w0dOSogJsJPsOUflBDRm0iYgJV7J7gERdIq51AlX7AWdwLai/QsngZ6tH2ydALnBlyXIBPAjPoN273oMF8E0gvQLoRhPNNIJ1AKS7AQCCdQM9oRRgKxPKdEXI8X7/ni7wUSOwwxT3SqhlURx1ROB9i8b1hn79UwKW+FMhoCQnBeMDyL4YytWUM0YvADPm5gBAItxtOhy9ICFJNYLgVbQeM6ACGe7FIigBcvwf2Bu+CWhDA4lRE7SfSn2g9STCN2u1Yr+TtFtLQADcC2u45fkC+pM0hBwpSyx8NEF+Dky9pczklkv9aII9tQGqT/YQLMg55e37ZZqDq1uP0Q9MfQ8T5/zrfv6M4quKCheJpvlAKfpDK1VvGJb1ZfMTxoNJaHdEmX6He+dheXR04DAQxGO7ANFrqv9DD1eyBSWH6Hv9wDLpB/TD0m2UcWWSTfZi2CsCimuzLtF4AgEXTW9WvFXxhkQSrwp8CtIKKRRDNxZ8Fn1hALIJkLrWCbywgFkEwF1hALCAWQTaXa4GbL0f/RXDz5eiDDDdfRMW+oXhBNV9kBcbXesFmUcSUc4pqebkfXCuxCLhWWhHMrNWEL/NF1tZKKYK2VkIRRLi4vwgSXNpfBAEu7C+CDJf3lNv7i85+kH2tzrloeC3ayx7vgDWcARqOBsEAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAARVBMVEUAAACy6fHl5eXq6uro6Ojm5ubp6enq6urm5ubi4uLj4+Pf39/o6Ojh4eES3/kP5/8k6f8M5/8G5v8A5f8G4f0C4P0E2/uRTESCAAAAF3RSTlMAEFuV5P///8EbLv//jCngQ/z//6X0kyzJZw0AAAJ0SURBVHgB7NYHlqQ6DIVhOejKLsv7X27ndj0KrELAm/zNSZPuTz5Nv7h/QkyZISLIJQa6WE2QBZR65XyWFUi+0TVCkS2A5EoXSLINAKTQaVmMAMCBTqksdgByoxNuMocLClUMGCodxfsCEs7fXzMAPv982gEkOiDs34dU8iuOAPL5J8gO4EZe2RfIl5/Ao9aYVURySX3P6SRvgD8KineiqdIT7A3ICHyQFMgSXPvjGvEIqCKSIfoD3NoioJpOvsXrQFsGtBx9y7BFVwHrHPhYYBT0S6QJde8D7R0vAwi07cA+f+wzLwKa/AHMfAV4EdDqvUSY4XYv6F068sPK/Cn6BL1j32MK7DgDZv2Pm+dFgx3gQe/i/k8FTK2tCsZNCHDOA2P+oVB2vcp4StukkGlTx2rcxo0f2IEKH2lfBeXBvERU4LKaf2d+LKrCQcfgqhDpilMYc8qs49fHH1WaCOw7AcU7fcQ01RV78TzQaa5csM+VDNlxgXS1bz5Drttg7HMg0409++sAR3oitP3XB+q5w0Ph4/uF9uhWgY197rRPKGwcv/qv/1otrJv777C5zz2QR+iNGXMP661Xcguxl9yeyqXH+tpeXWQxDMNAAG0OYBL4/jct+ikrOS+acvvXEzDO4SP95VIynvHVRtTqVoa51fj7t75Qic8o9IWl0VVbZhm+sswehYYyyfBQAhNEproZNvsnSciIm2EjgRkyZTJD8TlSMupm2Oj7TVEmk90MGzfj6zT0SYaHkYl8gfs0Y++PyKIqGc/8fV/HIay/YEB/AaD+WoH9BYD6ywNczsAM4XOE99d7ThHWXyu4vwDWX4Av7K+/E4vvci3LGOUMAAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAPFBMVEUAAADZ2dnl5eXn5+fo6Ojm5ubp6enq6urg4ODm5ubQ0NDBwcHo6OjExMS9vb2/v7/AwMC8vLy9vb23t7ftsDFCAAAAFHRSTlMAEVuR2P////67J0z///+q+4HR+IsFiaoAAAJsSURBVHgB7ZWHYusgDEUlY4lhsv//Xx+NGtrEhliJ3vbpXvdUAwwbfzg4uJHYe88hDmie7tjfwdHSkUa/QJjABox+CWY/mlTh/DJc8BHeZvRtQYHeLAKz7wvYp7em69uwgQF9B668bqB1Ao+m850LmGz3cy5gZzyAKnhr0HFdvjDabmgVvLNJo04Q9BPQCTgEouy9D9G5NeU4ZT7T1ZBl5vm5I2sF/iYQvEODHZ31iKqgqAboMOgF0qMqKDiDU3wvCPeCHPVL2hHkmaBXA2nzRVAN+ZPhpSXiZcIHdC9gbAheyKdrPlEVdJukz5cKKIghV5K2Rcz9CgqS3y8hKPPrkK+K7wLSrSm3oWu8kIVOj5w6Xw4azQ3D+quCu9zyhWdDQFbFi4AWDXHVUeanZKlgZmg9rh3z2nCBJH5uaAiQldwalKnSbRGMrOIhXuheFolYQa6BM8MADSIrIApEWQT59iKGBA2QdAVk+ewRgiYuKwpoChy0GQ3yCaFDUDQoS76mgNVj6OQTQpdEmvy5gAZ4Aob1/VE3SBjp9fwIa3A9A/X642AdGKnz/2d9/+fgSJnnSCgv5pND0IAuEHGbh/Qg8TpwcjE8Z4xuSLCx8YewK8DPZF/YBL9DgGlJkBCsOBwP+CjA8k0wIpXU3elecDqWzxLYcN5/cJy+BFOJL5zBiJMYzkkE6Sz5J8MpH0Rx/XCQeBmLGUn6VCnVWDNdpIp94TKBPTKK2vy/TlBXs66s8LcMGQ+fmy/vZGXRsPkS/3XQRGE2Csm7fL8qLqZXRaqbI4K6UWZzOOyXruv94U984Pz5z+RNcCnAxsYv5gcBJmV5WFk6DwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAYFBMVEUAAADT3t/h4eHq6urp6enn5+fp6enq6urm5ubG0NLLy8uds7bo6Ojj4+Pn5+fh4eHe3t4U5/8Y5P0B5f/ExMS+vr4K5v8D3vy+vr4A3/28vLy9vb29vb29vb3BwcG4uLjMVSTuAAAAH3RSTlMAD1uV0e7//7ohOgX///+M/+g6//3/252t9H3R8/+TcABA0AAAAzBJREFUeAHsmAe6rCAMhUWGBO8kwf1v9jbsSonM6+9fwPm/k1jpfnP+Y3r7cICI4HxvXp0+WMAd4IdXxj/wBKB7e9VsPF4BgO4lLSxeA5+gb45/PjAjAHDPxvEQ5gWATWN6wzQwGxp2bbAgiNzu8HR1AjQ3BQ+sE4Brvz7zArCtC0jnN1xKvihoG9KAGgG86TesE7gfXACAmYUQ0XkbaupYrUDGLwPFnZMtbl20AlwEEWtarlGEM+PIIouACPqcoNcLeGTeCD6xrXfxcQnjQUC++TG0hcZPw1aQ7eBuCmYDTST3QOp8gPHbsBeASQhu5Mt3PssiyA5JnR8b8GSglUF7nwFkG0QDUamCU+cDzfksW4HoLlOAXIMpn4WKM7LaeACO+ZGNoK9/VECVIDpKSzCgio8X0VyAZTslX7VlKELzBqJjNbhrQYDq8AgvG5gleYEBJXP+xpEdUfcAFbLJXzaRfVgMoi0QA2VL9oHqlQViHMnRMKQERlGBlrclHeEuSSBFAYkCOhFiWNueRZIFZMj+gCgGlChguxyG6wqk89kUfgK5LV/6roBxUIBivn7Dy4+4lOefyvddDYGz148k8yVUH4Zwej5CqXzuNcc5TJf5X8BlPgfTaTDBsUCaQ/oYhjtHasG7sYjz4aO9OtlyEASiMHwrO6xNBolYiL7/WzYcbKtP5tBmzpdxVb8zC4Ovh2HGTZnVyuB2eL2J1vinOsJBcf4cBRvhENqM6EaB7W9ge5vAejNZ3yTQaKDB9cgcChjaOULlx8jVjnYD5KzDpNVAi6tVcWot/DfAUsd/1UyHyNukqzRQdTbxM51klpDnmRwwuRiED5zlBiXI5USfv5LgCAo8FhpGGeNjQgVvsGPdtG2zRiE97no+ZsdiR8K4Be7tqL9JYFHrGagXmFvlp+mJ9QfOAhFKkcuz+xD1OeF2xxFzYYFlujRDlC7ZZOdcSxcJSuR56dLMgXTJhsRD9TZHUcCEEAZhaAAsQ/xnMJE4v7zgBkeABhJywWFCXRh1VL7gaGB3wSHWABOKaWAHQwPgGwTAGmDcIgAJI8FtApBZ5mOIoEputHKc3jfFjOf29QPQe5BuJum+4AAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgBAMAAAAQtmoLAAAAKlBMVEUAAAD81kP71UL71kD81kD81z/91z793Eb4yz/920L92kD92j792Tv92TcDye7yAAAACXRSTlMAH1Bzm8vn/wvXXbMnAAAC1klEQVR4Ae2XNdPbQBiEzeMujE2YmZmZmZm5CmhUhfMTojnXQbkNO12YmaP/El8u1r7S+uSvC31b76Pd907SzaWa9ccq3WPW6j3Hdq0c3rJJ9mLPNY6qyvfV0eknGvszc1z1UyXfL98+0rWR//QexwFQqZwf29gfASqXEomM9jtuDfArmkholV7jAFAa0LpoX6w+DgFa223+M0594OnchEIgADy/Xr9UO6cmFQOeL6sbsMcOPEQE1N4J5cWB59uSJkACgAf8Up11khKeryVgjgAUA/fppRB+l4Cq4i9Ih2SAxxYje64bvnwAHtgbidcbQLzTOVHIBBCwNwKMEY0sCe+kv7hHJGBmA9w1wEe5d1kR4AGoSCAYKoCCXFSvLvAi2Co/NQTUEkoEvJXvhRzBo5kN8F7MLAPQKAZ8w9SZqtHY9S7YgABbl3O1WUNhQIkWKQimhkBeua7ZYxeNGFiKV1V5nn44AtBIAG9CoJ9SntLtwwnQCCOIdR3n1aQQwADepnnVBBOBkdEoBLAR69QveRyAEYIPAjAR2o8ANCJgH54dBpRphOCjBKRK3CgGsJ8baUlA+hFgA/aRv0yNaAb2I4CA9T7WB4Wo0QcBQPCjEQHz4UUhaiRejfHsRwAAvHz9yY8ANBKvd2fuzwHyA8rf4cdzgPhEczBxAAD8BDJkRgAaid9MsWz3I+C7+H0vsBdCwPsUNCAxIFxVqMB+Coj87rPkR0BIyAOleID8FKCPLGhC3I+AGvIueuyyHwFG0WM384zXEwHYNmgD2xGArwdqD7f0I2BbDMjARksqG0EL2Q873gvobB3/dwBrCShuJL8cGbuGse0DyJGh9MGoPxDEx5bwQe2ifhmwDC6agualCaAz0i81N2VRb2M3daDt9ivNJmOP+j/QxFDmUCDaGH3smngtO0T+Rhe5Q8l+Vma29O/s2pTL66ZwXPvlla7Hhz7ietysP1A/ALZC9b117sbZAAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOSIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDE5IDIwIj4KICA8cGF0aCBmaWxsPSIjRDhEOEQ4IiBkPSJNMSw4IEMwLjQ0NzcxNTI1LDggMCw3LjU1MjI4NDcgMCw3IEMwLDYuNDQ3NzE1MyAwLjQ0NzcxNTI1LDYgMSw2IEw5LDYgQzkuOTA1MzAxNjcsNi4wMDAxOTMzIDEwLjY5Nzg0MTMsNS4zOTIyNDg2IDEwLjkzMjIzMTEsNC41MTc4MTU5IEMxMS4xNjY2MjA4LDMuNjQzMzgzMiAxMC43ODQ0MDM2LDIuNzIwNTQ3NSAxMC4wMDAzNzYsMi4yNjc5MTk4IEM5LjIxNjM0ODQsMS44MTUyOTIgOC4yMjYwNDgzMSwxLjk0NTc1ODQgNy41ODYsMi41ODYgQzcuMTkzNjIxMTEsMi45NjQ5NzIyIDYuNTY5OTE1MjIsMi45NTk1NTI0IDYuMTg0MTgxNDIsMi41NzM4MTg2IEM1Ljc5ODQ0NzYzLDIuMTg4MDg0OCA1Ljc5MzAyNzc5LDEuNTY0Mzc4OSA2LjE3MiwxLjE3MiBDNy40NTIwOTY2MywtMC4xMDg0ODMyIDkuNDMyNjk2OCwtMC4zNjk0MTU5IDExLjAwMDc1MiwwLjUzNTgzOTUgQzEyLjU2ODgwNzIsMS40NDEwOTUgMTMuMzMzMjQxNywzLjI4Njc2NjQgMTIuODY0NDYyMSw1LjAzNTYzMTggQzEyLjM5NTY4MjUsNi43ODQ0OTczIDEwLjgxMDYwMzMsOC4wMDAzODY2IDksOCBMMSw4IFogTTE2LDEwIEMxNi40NTI2NTA4LDEwLjAwMDA5NjcgMTYuODQ4OTIwNiw5LjY5NjEyNDMgMTYuOTY2MTE1NSw5LjI1ODkwOCBDMTcuMDgzMzEwNCw4LjgyMTY5MTYgMTYuODkyMjAxOCw4LjM2MDI3MzggMTYuNTAwMTg4LDguMTMzOTU5OSBDMTYuMTA4MTc0Miw3LjkwNzY0NiAxNS42MTMwMjQyLDcuOTcyODc5MiAxNS4yOTMsOC4yOTMgQzE0LjkwMDYyMTEsOC42NzE5NzIyIDE0LjI3NjkxNTIsOC42NjY1NTI0IDEzLjg5MTE4MTQsOC4yODA4MTg2IEMxMy41MDU0NDc2LDcuODk1MDg0OCAxMy41MDAwMjc4LDcuMjcxMzc4OSAxMy44NzksNi44NzkgQzE0LjgzOTA3MjUsNS45MTg2Mzc2IDE2LjMyNDUyMjYsNS43MjI5MzggMTcuNTAwNTY0LDYuNDAxODc5NyBDMTguNjc2NjA1NCw3LjA4MDgyMTMgMTkuMjQ5OTMxMyw4LjQ2NTA3NDggMTguODk4MzQ2Niw5Ljc3NjcyMzkgQzE4LjU0Njc2MTksMTEuMDg4MzcyOSAxNy4zNTc5NTI1LDEyLjAwMDI5IDE2LDEyIEwyLDEyIEMxLjQ0NzcxNTI1LDEyIDEsMTEuNTUyMjg0NyAxLDExIEMxLDEwLjQ0NzcxNTMgMS40NDc3MTUyNSwxMCAyLDEwIEwxNiwxMCBaIE0xNSwxNiBMMSwxNiBDMC40NDc3MTUyNSwxNiAwLDE1LjU1MjI4NDcgMCwxNSBDMCwxNC40NDc3MTUzIDAuNDQ3NzE1MjUsMTQgMSwxNCBMMTUsMTQgQzE2LjM1Nzk1MjUsMTMuOTk5NzEgMTcuNTQ2NzYxOSwxNC45MTE2MjcxIDE3Ljg5ODM0NjYsMTYuMjIzMjc2MSBDMTguMjQ5OTMxMywxNy41MzQ5MjUyIDE3LjY3NjYwNTQsMTguOTE5MTc4NyAxNi41MDA1NjQsMTkuNTk4MTIwMyBDMTUuMzI0NTIyNiwyMC4yNzcwNjIgMTMuODM5MDcyNSwyMC4wODEzNjI0IDEyLjg3OSwxOS4xMjEgQzEyLjYxOTA0MzQsMTguODY5OTI1NSAxMi41MTQ3ODc0LDE4LjQ5ODEyMjEgMTIuNjA2MzAyOCwxOC4xNDg0OTI3IEMxMi42OTc4MTgzLDE3Ljc5ODg2MzIgMTIuOTcwODYzMiwxNy41MjU4MTgzIDEzLjMyMDQ5MjcsMTcuNDM0MzAyOCBDMTMuNjcwMTIyMSwxNy4zNDI3ODc0IDE0LjA0MTkyNTUsMTcuNDQ3MDQzNCAxNC4yOTMsMTcuNzA3IEMxNC42MTMwMjQyLDE4LjAyNzEyMDggMTUuMTA4MTc0MiwxOC4wOTIzNTQgMTUuNTAwMTg4LDE3Ljg2NjA0MDEgQzE1Ljg5MjIwMTgsMTcuNjM5NzI2MiAxNi4wODMzMTA0LDE3LjE3ODMwODQgMTUuOTY2MTE1NSwxNi43NDEwOTIgQzE1Ljg0ODkyMDYsMTYuMzAzODc1NyAxNS40NTI2NTA4LDE1Ljk5OTkwMzMgMTUsMTYgWiIvPgo8L3N2Zz4K"},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8cGF0aCBmaWxsPSIjMDBFNUZGIiBkPSJNMTIsMSBDNy43Mzg3NSw3LjI5NzM3NSA1LDExLjIzNjYyNSA1LDE1LjA2NTYyNSBDNSwxOC44OTYzNzUgOC4xMzE2MjUsMjIgMTIsMjIgQzE1Ljg2ODM3NSwyMiAxOSwxOC44OTYzNzUgMTksMTUuMDY1NjI1IEMxOSwxMS4yMzY2MjUgMTYuMjYxMjUsNy4yOTczNzUgMTIsMSBaIi8+Cjwvc3ZnPgo="},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8cGF0aCBmaWxsPSIjRDhEOEQ4IiBkPSJNMTIsMkExMCwxMCAwIDAsMCAyLDEyQTEwLDEwIDAgMCwwIDEyLDIyQTEwLDEwIDAgMCwwIDIyLDEyQTEwLDEwIDAgMCwwIDEyLDJNMTIsNEE4LDggMCAwLDEgMjAsMTJDMjAsMTQuNCAxOSwxNi41IDE3LjMsMThDMTUuOSwxNi43IDE0LDE2IDEyLDE2QzEwLDE2IDguMiwxNi43IDYuNywxOEM1LDE2LjUgNCwxNC40IDQsMTJBOCw4IDAgMCwxIDEyLDRNMTQsNS44OUMxMy42Miw1LjkgMTMuMjYsNi4xNSAxMy4xLDYuNTRMMTEuODEsOS43N0wxMS43MSwxMEMxMSwxMC4xMyAxMC40MSwxMC42IDEwLjE0LDExLjI2QzkuNzMsMTIuMjkgMTAuMjMsMTMuNDUgMTEuMjYsMTMuODZDMTIuMjksMTQuMjcgMTMuNDUsMTMuNzcgMTMuODYsMTIuNzRDMTQuMTIsMTIuMDggMTQsMTEuMzIgMTMuNTcsMTAuNzZMMTMuNjcsMTAuNUwxNC45Niw3LjI5TDE0Ljk3LDcuMjZDMTUuMTcsNi43NSAxNC45Miw2LjE3IDE0LjQxLDUuOTZDMTQuMjgsNS45MSAxNC4xNSw1Ljg5IDE0LDUuODlNMTAsNkExLDEgMCAwLDAgOSw3QTEsMSAwIDAsMCAxMCw4QTEsMSAwIDAsMCAxMSw3QTEsMSAwIDAsMCAxMCw2TTcsOUExLDEgMCAwLDAgNiwxMEExLDEgMCAwLDAgNywxMUExLDEgMCAwLDAgOCwxMEExLDEgMCAwLDAgNyw5TTE3LDlBMSwxIDAgMCwwIDE2LDEwQTEsMSAwIDAsMCAxNywxMUExLDEgMCAwLDAgMTgsMTBBMSwxIDAgMCwwIDE3LDlaIj48L3BhdGg+Cjwvc3ZnPgo="},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e){return e(r||(t=["\n ha-card {\n display: flex;\n flex-flow: row;\n align-items: center;\n padding: 16px;\n color: var(--primary-text-color, #000);\n font-weight: var(--swc-font-weight, 400);\n transition: background 1s;\n cursor: pointer;\n }\n ha-card[bg] {\n font-weight: var(--swc-font-weight, 500);\n background: var(--day-color);\n color: var(--text-color);\n }\n ha-card[bg][night] {\n background: var(--night-color);\n }\n ha-card[bg][fade] {\n background: linear-gradient(var(--day-color), transparent 250%);\n }\n ha-card[bg][fade][night] {\n background: linear-gradient(var(--night-color) 0%, transparent 300%);\n }\n .weather__icon {\n height: 40px;\n width: 40px;\n background-size: contain;\n background-repeat: no-repeat;\n flex: 0 0 40px;\n color: white;\n margin-right: 16px;\n }\n .weather__icon--small {\n display: inline-block;\n height: 1em;\n width: 1em;\n min-width: 1em;\n flex: initial;\n margin: 0 .2em;\n }\n .weather__info {\n display: flex;\n flex-flow: column;\n justify-content: space-between;\n min-height: 42px;\n min-width: 0;\n }\n .weather__info__row {\n display: flex;\n align-items: center;\n max-width: 100%;\n }\n .weather__info__item {\n padding-left: 8px;\n display: flex;\n align-items: center;\n }\n .weather__info--add {\n padding-left: 8px;\n margin-left: auto;\n align-items: flex-end;\n }\n .weather__info__state,\n .weather__info__title,\n .weather__info__row {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n "],n||(n=t.slice(0)),r=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}}))));var t,n};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleClick=void 0;t.handleClick=(e,t,n,r)=>{let i;switch(r.action){case"more-info":i=new Event("hass-more-info",{composed:!0}),i.detail={entityId:r.entity||n.entity},e.dispatchEvent(i);break;case"navigate":if(!r.navigation_path)return;history.pushState(null,"",r.navigation_path),i=new Event("location-changed",{composed:!0}),i.detail={replace:!1},window.dispatchEvent(i);break;case"call-service":if(!r.service)return;const[o,s]=r.service.split(".",2),A={...r.service_data};t.callService(o,s,A)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"customElement",(function(){return r})),n.d(t,"property",(function(){return o})),n.d(t,"state",(function(){return s})),n.d(t,"eventOptions",(function(){return a})),n.d(t,"query",(function(){return c})),n.d(t,"queryAll",(function(){return u})),n.d(t,"queryAsync",(function(){return l})),n.d(t,"queryAssignedElements",(function(){return f})),n.d(t,"queryAssignedNodes",(function(){return M})); +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var r,i,o,s,A,a,c=f(n(1)),u=f(n(18)),l=n(19),d=n(20);function f(e){return e&&e.__esModule?e:{default:e}}function g(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function M(e){var t,n=D(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function h(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function w(e){return e.decorators&&e.decorators.length}function y(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function p(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function D(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var A=this.fromElementDescriptor(e),a=this.toElementFinisherExtras((0,i[o])(A)||A);e=a.element,this.addElementPlacement(e,t),a.finisher&&r.push(a.finisher);var c=a.extras;if(c){for(var u=0;u=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s(0,u.default)(T)},{kind:"get",static:!0,key:"properties",value:function(){return{_hass:{type:Object},config:{type:Object},entity:{type:Object},weather:{type:Object},custom:{type:Object}}}},{kind:"set",key:"hass",value:function(e){const{custom:t,entity:n}=this.config;this._hass=e;const r=e.states[n];r&&this.entity!==r&&(this.entity=r,this.weather=new c.default(e,r));const i={};t.forEach(t=>{const[n,r]=Object.entries(t)[0];if(e.states[r]){const t=e.states[r],{state:o}=this.custom[n]||{};o!==t.state&&(i[n]={state:t.state,unit:t.attributes.unit_of_measurement})}}),Object.entries(i).length>0&&(this.custom={...this.custom,...i})}},{kind:"get",key:"hass",value:function(){return this._hass}},{kind:"get",key:"name",value:function(){return this.config.name||this.weather.name}},{kind:"method",key:"setConfig",value:function(e){if(!e.entity)throw new Error("Specify an entity.");this.config={bg:!!e.backdrop,primary_info:["extrema"],secondary_info:["precipitation"],custom:[],tap_action:{action:"more-info"},...e,backdrop:{day:"#45aaf2",night:"#a55eea",text:"var(--text-dark-color)",fade:!1,...e.backdrop}},"string"==typeof e.primary_info&&(this.config.primary_info=[e.primary_info]),"string"==typeof e.secondary_info&&(this.config.secondary_info=[e.secondary_info]),this.config.primary_info||(this.config.primary_info=[]),this.config.secondary_info||(this.config.secondary_info=[])}},{kind:"method",key:"shouldUpdate",value:function(e){return["entity","custom"].some(t=>e.has(t))}},{kind:"method",key:"render",value:function(){return v(r||(r=g(["\n \n \n '," ",'\n \n \n ','\n \n
\n
\n ',"\n ","\n
\n \n "])),this.config.bg,this.config.backdrop.fade,this.weather.isNight,this.config.backdrop.day,this.config.backdrop.night,this.config.backdrop.text,e=>this.handleTap(e),this.renderIcon(),this.renderAttr("temp"),this.name,this.renderAttr("state",!1),this.renderInfoRow(this.config.primary_info),this.renderInfoRow(this.config.secondary_info))}},{kind:"method",key:"renderIcon",value:function(){const e=this.custom["icon-state"]?this.weather.getIcon(this.custom["icon-state"].state):this.weather.icon;return this.weather.hasState&&e?v(i||(i=g(['\n
\n '])),e):""}},{kind:"method",key:"renderExtrema",value:function(){const e=this.custom.high||this.weather.high,t=this.custom.low||this.weather.low;return e||t?v(o||(o=g(['\n \n '," ","\n ","\n \n "])),this.renderAttr("low"),e&&t?" / ":"",this.renderAttr("high")):""}},{kind:"method",key:"renderInfoRow",value:function(e){return v(s||(s=g(['\n
\n ',"\n
\n "])),e.map(e=>this.renderInfo(e)))}},{kind:"method",key:"renderInfo",value:function(e){return"extrema"===e?this.renderExtrema():v(A||(A=g(['\n \n
\n ',"\n \n "])),this.weather.getIcon(j[e].icon),this.renderAttr(e))}},{kind:"method",key:"renderAttr",value:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.custom[e]?this.custom[e].state:this.weather[e];if(!n&&0!==n)return;const{unit:r}=this.custom[e]&&this.custom[e].unit?this.custom[e]:j[e]||{};return v(a||(a=g([" "," "," "])),n,t?this.getUnit(r):"")}},{kind:"method",key:"handleTap",value:function(){(0,l.handleClick)(this,this._hass,this.config,this.config.tap_action)}},{kind:"method",key:"getUnit",value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temperature";const t="speed"===e?"length":e,n=this._hass.config.unit_system[t];return"temperature"===e?n||N:"length"===e?"km"===n?"mm":"in":"speed"===e?n?"".concat(n,"/h"):"km/h":e}}]}}),m);window.customCards=window.customCards||[],window.customCards.push({type:"simple-weather-card",name:"Simple Weather Card",preview:!1,description:"A minimalistic weather card for Home Assistant"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=p(n(2)),i=p(n(3)),o=p(n(4)),s=p(n(5)),A=p(n(6)),a=p(n(7)),c=p(n(8)),u=p(n(9)),l=p(n(10)),d=p(n(11)),f=p(n(12)),g=p(n(13)),M=p(n(14)),h=p(n(15)),w=p(n(16)),y=p(n(17));function p(e){return e&&e.__esModule?e:{default:e}}const D={"clear-day":M.default,"clear-night":r.default,cloudy:i.default,overcast:i.default,fog:o.default,hail:g.default,lightning:s.default,"lightning-rainy":A.default,"partly-cloudy-day":c.default,"partly-cloudy-night":u.default,partlycloudy:c.default,pouring:l.default,rain:d.default,rainy:d.default,sleet:g.default,snow:f.default,snowy:f.default,"snowy-rainy":g.default,sunny:M.default,wind:h.default,windy:h.default,"windy-variant":h.default,humidity:w.default,pressure:y.default},E={...D,sunny:r.default,partlycloudy:u.default,"lightning-rainy":a.default},m=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"];t.default=class{constructor(e,t){this.hass=e,this.entity=t,this.attr=t.attributes,this.forecast=t.attributes.forecast||[[]]}get state(){return this.useComponentEntityTranslations()?this.toLocale("component.weather.entity_component._.state."+this.entity.state,this.entity.state):this.toLocale("component.weather.state._."+this.entity.state,this.entity.state)}get hasState(){return this.entity.state&&"unknown"!==this.entity.state}get temp(){return this.attr.temperature}get name(){return this.attr.friendly_name}get high(){return this.forecast[0].temperature}get low(){return this.forecast[0].templow}get wind_speed(){return this.attr.wind_speed||0}get pressure(){return this.attr.pressure||0}get wind_bearing(){return"undefined"!==this.attr.wind_bearing?this.degToDirection(this.attr.wind_bearing):this.toLocale("state.default.unknown")}get precipitation(){return Math.round(100*(this.forecast[0].precipitation||0))/100}get precipitation_probability(){return this.forecast[0].precipitation_probability||0}get humidity(){return this.attr.humidity||0}get isNight(){return!!this.hass.states["sun.sun"]&&"below_horizon"===this.hass.states["sun.sun"].state}get icon(){const e=this.entity.state.toLowerCase();return this.isNight?E[e]:D[e]}getIcon(e){return D[e]}toLocale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unknown";const n=this.hass.selectedLanguage||this.hass.language,r=this.hass.resources[n];return r&&r[e]?r[e]:t}useComponentEntityTranslations(){return Number(this.hass.connection.haVersion.replaceAll(".",""))>=202340}degToDirection(e){const t=Math.floor(e/22.5+.5);return m[t%16]}}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgBAMAAAAQtmoLAAAAHlBMVEUAAADL2/vK2/rH2fnI2vrG2PrJ2/vL3fzG2vzI3PwdWi7LAAAAB3RSTlMAFzNfjrze/OgtNAAAAdhJREFUeAHt17WC3EAMBuBZ3nIZOqcJVGGqwlSFqQpTFY6yVTiZrUJ3Z+tpj3ynBY3Hv6vDr5aGJMOYbetX49CtmsE1bxO9M7DcEVr02aDyt2nJvozxH+H1xPH01oAuUOyvwXRoxRUDKdCqAF9Qlj2XKAaX7TbF0EMqk3gNTiD+GECRBHaqR0lAnZSjMQG4ZVEDiybQFQm8ynjCrqwJzzIm5GkCvAU8oasSoL4QNXDPIgDLhjdfgSadBA9J3DcpKjTpFXiq4g3YSeIdWAbxAXx68ELcpkmDk9kSBvwnW2cw/zd+v6Ym4DkoQeIX7cOWJPGc0hx3SXBsJiWBQwmPhTXjc4kV/wv8uIoP/Wvaw0ro7Y4+a95ve5W1Od+2S6z4S1FgzdseOdYifuDJeMEOUQ0shHgLnCta7hI7RYnVy7PbbC25X12G0UwN6SYRWTsbZNmEXTS33126oXuCRb8eBUglJH5R+PiA3krZuSDBdD91TXaSmuOYP/6b/oXTGxh3MuXVYaf8SCmFnXbF2x6R9U2gd2G1hD6/qMNj341bYWjdEl/+HevkeRscs5qu2ZjcHav8qBmPvMr4Ic2NZeh4fbW0Yx7VkMvrRRl+P3w9vvn0yY0zO8y6tW0BcWLk3nu06KcAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgBAMAAAAQtmoLAAAAHlBMVEUAAADr6+vn5+fo6Ojo6Ojm5ubq6urp6enk5OTf399QNH53AAAACXRSTlMAIneu2P///z8+tLZ6AAACF0lEQVR4Ae2Wt5bUQBBFtfhwIgjxEOJdhHcRtigU4lohtvV2MiW4D1ijr11XpR76lKp3Y45uMq7uvPbq6j9mYmJi6fTD0Ly+PNtr/Zmg3Nvb3z8KiQ9eiFMf8HF343r4B+DDbvW/Qi5guVy/P2Q0QHuiKDwyAn6U6g8EK+BOOcAKH8sBVsDF4pBmYJv2vVd/JIwKCJ0jHHIEPPda5AnfnVUUPAEzZ4w8wZmKo8GOqvLVmTVPcDoRfKEdq99nBSRqakN4fbkzfXaFFd5JulmctgaJuQjAk/IgJeqeINxNwrlCixD7FShdYWFYIUZ8c6ehyYSe9R2GTf7GDRBhRRPSOdKWBPR9zVBFl6LfIkkgkvK0FP0ASVghloSobWrdAEmoiTThx2inAdMkYklANzKsMMIKEcWdBFy0E9cYYbueWBK+2KWBHMz7mraRhGWz+GAFIomIW8jqOOzUi7CyIsZOgggHvPbLBiKB4xbfsy2KMWoawGIiUGAlCbyFCjfgEhcCLU6dYwVhpy5F6B46AJc5cYIAFZYYHjLHKUGXq9+JSMh4rsJBV9CdoKSH3hF2hCHAnDTnSwHggdeL49URpB5Cdv14jDEYecKdqhwRkSfEWVWO0B6khLfZU4W9gJQQ8/vQX6c+xiHhZZVzDQ6sZlflLD3ECHFIoLv2QnCL/YT4ZPSiu2KrmcGM+qZ3lX7aj3D/VFdNTExYNgHAL10vmVlOfQAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAOVBMVEUAAADHx8fKysrJycnIyMjHx8fGxsbDw8PBwcG/v7/CwsLCwsK+vr67u7u4uLi3t7e4uLi5ubm4uLhyXqCUAAAAE3RSTlMAFkaMtND6////CGT//7BAhezMkbzxVAAAAi9JREFUeAHtloeS2zAMRF0JrA60yv9/bBQagS2YpOj05PiS6zvYURk8Hv5vOp1Op9M5ns6XawjXy/l0bM80c7oGIr5D4XrKZ4ihgCzTwPARKMFsHR/DS4axxWdKHM+BFNZ/qeN83GTwFdZ/imWKDMfTJZDBilZcTsfhniFmgPEKp0yREHS6vwK7jLCivQDbv2eYqFjgxkNiFHAevQKJKyJ4RpoKcNMbMt5yHWm83MZ0Q9ZMfLNANo90EvYAiNMmE9sLeH59KWdfkMtISwFjGQ8ZxkXACqSUiVItmJfbNJYXwzjdlrmeGVLmoHS6D1gh+gU+MNn8Gh+kmelf2QdeB+0+SOPcFbD3AfCdPiAd76/A1JkiNl4voN0HOl0/Ia6g6AIGqw+i4IGI1ApsfMUHOt77oKGADZkqPgBQ9kFLQdYHcDeo5APZLZA9HwA1H1QLWnZ9uw863QfExq/wATt+gQ88OR94uN0HRskHWUT2fcBFsEKkPsgiiZoPeIOe/fFYcYaJRmJCtEBpKpDb+M0Hog5g+6fEjQ/knYLMrvdXAJ9pL0DWB+4Ykcs0FVR2PYz4q30wdB98Gh8M4w/5AErFB7aEwO/6AHf0a9YHbsk1+cCf/e0L4HxAMMRo9AFW/BWkTw8fMPx8BTs+sLO/vwLWDiKvA/GAyz6whfa07AUVzAdbagWMxObsn+9wPmgqKO96ZCj4IO4VFM/+G+S7fLC366FIOROrBaVd333Q6XQ6nc4Xua9QVFRZEEsAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAALe0lEQVR4nO2cW4wb1RnH/+fMjB1vdjfkssJbVtAmTTcNIJVeRFFVSF+qKg+tgsRbqcRDxRtVBVXSIiFBpUKkipa3XgKRiiLRUiWt2oaqElXghXBRVKhALJCFJJvdyTrJJnuxPfac8/XBnt1Zey5nbvYs9U8aOVmPZz5///N955zvnDEwYMCAAQMGDBjw/wjr5c0qlcpO27bvY4zdCWCvlHJS1/XV94kIQghwzqcAvEdEr+u6/uLY2Nh0L+3sJZkLMDc3d5Ax9gDnfDLJdaSUU0R0dHx8/HBatuWBTASoVCo7hRAnkzrdDynlCU3THvk0REaqAmTteKCVpgCAMQYp5ZSmafs3shA8rQuZpnmciM5m6Xw3RATG2CQRnTVN83gv7pkFiSNgZmbmnkKhcCq5KWo4EeBFs9ncNzEx8UqvbEmDRBFgmubxXjofaKUePwqFwqm5ubmDPTQnMbEjwDTN93uVbjoJioL2+1PlcnlPj8xJRKwI6KfzVWCMTZqm+X6/7VAhsgB5d74D53xDiBBJgI3ifGBtlJT3EZKyAKZpHs+D88PyvxvGGDjnB/LcMSt1wr0eagYRRQBgbdTUaDRyOUTVw09pDe+yNSM7HME456fQ4+KjCqEpKO85VBVN03L5XQJbRKVS2UlEZ3tljApRU1AnnPNdeaodBUaAEOJkrwzpFXn7Tr4R8Gls/Q55igLfCMhbS0kTIcQv+22Dg68AeRjzZwXn/EC/bXDwHIbmceKSVvpxrjU7O0uWZaFYLAJojZK8Kq22ba9boxZCnE5zPuHZB+Sx5JCmAAAghIBlWQCwTgQV2qtxJ2zbfiapGJ4CzM/Pp/ttE5K28x2q1SqA6AK4IaIp27YfjCtElwCf5tGPG3cEAMlEAFpCxFmf7uqEbdu+L5YFGZFV69c0bdXpANaJEQfG2KSU8uzMzMw9UT7XJUB709QABYQQ614BwDCMSMuiXsPQvYktS4msWr8flmWtc2YYTrpyXp3Pcs6fUhWhSwApZS5GP712vkMUETojwN1/cM6fUklHXQLE7YQ2Il7ftVgsKovgFwHOq2EYpyqVys6ga3j1AaE3zppetX4/Jzudc5gIfhHgFjaspJPazri0SOJ81lyGPv+G8vleEdA5GgoSISwChBBgjE0GpaIuAfqVe9O49+bZl6DXLiqf7+VcJwWFnef+u18EOK+6rv/Wz4YuAaKMAtIk8UJLvYKhCycgeTH85BDc8wMHL7+oRACAwCjoEqBdeOoZRJTY+UQSI9PPA7IBSrjsGzQh83NwWAQAgK7rP/K6plcf8F5Em2OTVrorXv0PigtnAF5Idp1i0bP1uxFC+DraTxgAYIx5lsC9+oDXI1seg9T6GruG0Y+fB5jSBo91dNaCVMsRcSIAaG3v6bxWlwC6rr+oZEVM0kg5boYu/gO8Pg8wDWBAkkuHtX43XpGgkKK+3nmdLgHGxsamsxgJpe14ANBqJoYv/g3QknW8UVq/G9UICJrces4DiCiVjthxeiZDWxIY+fAIQBJrVXX1+3SOaqK0/s7rqEaAV6HTT4CjsaxBxk53Ubz8OgqL77k6XnIdEa4T0/FuIkRAV6HTU4Dx8fHDbkdGOXpCcwWjHx9zOV8iquPd68FpENb6/fAtRRDRibSMS5uRC8fBmtcAxtByfjSymmwGDVHbdA3xfQXQNO2RdM1LB235HErmvwBuJLpOZ+vXNM3ziEpQBHgN8X0FaI+GejorDkXaGP3oWbTSTfwZb+eIR9O0QMeF5Xav4ajKCAgIqYZqmra/X7UhL0qXXoGx/CHA4rd+IYRn7vdyZlheD5qQeQkphDjded9AAcbGxqY557noC1jjOobPv5io3NDZqsPSjF9aCjucz7pfhRDw2roSuh5QLpfvzUMUjJz/E5i9BLAAkxVHoaq5PW4EeLV+v4astCAjpdzXTxH06x9g06VT/q1fwfFe67ZhRM39QSMg27af8bqHkgATExOvMMYOKVueJqKBLWePtIecLiLMu+I4P63WL4QAEU357ZxTXpJsT856Pioqmf+GVj3f6niVnO79ZtS0k1br1zQNtm0/6He/SGvC5XJ5Ty9F4NZVjJz7I8CLCk5vHZ0rYu4hoQqqdR3V16DWDyg+JemmXC7vMU3zfcZYtvuHiDA8fQyQVksA/xPX/sl0bKpOw756BpqoQhID5wHzBQKIcdR3rFWJHcHSaPlCCBiGsT/oayb6sY4sRTAW/out7z7Z7njdZoYlfdE632uBprNWRTYa+g5cu/NXXZHi/D/Jq5Qy9Nnk2NtSyuXyHinloUxGR3YdN5x9trXIAkC9xyWsfiWy1w7ZPqjjEBau726l587Uk7TlM8YOqWxZT7QvaHx8/LCUcp+zzz4thmZPgtVMlwBBeInD1o51mrn+Li2s7PgmxA1fWJe30+gDGGOHVH9cMLVtcKZpHpdSHohTwHJDi+dx47uPt1qop3mKZeeg0jhJEBjmvvwM9KFt696K2ml3flYl7bhJbWdcuVy+1zCMXUQ0FTctEUmMfvScj/MjLLaErUvIBi7f8gBQ2AIAiSPAGesbhrEr6pMyqW5NHBsbmy6Xy3vaQpyoVquRau/cPI1S85P2/wjquR8tpztHELIJa/Nu2ON3Q9f9C3CquZ5zPiWl3Fcul/fEefa4Zz/cWqvVJovFon94Nxax/cxPoMmaullxVuCkhUu3/RxydJfn6MUh6O+WZaFUKmX3kF5WdP50ca1WWx3Gjsz9HdvNv/iXmtNY7pQWrm37FhY+e7/yLvBSqbT6iCrQKiln+phqLzfnXvz9dwAGlAz27a2jdJIxaBGXdtVhBCnIPHfj9w8sbb/rtE6N1bf27r01o5t6mNEhfF+3p19Z1mBrQ6Wt24ynGCg754OAZg2V4TueWPzMV08zYwWi0Fw9+kn0/XwpUhi7GcOYfYjJxh3pZ0N3iQKo1vhr1+ylI2z2bUDU15/6+S+lfG91+puC3nzu1psuHHsTTC91lZv9CDWv4wQGkBDNTy7p91xvFl/TZPcOuNt//E+1e6dAZwrqawSMXHj5B8KSF8GkHXYutRyr60V9F9Y1nDBFJKpL9d/okr+2Vbdy95tl/U1BK3M/Jc4PEqnt7eEG2wFGF0DYFH42ASTQxOYL5me/94QEA8uuk4lNXwUgrktAhKd/ArjBoRU5V0pBRK1rSoEFy/jZ0t67LnPOEXX3XC/oqwBKEMB1Dq3A4f/4i/cMeHFFf/nSkjimvfprBKq8+w/p2BqDfAtAANcZtKLH7uewH/C2m9ZKlR7WySJeS7damyb5FcBxfsF56iJK+iAssvLTjdHi2yMs+t7RXpJPAQhgjvOjwgC7bn0w+8X7n2xs3Q0uwh+8mIhhYlrkTwACuBbT+Wg9rzG/tOlR8fEbS9z8EJAK1didt8e6VxrkSwBqLYKt5fyIMKC6LP56pT78Zzr3Frjvok4H+x+Od78UyI8AbefrxZjlKcZAtr20UhMHbzCWwHI35fImNwIkcj4A2HVc3nLn4crnvjGle5Qb8krfBSAAjDPocdMOADCgURfvLAwNP20P3wRh11KzL2v6K8Bq2knmfBJSzC6PHqpdf6fGP3kn+jVuuzv+/RPSVwEYT+h8ACCJ+krjBbLppc1MADJ/5YYg+ipAsRjzUaPVWTBB8KErlS23PcqGJWKOXPtKfyMAlKw+JptYYNsev/KVh85pFH9l6+YEJiSl751wbBihahlvXl5Z+Z3+xlHEeVx1lVt+kZpZUdm4AkiI5To90rBsS5t5q9/WxGZjCsCAap0fbUr26vZSHXms86uy8QRgpAvB5mcmf/hYs7gDjEJXM0O5KQWz4rLRBGAgpl9dxGP1WmMOrK6ynJxr+j4RiwTDZqsuTprV0SM48wKYs/SYlK99N4WLxKOvAiwsR6z9MCwIgUPDhi1oda//gAEDBgyIyf8A4n6spjurxDYAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAyVBMVEUAAADut0371Uv92kX920b+2kL92T/CyKz92j792Tvvs0jk1s3s4+Hl4d/r6ujp6Ojr6urn5eTk29ji19Po4tjq6urk2tb81jvp6en60z3r49P32Gnr6OHz1pbo6Ojr28Dj4uLm5ubn5+d/xLn8tl7d3d3/sk/k5OTa2tr3v3jh4eH/sErW1dTh4OD/r0f/rUXiwZr9sE/+slD0o0P9qkX1pEIP3/kL4f0q6P8H5f8A5f8n6P/6p0Mc6P8P5/8E4f0F5v8C2/sn6P8h4jSJAAAAQ3RSTlMAH1+bzey9Bf//SR1mpNHj8b5fNZP/T////////////////xH////////////l////0ayG+q0o7k/4/07PPNek3pNP7VonwQAAA8hJREFUeAHs0gWiwjAMgGFWDzBfmD/uf0rcgqV9bv8B8i3NJv/92CIhldZGiugjpluh3SFwWtj3nj/V7hwA6On7fr50jgLg5CuXmM3jJM2yJI+L2XGEVY4Cu1S4YMsqw8vi0pL5BAgXFhnelBV2Iuv7AMig8WWK92rSqm3b2tV3AAi4tM3xfk2DXX8WKKCt92lTfARsGs4CBUD4Pk+Gj4Ft41a4A2jP+YgMgESAc5HX+2Qs0Lz0FwKEvZFNkQe2d6hrAnj/qTn6AM1y+7feAMbnACxwPjQQwO/KqS8wbICNABAGLNj5ZIUaNtXnDH9hDiArbAmS5C/AAmQFWl0LDqhCACQN3XLsIw7ImPlMmK0pLa+FxUEgjLp7Y++9TRjSg255/5f7vwS7IOO55xyqZtD+/Ig/qkMBQDRZfQrMvHYCG4EfTNvfHgEGRopZkyxAo9gbmHr8hyRFgUkUQKH91TPekD5maZrmrIlEARqKL5H1R1lWFEUa3CW6sfoqkJcIgEoemLTFW7QhPmY2kCpxgAbSQ8YG7RIbSNMqJ6GfxsJrilFcwm/qQFUplgaoL3to8Ee135zqgFI5SwMz0U8FNkgl0DeBqg6gIPJ7bmp74jhhYwNpE8AaZIGp4BDsEzAPARS8ayAQPuX52xMwT4G8hqWBwF8mxuijeQl4C0SCLQKrx0F4Ao4A0OHAwhNonx/GcGkeAwoBX4FemXn/9u/z15HxBVAIBPotH8PrCDyB5wAKwFkg8pyxf5NI89G8BPxrkO8Q6E+sP8qeAk0BCYst+BfQ/vj1xXUAT+CB7E6pVPVcoDdWge+7Cv6jeeVPgznd3rT2BYatAP0z7zK3/+8/bFadQIDJ7Z+2WyHaw9KlB0kBbICZyeHfhP3gl1MPotN1BVxDb34ehv3gv0sPylMTUKoJAE1P6POqJeG3yw6yUx24LsBCd/LzrC3yxw65PWEEmgYqL5yni1n/p726QK4YBmIAqgwFrvEHC/kc5vvfqejOZjregrXlvgsoYFl4o0Pud4SN7DL3OsUwEZ9yr20GG8eTyFfOUMQxgq2e/7SBX1GWBR2w3aofqKqbpm6pgO29Dn5986APDtg6kVKZunlQbxBk+0SrwNA4AxdwivUP5PRUQAa/UQJGJkCtwCQBExGgVgC1BNQIoXwg40/UQVVIQBEeEEE3N86MIFIBRewS5hhBpAKqYizLsUAg5Q/bUSpgR6mAnW2m7JeVTtkvMxGeWWS/OMR+Mdj9EsR+Mbj9EsTlTKL3SzD79fWfiNgvGrFfgtgvBrFfX+/fLZ2VqOfdJyPAAAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAllBMVEUAAAC8y87X3OnY3+zU2OXN3/3J3Py5usLW3+7O3ffF2Pnd3eLl5efp6ern5+fl5ebq6urH2vvp6enj5ObC1Pfo6OjU3vLt0rDk5OT7uWfb29vh4eHxw4n/sk/p3c7W1tb/sEr/r0f/rET6qkfqokj3p0b0o0T9rEYR4PoL4f0i6P8H5f8A5f8K5v8J5v8A4v0C2/sC2fne7Ib2AAAAMnRSTlMAF0uOL77/B6Po/2HG6v/f////tf///////////////////9BMrIbrKu5E+f/bnqaTqTOwt04AAAN7SURBVHgB5JiHdqswDEBZwWQgUxM1zNL5/7/4HB+F+hAbqxlnvftG9721lB3918RJmj1Rn23yPI+fphdFfkY8bTrb3PA0/y5/akDQ73/3iLJ9cSgB5CHdx5FFQfq7liyytKwsoMjm7sscSG72J2S3KUm3yedCcateVi6UTMyGX6hw6xJEXblRqipElOysQnqDP5aVL6CRcXqkwo1rzqBaCyjcHu3C5s/+yo8yVK924eWPe45hLUDsTEEH/l4QsmIEcGcCdIR8E/MDdcUJKDhSgUgFewG8gHqlwoW8SGJORHIDaAUIztUu4fjtI1iNnSa0blHyA+qo2Rn0G3ovY2yAG0B9hCVpFCBl+YnlF+F1G9wye0JuqnK/nshW1eGAQiyTtcDea0eNYvg1tfjrCpTCUwMAyAug9BcOHn/Tdj2ngKGCdAYQhrHr+kYXkBXA2hcAt/9t1AHGGXDGt+nGGWhaHTAFdqAU7BEphNNIgZ4dwD1vyTQgzWQCDTL9WDIvpspseBzfKQDcAMa8KxoN6P0SaIAbcM8ou/Y3rdabQK8DVAj7sXAGROO4CrxbASowAofwEmjD77+BxgAcv2/L2dVV4N0OUIEVCN8hqPOG3x0BZwEX1J5AoixoQFaAgHAg9QSEtH4GhndHwFnAJfvIQ6YuAA3IMSIqrAXiyEdx+QmgDS8upgSs+yXZ/ENCoAHZAeeU+BMi4t74zYaXAYIKfn8ZeIKj1DwgYvxluCTA68ckWi/02n96X/JheH/rrYI7UISfBNKAln7N0M37BnT7D5yXaga3/rOdOo0JAAA6/SIKkzn1mtM0UQDO4JUfiojDl1v/OUznQE+BMwu9TFj+76WdGCfrANeFRu4jFsJhpwMQnYU+j/5f1vSKD4efpZn4115dHEYQA0EULZ0Ux7AY8g/ObLep56Aye18A/RendnyMVbl/WHwIe0zvW/Ex9llMz2xQWIthk5i1M857xwf0DyjElGLgA4t2P90JbGA2eJeJ6U40XGDe8b6cHmQiMM/zYfUP6EEYDMx3VryvSKBgxHxvgyJLIDMBC0WUQCQCKzRVAnU8sEDlJODGAwa6lh40DAd2nGnUfah/AeG6991hPLDiM8lf4NMC9pMD6+l+8Zbz/eIZZb94xH4x2P0SxH4x2P0SxH5RyP0SxH5xqP0SxH7RiP0SxH7RZL9+l4tr2oowXbK2IEgAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAsVBMVEUAAAD0z2L93U/93lL93Ev81D/93Ef+3Uz72k75zEP93Ej93Ej920X920P920L92kH70z/92j/92kP92j381EP92Tv92D7+2Tv92Tn70jf810L44Yv15afx6c3x7uTv7+/43G371Dzu7u792Dfp49zcxLbt7Ovm29Xs6+vp4t/x8fH70jXq5OL5zzT4yjP4yzPq05fyvzP4zTP2xjPvyWD0wjHo3L/2xjD4yjLm5eTkxIAPtip5AAAAO3RSTlMAF1V5o7zT5foJl///////R/9w/yT//+L/8v/////////////bL8tJ6Ib//6P/nP///9P//1f/deP/x8TGymgAAAPmSURBVHgB7JSFduswEESfGSSHE7Nkx4///wPrVVm0ktvDuaWDczOzOv3x4MEDZ4IwipM0y1eyNImjMPjG8CIsU0JoVe12u/0LFUnLsPiW+EOckwr4KDgCVR4fvvzho4zQFdlwfKHKTsXX480CIIs2K0KIf0G7EXA+H7NwU/wlIYQ6CFb2yWXDx88JEQZko7Mg9y1RlIT4CK7H0usSQUokAUUE11saeMyfEj8BGK7pxTk/I1sE1/rinr9JAAb3/X1vIHC5Q/Ga7/eKXg0FKijJZgFQYvkhIfaFEME1RA6cY4K9XdC09kMnUj66kCJoki0D+QhsIxWZnI+fQBE0dWEURJTK8WoBVNCczAWohPdCIDBXOJmy993685qPC4wV3guQfhgZ45yN49Dn3cpegC8kqPX5B/pM3o+Mf2QUjv07R0TQHLSCmAJkYFyBDa8KfCEg1p44h/yecS2sh6GwAq+CVnfmENYZuZFxAkOHLwSEGkFJu4lxC2yaRYsjshBQagRp1d+5nX4GBbYQkKr5Ae05gBpuN3yhZgnURzrdOc40zzcwIAWaRX2oEeMOsGcDJliWkyL4yZ0Y5xkUWIFFufIv7kgPAjCcrYJEFvx2FbBcGJACi/yM/nBnBhA8A/kGQS0J/roLWPdqMBUAQYtcALsCKK4A/FUKAJ8F/7gP/wHGxmGCMk2jFAA2LyT/GxcKuYA8UcA3cx9moZAL1E/tmYVuI0EMQKfcFa5OWG4nrInHy3D//2Fn3ST1MjnivID4PXkZGtuQgI9nQ4lV1c+bKa8CAZ9UMFxwgQdV5SgK6M9nMIakzu+wjd1YgNb6A6lQD/wRb0TsJwI0tJAoQX6HLw6wn/h8QbeQVmdu5IuI/cR76ApnIlXjKPXrzzAGDrROBwehn0iosOJE2jxYS/20jGJkf/PC60bs11kcIxesarCX+vUHBbjgqwYHqV9/xlQAMHykq7GR+V0AEU6FXLVYC/y8iMAVum6hdiI9kZ0nMMYNIBlBdxBwoPBUBxst0BMJBYAwBlLVyUGi1yX5T4EH1cN2oZ6XEIIB0/8w5Ga/QM/HOgp0LyBmU87X8wCngFUDbPaz7Ez2O0DkqSFu1vPtxEfoBiD/jRrGO+rJcvYnZ38x4bHmZq0nm3n5uAU06Gd2az2DMvj1R9P8xOawn2h3evJTgJf/pMbfICuHybIgYT1aT80jDYchN4ExEgAv6ZJXLORogW0AcNYrFiYtTk73h51yokjVQry8qGoBoYWBIuelvyiBVRthKgj0jG9j/C83TeDF+uoSeKmNECnAFQCMbOqpy3Hj5/YhKl4QX4roweb+jZrKlStX/gHY0DfPBrPHXQAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAS1BMVEUAAADO1fHO1ejZ4fLR2ezd5vbB0vXDzufS4vzP4PzN3vvV3fDk5+/Ayerc5vfu7u7v7+/t7e7k5eavwOrT2OO4y/DAzOi2ye+/0vYf7YBFAAAAGHRSTlMAByNNhqbMO////2bRFP///+v/////9qxLSnpnAAACKklEQVR4Ae3U2YKzKgzA8QRBXECgdTnv/6RH+2V2LWLgzl/n+h8NOHDe7XZDUUlVY6G4Vk276voi9cps9U2HkJ1QW51UpfKkg8ws5Uu9QP+ZL3IC1rS/KMhJN+1vAjKS1C91xKr5O0BCNqianQE65/PvDcC8/abcEcjmpdglrf72s37Gdk1TvcxXYNoDFrLo2yOYa0FHIAvVlh0g/mS7f3INqFuyMyPnC3R7cp0A5YfB+Y1zw9C9ILAhxVuKf3JDngFV220TBr9j6CywmW43T3rgst3K+UMKgUd3XePfCQJY1PF6iNPAEe2vOBOw8XGOsSXt/AkB4SrjT1FwkfYnVSVfgLGkyvuyrxD8aQEuED6BhnTSJwtG9YK/oYjQ8zcUEap8d4jxb1x6DhOfoDyDc/EJhjfAKYgIrP6qKjfAvQQstSJH+kKH7D6EMtfUfbElPjRH4juyzH78pgZu35nsh+DIuVMWvH58ABhWP74i0Ix85JCJ4fVdDxHaMfIrATGSk/ePZy0rYRHhEJpLeTI+N9NqPpxhw6U8vcDnAAuHxCM9T+aP/KThDREu1GlBNEHCW9ak1cnjcz8LRKB0iXHqr2J9oo07Wybjn+ePj0jwmFOen2gZ0vLTpocUQo7j471xpPr6o/uZBJdnFMVXtYV0ejqtgktwmU5ZEK6yy/Tfron+1t8igGQdQabFAhfq+ihfa4QsUMvp77NTPRe0ul+Wep7rRfbaJsRvt9v/h4jJKdZPEXkAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAATlBMVEUAAADj4+Pp6enn5+fp6enp6enp6enq6urm5ubm5ubg4ODg4ODm5ubo6Ojc3Nww6v8Y6P8T5/8m6P8H5v8A5f8L5v8N4PoF4f0C4P0D2/uDNJb/AAAAGnRSTlMAE2SS0e7//7smT/////0a6ehI///bMaX0k6g43vIAAAKLSURBVHgB7JjpmuQgCEVjiBdTgu//trMPX5uuoLSzT5/6f09xyb6984eTdjoymBm57OmHpxO4A+VHOs6DXwHOjx/17ws/A+D8Q6Ygfg4+wWU9/2BHAOTVejL7AvC5tF2+Bz/AkNgBxtsNeU7AaXG/jmBp08SzAqYfvgDLXyipjAVLJZ0cEeCMbzgmyD94A4wrtYooM+dC+8w4FBXIF4PiM6w0dOSogJsJPsOUflBDRm0iYgJV7J7gERdIq51AlX7AWdwLai/QsngZ6tH2ydALnBlyXIBPAjPoN273oMF8E0gvQLoRhPNNIJ1AKS7AQCCdQM9oRRgKxPKdEXI8X7/ni7wUSOwwxT3SqhlURx1ROB9i8b1hn79UwKW+FMhoCQnBeMDyL4YytWUM0YvADPm5gBAItxtOhy9ICFJNYLgVbQeM6ACGe7FIigBcvwf2Bu+CWhDA4lRE7SfSn2g9STCN2u1Yr+TtFtLQADcC2u45fkC+pM0hBwpSyx8NEF+Dky9pczklkv9aII9tQGqT/YQLMg55e37ZZqDq1uP0Q9MfQ8T5/zrfv6M4quKCheJpvlAKfpDK1VvGJb1ZfMTxoNJaHdEmX6He+dheXR04DAQxGO7ANFrqv9DD1eyBSWH6Hv9wDLpB/TD0m2UcWWSTfZi2CsCimuzLtF4AgEXTW9WvFXxhkQSrwp8CtIKKRRDNxZ8Fn1hALIJkLrWCbywgFkEwF1hALCAWQTaXa4GbL0f/RXDz5eiDDDdfRMW+oXhBNV9kBcbXesFmUcSUc4pqebkfXCuxCLhWWhHMrNWEL/NF1tZKKYK2VkIRRLi4vwgSXNpfBAEu7C+CDJf3lNv7i85+kH2tzrloeC3ayx7vgDWcARqOBsEAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAARVBMVEUAAACy6fHl5eXq6uro6Ojm5ubp6enq6urm5ubi4uLj4+Pf39/o6Ojh4eES3/kP5/8k6f8M5/8G5v8A5f8G4f0C4P0E2/uRTESCAAAAF3RSTlMAEFuV5P///8EbLv//jCngQ/z//6X0kyzJZw0AAAJ0SURBVHgB7NYHlqQ6DIVhOejKLsv7X27ndj0KrELAm/zNSZPuTz5Nv7h/QkyZISLIJQa6WE2QBZR65XyWFUi+0TVCkS2A5EoXSLINAKTQaVmMAMCBTqksdgByoxNuMocLClUMGCodxfsCEs7fXzMAPv982gEkOiDs34dU8iuOAPL5J8gO4EZe2RfIl5/Ao9aYVURySX3P6SRvgD8KineiqdIT7A3ICHyQFMgSXPvjGvEIqCKSIfoD3NoioJpOvsXrQFsGtBx9y7BFVwHrHPhYYBT0S6QJde8D7R0vAwi07cA+f+wzLwKa/AHMfAV4EdDqvUSY4XYv6F068sPK/Cn6BL1j32MK7DgDZv2Pm+dFgx3gQe/i/k8FTK2tCsZNCHDOA2P+oVB2vcp4StukkGlTx2rcxo0f2IEKH2lfBeXBvERU4LKaf2d+LKrCQcfgqhDpilMYc8qs49fHH1WaCOw7AcU7fcQ01RV78TzQaa5csM+VDNlxgXS1bz5Drttg7HMg0409++sAR3oitP3XB+q5w0Ph4/uF9uhWgY197rRPKGwcv/qv/1otrJv777C5zz2QR+iNGXMP661Xcguxl9yeyqXH+tpeXWQxDMNAAG0OYBL4/jct+ikrOS+acvvXEzDO4SP95VIynvHVRtTqVoa51fj7t75Qic8o9IWl0VVbZhm+sswehYYyyfBQAhNEproZNvsnSciIm2EjgRkyZTJD8TlSMupm2Oj7TVEmk90MGzfj6zT0SYaHkYl8gfs0Y++PyKIqGc/8fV/HIay/YEB/AaD+WoH9BYD6ywNczsAM4XOE99d7ThHWXyu4vwDWX4Av7K+/E4vvci3LGOUMAAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAPFBMVEUAAADZ2dnl5eXn5+fo6Ojm5ubp6enq6urg4ODm5ubQ0NDBwcHo6OjExMS9vb2/v7/AwMC8vLy9vb23t7ftsDFCAAAAFHRSTlMAEVuR2P////67J0z///+q+4HR+IsFiaoAAAJsSURBVHgB7ZWHYusgDEUlY4lhsv//Xx+NGtrEhliJ3vbpXvdUAwwbfzg4uJHYe88hDmie7tjfwdHSkUa/QJjABox+CWY/mlTh/DJc8BHeZvRtQYHeLAKz7wvYp7em69uwgQF9B668bqB1Ao+m850LmGz3cy5gZzyAKnhr0HFdvjDabmgVvLNJo04Q9BPQCTgEouy9D9G5NeU4ZT7T1ZBl5vm5I2sF/iYQvEODHZ31iKqgqAboMOgF0qMqKDiDU3wvCPeCHPVL2hHkmaBXA2nzRVAN+ZPhpSXiZcIHdC9gbAheyKdrPlEVdJukz5cKKIghV5K2Rcz9CgqS3y8hKPPrkK+K7wLSrSm3oWu8kIVOj5w6Xw4azQ3D+quCu9zyhWdDQFbFi4AWDXHVUeanZKlgZmg9rh3z2nCBJH5uaAiQldwalKnSbRGMrOIhXuheFolYQa6BM8MADSIrIApEWQT59iKGBA2QdAVk+ewRgiYuKwpoChy0GQ3yCaFDUDQoS76mgNVj6OQTQpdEmvy5gAZ4Aob1/VE3SBjp9fwIa3A9A/X642AdGKnz/2d9/+fgSJnnSCgv5pND0IAuEHGbh/Qg8TpwcjE8Z4xuSLCx8YewK8DPZF/YBL9DgGlJkBCsOBwP+CjA8k0wIpXU3elecDqWzxLYcN5/cJy+BFOJL5zBiJMYzkkE6Sz5J8MpH0Rx/XCQeBmLGUn6VCnVWDNdpIp94TKBPTKK2vy/TlBXs66s8LcMGQ+fmy/vZGXRsPkS/3XQRGE2Csm7fL8qLqZXRaqbI4K6UWZzOOyXruv94U984Pz5z+RNcCnAxsYv5gcBJmV5WFk6DwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAYFBMVEUAAADT3t/h4eHq6urp6enn5+fp6enq6urm5ubG0NLLy8uds7bo6Ojj4+Pn5+fh4eHe3t4U5/8Y5P0B5f/ExMS+vr4K5v8D3vy+vr4A3/28vLy9vb29vb29vb3BwcG4uLjMVSTuAAAAH3RSTlMAD1uV0e7//7ohOgX///+M/+g6//3/252t9H3R8/+TcABA0AAAAzBJREFUeAHsmAe6rCAMhUWGBO8kwf1v9jbsSonM6+9fwPm/k1jpfnP+Y3r7cICI4HxvXp0+WMAd4IdXxj/wBKB7e9VsPF4BgO4lLSxeA5+gb45/PjAjAHDPxvEQ5gWATWN6wzQwGxp2bbAgiNzu8HR1AjQ3BQ+sE4Brvz7zArCtC0jnN1xKvihoG9KAGgG86TesE7gfXACAmYUQ0XkbaupYrUDGLwPFnZMtbl20AlwEEWtarlGEM+PIIouACPqcoNcLeGTeCD6xrXfxcQnjQUC++TG0hcZPw1aQ7eBuCmYDTST3QOp8gPHbsBeASQhu5Mt3PssiyA5JnR8b8GSglUF7nwFkG0QDUamCU+cDzfksW4HoLlOAXIMpn4WKM7LaeACO+ZGNoK9/VECVIDpKSzCgio8X0VyAZTslX7VlKELzBqJjNbhrQYDq8AgvG5gleYEBJXP+xpEdUfcAFbLJXzaRfVgMoi0QA2VL9oHqlQViHMnRMKQERlGBlrclHeEuSSBFAYkCOhFiWNueRZIFZMj+gCgGlChguxyG6wqk89kUfgK5LV/6roBxUIBivn7Dy4+4lOefyvddDYGz148k8yVUH4Zwej5CqXzuNcc5TJf5X8BlPgfTaTDBsUCaQ/oYhjtHasG7sYjz4aO9OtlyEASiMHwrO6xNBolYiL7/WzYcbKtP5tBmzpdxVb8zC4Ovh2HGTZnVyuB2eL2J1vinOsJBcf4cBRvhENqM6EaB7W9ge5vAejNZ3yTQaKDB9cgcChjaOULlx8jVjnYD5KzDpNVAi6tVcWot/DfAUsd/1UyHyNukqzRQdTbxM51klpDnmRwwuRiED5zlBiXI5USfv5LgCAo8FhpGGeNjQgVvsGPdtG2zRiE97no+ZsdiR8K4Be7tqL9JYFHrGagXmFvlp+mJ9QfOAhFKkcuz+xD1OeF2xxFzYYFlujRDlC7ZZOdcSxcJSuR56dLMgXTJhsRD9TZHUcCEEAZhaAAsQ/xnMJE4v7zgBkeABhJywWFCXRh1VL7gaGB3wSHWABOKaWAHQwPgGwTAGmDcIgAJI8FtApBZ5mOIoEputHKc3jfFjOf29QPQe5BuJum+4AAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgBAMAAAAQtmoLAAAAKlBMVEUAAAD81kP71UL71kD81kD81z/91z793Eb4yz/920L92kD92j792Tv92TcDye7yAAAACXRSTlMAH1Bzm8vn/wvXXbMnAAAC1klEQVR4Ae2XNdPbQBiEzeMujE2YmZmZmZm5CmhUhfMTojnXQbkNO12YmaP/El8u1r7S+uSvC31b76Pd907SzaWa9ccq3WPW6j3Hdq0c3rJJ9mLPNY6qyvfV0eknGvszc1z1UyXfL98+0rWR//QexwFQqZwf29gfASqXEomM9jtuDfArmkholV7jAFAa0LpoX6w+DgFa223+M0594OnchEIgADy/Xr9UO6cmFQOeL6sbsMcOPEQE1N4J5cWB59uSJkACgAf8Up11khKeryVgjgAUA/fppRB+l4Cq4i9Ih2SAxxYje64bvnwAHtgbidcbQLzTOVHIBBCwNwKMEY0sCe+kv7hHJGBmA9w1wEe5d1kR4AGoSCAYKoCCXFSvLvAi2Co/NQTUEkoEvJXvhRzBo5kN8F7MLAPQKAZ8w9SZqtHY9S7YgABbl3O1WUNhQIkWKQimhkBeua7ZYxeNGFiKV1V5nn44AtBIAG9CoJ9SntLtwwnQCCOIdR3n1aQQwADepnnVBBOBkdEoBLAR69QveRyAEYIPAjAR2o8ANCJgH54dBpRphOCjBKRK3CgGsJ8baUlA+hFgA/aRv0yNaAb2I4CA9T7WB4Wo0QcBQPCjEQHz4UUhaiRejfHsRwAAvHz9yY8ANBKvd2fuzwHyA8rf4cdzgPhEczBxAAD8BDJkRgAaid9MsWz3I+C7+H0vsBdCwPsUNCAxIFxVqMB+Coj87rPkR0BIyAOleID8FKCPLGhC3I+AGvIueuyyHwFG0WM384zXEwHYNmgD2xGArwdqD7f0I2BbDMjARksqG0EL2Q873gvobB3/dwBrCShuJL8cGbuGse0DyJGh9MGoPxDEx5bwQe2ifhmwDC6agualCaAz0i81N2VRb2M3daDt9ivNJmOP+j/QxFDmUCDaGH3smngtO0T+Rhe5Q8l+Vma29O/s2pTL66ZwXPvlla7Hhz7ietysP1A/ALZC9b117sbZAAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOSIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDE5IDIwIj4KICA8cGF0aCBmaWxsPSIjRDhEOEQ4IiBkPSJNMSw4IEMwLjQ0NzcxNTI1LDggMCw3LjU1MjI4NDcgMCw3IEMwLDYuNDQ3NzE1MyAwLjQ0NzcxNTI1LDYgMSw2IEw5LDYgQzkuOTA1MzAxNjcsNi4wMDAxOTMzIDEwLjY5Nzg0MTMsNS4zOTIyNDg2IDEwLjkzMjIzMTEsNC41MTc4MTU5IEMxMS4xNjY2MjA4LDMuNjQzMzgzMiAxMC43ODQ0MDM2LDIuNzIwNTQ3NSAxMC4wMDAzNzYsMi4yNjc5MTk4IEM5LjIxNjM0ODQsMS44MTUyOTIgOC4yMjYwNDgzMSwxLjk0NTc1ODQgNy41ODYsMi41ODYgQzcuMTkzNjIxMTEsMi45NjQ5NzIyIDYuNTY5OTE1MjIsMi45NTk1NTI0IDYuMTg0MTgxNDIsMi41NzM4MTg2IEM1Ljc5ODQ0NzYzLDIuMTg4MDg0OCA1Ljc5MzAyNzc5LDEuNTY0Mzc4OSA2LjE3MiwxLjE3MiBDNy40NTIwOTY2MywtMC4xMDg0ODMyIDkuNDMyNjk2OCwtMC4zNjk0MTU5IDExLjAwMDc1MiwwLjUzNTgzOTUgQzEyLjU2ODgwNzIsMS40NDEwOTUgMTMuMzMzMjQxNywzLjI4Njc2NjQgMTIuODY0NDYyMSw1LjAzNTYzMTggQzEyLjM5NTY4MjUsNi43ODQ0OTczIDEwLjgxMDYwMzMsOC4wMDAzODY2IDksOCBMMSw4IFogTTE2LDEwIEMxNi40NTI2NTA4LDEwLjAwMDA5NjcgMTYuODQ4OTIwNiw5LjY5NjEyNDMgMTYuOTY2MTE1NSw5LjI1ODkwOCBDMTcuMDgzMzEwNCw4LjgyMTY5MTYgMTYuODkyMjAxOCw4LjM2MDI3MzggMTYuNTAwMTg4LDguMTMzOTU5OSBDMTYuMTA4MTc0Miw3LjkwNzY0NiAxNS42MTMwMjQyLDcuOTcyODc5MiAxNS4yOTMsOC4yOTMgQzE0LjkwMDYyMTEsOC42NzE5NzIyIDE0LjI3NjkxNTIsOC42NjY1NTI0IDEzLjg5MTE4MTQsOC4yODA4MTg2IEMxMy41MDU0NDc2LDcuODk1MDg0OCAxMy41MDAwMjc4LDcuMjcxMzc4OSAxMy44NzksNi44NzkgQzE0LjgzOTA3MjUsNS45MTg2Mzc2IDE2LjMyNDUyMjYsNS43MjI5MzggMTcuNTAwNTY0LDYuNDAxODc5NyBDMTguNjc2NjA1NCw3LjA4MDgyMTMgMTkuMjQ5OTMxMyw4LjQ2NTA3NDggMTguODk4MzQ2Niw5Ljc3NjcyMzkgQzE4LjU0Njc2MTksMTEuMDg4MzcyOSAxNy4zNTc5NTI1LDEyLjAwMDI5IDE2LDEyIEwyLDEyIEMxLjQ0NzcxNTI1LDEyIDEsMTEuNTUyMjg0NyAxLDExIEMxLDEwLjQ0NzcxNTMgMS40NDc3MTUyNSwxMCAyLDEwIEwxNiwxMCBaIE0xNSwxNiBMMSwxNiBDMC40NDc3MTUyNSwxNiAwLDE1LjU1MjI4NDcgMCwxNSBDMCwxNC40NDc3MTUzIDAuNDQ3NzE1MjUsMTQgMSwxNCBMMTUsMTQgQzE2LjM1Nzk1MjUsMTMuOTk5NzEgMTcuNTQ2NzYxOSwxNC45MTE2MjcxIDE3Ljg5ODM0NjYsMTYuMjIzMjc2MSBDMTguMjQ5OTMxMywxNy41MzQ5MjUyIDE3LjY3NjYwNTQsMTguOTE5MTc4NyAxNi41MDA1NjQsMTkuNTk4MTIwMyBDMTUuMzI0NTIyNiwyMC4yNzcwNjIgMTMuODM5MDcyNSwyMC4wODEzNjI0IDEyLjg3OSwxOS4xMjEgQzEyLjYxOTA0MzQsMTguODY5OTI1NSAxMi41MTQ3ODc0LDE4LjQ5ODEyMjEgMTIuNjA2MzAyOCwxOC4xNDg0OTI3IEMxMi42OTc4MTgzLDE3Ljc5ODg2MzIgMTIuOTcwODYzMiwxNy41MjU4MTgzIDEzLjMyMDQ5MjcsMTcuNDM0MzAyOCBDMTMuNjcwMTIyMSwxNy4zNDI3ODc0IDE0LjA0MTkyNTUsMTcuNDQ3MDQzNCAxNC4yOTMsMTcuNzA3IEMxNC42MTMwMjQyLDE4LjAyNzEyMDggMTUuMTA4MTc0MiwxOC4wOTIzNTQgMTUuNTAwMTg4LDE3Ljg2NjA0MDEgQzE1Ljg5MjIwMTgsMTcuNjM5NzI2MiAxNi4wODMzMTA0LDE3LjE3ODMwODQgMTUuOTY2MTE1NSwxNi43NDEwOTIgQzE1Ljg0ODkyMDYsMTYuMzAzODc1NyAxNS40NTI2NTA4LDE1Ljk5OTkwMzMgMTUsMTYgWiIvPgo8L3N2Zz4K"},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8cGF0aCBmaWxsPSIjMDBFNUZGIiBkPSJNMTIsMSBDNy43Mzg3NSw3LjI5NzM3NSA1LDExLjIzNjYyNSA1LDE1LjA2NTYyNSBDNSwxOC44OTYzNzUgOC4xMzE2MjUsMjIgMTIsMjIgQzE1Ljg2ODM3NSwyMiAxOSwxOC44OTYzNzUgMTksMTUuMDY1NjI1IEMxOSwxMS4yMzY2MjUgMTYuMjYxMjUsNy4yOTczNzUgMTIsMSBaIi8+Cjwvc3ZnPgo="},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8cGF0aCBmaWxsPSIjRDhEOEQ4IiBkPSJNMTIsMkExMCwxMCAwIDAsMCAyLDEyQTEwLDEwIDAgMCwwIDEyLDIyQTEwLDEwIDAgMCwwIDIyLDEyQTEwLDEwIDAgMCwwIDEyLDJNMTIsNEE4LDggMCAwLDEgMjAsMTJDMjAsMTQuNCAxOSwxNi41IDE3LjMsMThDMTUuOSwxNi43IDE0LDE2IDEyLDE2QzEwLDE2IDguMiwxNi43IDYuNywxOEM1LDE2LjUgNCwxNC40IDQsMTJBOCw4IDAgMCwxIDEyLDRNMTQsNS44OUMxMy42Miw1LjkgMTMuMjYsNi4xNSAxMy4xLDYuNTRMMTEuODEsOS43N0wxMS43MSwxMEMxMSwxMC4xMyAxMC40MSwxMC42IDEwLjE0LDExLjI2QzkuNzMsMTIuMjkgMTAuMjMsMTMuNDUgMTEuMjYsMTMuODZDMTIuMjksMTQuMjcgMTMuNDUsMTMuNzcgMTMuODYsMTIuNzRDMTQuMTIsMTIuMDggMTQsMTEuMzIgMTMuNTcsMTAuNzZMMTMuNjcsMTAuNUwxNC45Niw3LjI5TDE0Ljk3LDcuMjZDMTUuMTcsNi43NSAxNC45Miw2LjE3IDE0LjQxLDUuOTZDMTQuMjgsNS45MSAxNC4xNSw1Ljg5IDE0LDUuODlNMTAsNkExLDEgMCAwLDAgOSw3QTEsMSAwIDAsMCAxMCw4QTEsMSAwIDAsMCAxMSw3QTEsMSAwIDAsMCAxMCw2TTcsOUExLDEgMCAwLDAgNiwxMEExLDEgMCAwLDAgNywxMUExLDEgMCAwLDAgOCwxMEExLDEgMCAwLDAgNyw5TTE3LDlBMSwxIDAgMCwwIDE2LDEwQTEsMSAwIDAsMCAxNywxMUExLDEgMCAwLDAgMTgsMTBBMSwxIDAgMCwwIDE3LDlaIj48L3BhdGg+Cjwvc3ZnPgo="},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e){return e(r||(t=["\n ha-card {\n display: flex;\n flex-flow: row;\n align-items: center;\n padding: 16px;\n color: var(--primary-text-color, #000);\n font-weight: var(--swc-font-weight, 400);\n transition: background 1s;\n cursor: pointer;\n }\n ha-card[bg] {\n font-weight: var(--swc-font-weight, 500);\n background: var(--day-color);\n color: var(--text-color);\n }\n ha-card[bg][night] {\n background: var(--night-color);\n }\n ha-card[bg][fade] {\n background: linear-gradient(var(--day-color), transparent 250%);\n }\n ha-card[bg][fade][night] {\n background: linear-gradient(var(--night-color) 0%, transparent 300%);\n }\n .weather__icon {\n height: 40px;\n width: 40px;\n background-size: contain;\n background-repeat: no-repeat;\n flex: 0 0 40px;\n color: white;\n margin-right: 16px;\n }\n .weather__icon--small {\n display: inline-block;\n height: 1em;\n width: 1em;\n min-width: 1em;\n flex: initial;\n margin: 0 .2em;\n }\n .weather__info {\n display: flex;\n flex-flow: column;\n justify-content: space-between;\n min-height: 42px;\n min-width: 0;\n }\n .weather__info__row {\n display: flex;\n align-items: center;\n max-width: 100%;\n }\n .weather__info__item {\n padding-left: 8px;\n display: flex;\n align-items: center;\n }\n .weather__info--add {\n padding-left: 8px;\n margin-left: auto;\n align-items: flex-end;\n }\n .weather__info__state,\n .weather__info__title,\n .weather__info__row {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n "],n||(n=t.slice(0)),r=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}}))));var t,n};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleClick=void 0;t.handleClick=(e,t,n,r)=>{let i;switch(r.action){case"more-info":i=new Event("hass-more-info",{composed:!0}),i.detail={entityId:r.entity||n.entity},e.dispatchEvent(i);break;case"navigate":if(!r.navigation_path)return;history.pushState(null,"",r.navigation_path),i=new Event("location-changed",{composed:!0}),i.detail={replace:!1},window.dispatchEvent(i);break;case"call-service":if(!r.service)return;const[o,s]=r.service.split(".",2),A={...r.service_data};t.callService(o,s,A)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"customElement",(function(){return r})),n.d(t,"property",(function(){return o})),n.d(t,"state",(function(){return s})),n.d(t,"eventOptions",(function(){return a})),n.d(t,"query",(function(){return c})),n.d(t,"queryAll",(function(){return u})),n.d(t,"queryAsync",(function(){return l})),n.d(t,"queryAssignedElements",(function(){return g})),n.d(t,"queryAssignedNodes",(function(){return M})); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const r=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:n,elements:r}=t;return{kind:n,elements:r,finisher(t){window.customElements.define(e,t)}}})(e,t) +const r=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:n,elements:r}=t;return{kind:n,elements:r,finisher(t){customElements.define(e,t)}}})(e,t) /** * @license * Copyright 2017 Google LLC @@ -44,9 +44,9 @@ const r=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t) * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */var d;const g=null!=(null===(d=window.HTMLSlotElement)||void 0===d?void 0:d.prototype.assignedElements)?(e,t)=>e.assignedElements(t):(e,t)=>e.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE);function f(e){const{slot:t,selector:n}=null!=e?e:{};return A({descriptor:r=>({get(){var r;const i="slot"+(t?`[name=${t}]`:":not([name])"),o=null===(r=this.renderRoot)||void 0===r?void 0:r.querySelector(i),s=null!=o?g(o,e):[];return n?s.filter(e=>e.matches(n)):s},enumerable:!0,configurable:!0})})} + */var d;const f=null!=(null===(d=window.HTMLSlotElement)||void 0===d?void 0:d.prototype.assignedElements)?(e,t)=>e.assignedElements(t):(e,t)=>e.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE);function g(e){const{slot:t,selector:n}=null!=e?e:{};return A({descriptor:r=>({get(){var r;const i="slot"+(t?`[name=${t}]`:":not([name])"),o=null===(r=this.renderRoot)||void 0===r?void 0:r.querySelector(i),s=null!=o?f(o,e):[];return n?s.filter(e=>e.matches(n)):s},enumerable:!0,configurable:!0})})} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function M(e,t,n){let r,i=e;return"object"==typeof e?(i=e.slot,r=e):r={flatten:t},n?f({slot:i,flatten:t,selector:n}):A({descriptor:e=>({get(){var e,t;const n="slot"+(i?`[name=${i}]`:":not([name])"),o=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(n);return null!==(t=null==o?void 0:o.assignedNodes(r))&&void 0!==t?t:[]},enumerable:!0,configurable:!0})})}}]); + */function M(e,t,n){let r,i=e;return"object"==typeof e?(i=e.slot,r=e):r={flatten:t},n?g({slot:i,flatten:t,selector:n}):A({descriptor:e=>({get(){var e,t;const n="slot"+(i?`[name=${i}]`:":not([name])"),o=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(n);return null!==(t=null==o?void 0:o.assignedNodes(r))&&void 0!==t?t:[]},enumerable:!0,configurable:!0})})}}]); diff --git a/custom_components/ui_lovelace_minimalist/cards/weather-radar-card/weather-radar-card.js b/custom_components/ui_lovelace_minimalist/cards/weather-radar-card/weather-radar-card.js index 43922eca2..5c0e0fb4c 100644 --- a/custom_components/ui_lovelace_minimalist/cards/weather-radar-card/weather-radar-card.js +++ b/custom_components/ui_lovelace_minimalist/cards/weather-radar-card/weather-radar-card.js @@ -8,19 +8,19 @@ var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Arr * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var h;const u=window,f=u.trustedTypes,g=f?f.emptyScript:"",b=u.reactiveElementPolyfillSupport,v={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},x=(e,t)=>t!==e&&(t==t||e==e),_={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x};class y extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;null!==(t=this.h)&&void 0!==t||(this.h=[]),this.h.push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const n=this._$Ep(i,t);void 0!==n&&(this._$Ev.set(n,i),e.push(n))})),e}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(n){const r=this[e];this[t]=n,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||_}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(p(e))}else void 0!==e&&t.push(p(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return m(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=_){var n;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const a=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:v).toAttribute(t,i.type);this._$El=e,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$El=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=n.getPropertyOptions(r),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:v;this._$El=r,this[r]=a.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let n=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||x)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}} + */;var h;const u=window,f=u.trustedTypes,g=f?f.emptyScript:"",b=u.reactiveElementPolyfillSupport,v={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},x=(e,t)=>t!==e&&(t==t||e==e),_={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:x};class y extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const n=this._$Ep(i,t);void 0!==n&&(this._$Ev.set(n,i),e.push(n))})),e}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(n){const r=this[e];this[t]=n,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||_}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(p(e))}else void 0!==e&&t.push(p(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return m(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=_){var n;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const a=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:v).toAttribute(t,i.type);this._$El=e,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$El=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=n.getPropertyOptions(r),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:v;this._$El=r,this[r]=a.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let n=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||x)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var w;y.finalized=!0,y.elementProperties=new Map,y.elementStyles=[],y.shadowRootOptions={mode:"open"},null==b||b({ReactiveElement:y}),(null!==(h=u.reactiveElementVersions)&&void 0!==h?h:u.reactiveElementVersions=[]).push("1.4.1");const E=window,T=E.trustedTypes,I=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,A=`lit$${(Math.random()+"").slice(9)}$`,C="?"+A,S=`<${C}>`,R=document,k=(e="")=>R.createComment(e),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,L=Array.isArray,F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,$=/>/g,M=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),N=/'/g,H=/"/g,B=/^(?:script|style|textarea|title)$/i,P=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),z=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),U=new WeakMap,X=R.createTreeWalker(R,129,null,!1),j=(e,t)=>{const i=e.length-1,n=[];let r,a=2===t?"":"",o=F;for(let t=0;t"===l[0]?(o=null!=r?r:F,s=-1):void 0===l[1]?s=-2:(s=o.lastIndex-l[2].length,d=l[1],o=void 0===l[3]?M:'"'===l[3]?H:N):o===H||o===N?o=M:o===D||o===$?o=F:(o=M,r=void 0);const m=o===M&&e[t+1].startsWith("/>")?" ":"";a+=o===F?i+S:s>=0?(n.push(d),i.slice(0,s)+"$lit$"+i.slice(s)+A+m):i+A+(-2===s?(n.push(void 0),t):m)}const d=a+(e[i]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==I?I.createHTML(d):d,n]};class W{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,a=0;const o=e.length-1,d=this.parts,[l,s]=j(e,t);if(this.el=W.createElement(l,i),X.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=X.nextNode())&&d.length0){n.textContent=T?T.emptyScript:"";for(let i=0;iL(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.O(e):this.$(e)}S(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}k(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}$(e){this._$AH!==V&&O(this._$AH)?this._$AA.nextSibling.data=e:this.k(R.createTextNode(e)),this._$AH=e}T(e){var t;const{values:i,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=W.createElement(n.h,this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.m(i);else{const e=new q(r,this),t=e.p(this.options);e.m(i),this.k(t),this._$AH=e}}_$AC(e){let t=U.get(e.strings);return void 0===t&&U.set(e.strings,t=new W(e)),t}O(e){L(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new Y(this.S(k()),this.S(k()),this,this.options)):i=t[n],i._$AI(r),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,n){const r=this.strings;let a=!1;if(void 0===r)e=G(this,e,t,0),a=!O(e)||e!==this._$AH&&e!==z,a&&(this._$AH=e);else{const n=e;let o,d;for(e=r[0],o=0;oe}):void 0,A=`lit$${(Math.random()+"").slice(9)}$`,C="?"+A,S=`<${C}>`,R=document,k=(e="")=>R.createComment(e),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,L=Array.isArray,F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,$=/>/g,M=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),N=/'/g,H=/"/g,B=/^(?:script|style|textarea|title)$/i,P=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),z=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),U=new WeakMap,X=R.createTreeWalker(R,129,null,!1),j=(e,t)=>{const i=e.length-1,n=[];let r,a=2===t?"":"",o=F;for(let t=0;t"===l[0]?(o=null!=r?r:F,s=-1):void 0===l[1]?s=-2:(s=o.lastIndex-l[2].length,d=l[1],o=void 0===l[3]?M:'"'===l[3]?H:N):o===H||o===N?o=M:o===D||o===$?o=F:(o=M,r=void 0);const m=o===M&&e[t+1].startsWith("/>")?" ":"";a+=o===F?i+S:s>=0?(n.push(d),i.slice(0,s)+"$lit$"+i.slice(s)+A+m):i+A+(-2===s?(n.push(void 0),t):m)}const d=a+(e[i]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==I?I.createHTML(d):d,n]};class W{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,a=0;const o=e.length-1,d=this.parts,[l,s]=j(e,t);if(this.el=W.createElement(l,i),X.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=X.nextNode())&&d.length0){n.textContent=T?T.emptyScript:"";for(let i=0;iL(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==V&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(R.createTextNode(e)),this._$AH=e}$(e){var t;const{values:i,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=W.createElement(n.h,this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.p(i);else{const e=new q(r,this),t=e.v(this.options);e.p(i),this.T(t),this._$AH=e}}_$AC(e){let t=U.get(e.strings);return void 0===t&&U.set(e.strings,t=new W(e)),t}k(e){L(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new Y(this.O(k()),this.O(k()),this,this.options)):i=t[n],i._$AI(r),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,n){const r=this.strings;let a=!1;if(void 0===r)e=G(this,e,t,0),a=!O(e)||e!==this._$AH&&e!==z,a&&(this._$AH=e);else{const n=e;let o,d;for(e=r[0],o=0;o{var n,r;const a=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:t;let o=a._$litPart$;if(void 0===o){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;a._$litPart$=o=new Y(t.insertBefore(k(),e),e,void 0,null!=i?i:{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return z}}ae.finalized=!0,ae._$litElement$=!0,null===(ne=globalThis.litElementHydrateSupport)||void 0===ne||ne.call(globalThis,{LitElement:ae});const oe=globalThis.litElementPolyfillSupport;null==oe||oe({LitElement:ae}),(null!==(re=globalThis.litElementVersions)&&void 0!==re?re:globalThis.litElementVersions=[]).push("3.2.2"); +var ne,re;class ae extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{var n,r;const a=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:t;let o=a._$litPart$;if(void 0===o){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;a._$litPart$=o=new Y(t.insertBefore(k(),e),e,void 0,null!=i?i:{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return z}}ae.finalized=!0,ae._$litElement$=!0,null===(ne=globalThis.litElementHydrateSupport)||void 0===ne||ne.call(globalThis,{LitElement:ae});const oe=globalThis.litElementPolyfillSupport;null==oe||oe({LitElement:ae}),(null!==(re=globalThis.litElementVersions)&&void 0!==re?re:globalThis.litElementVersions=[]).push("3.2.2"); /** * @license * Copyright 2017 Google LLC @@ -1288,7 +1288,7 @@ const jn=c`.mdc-slider{cursor:pointer;height:48px;margin:0 24px;position:relativ flex: 1; padding-right: 4px; } - `,n([se({attribute:!1})],Gn.prototype,"hass",void 0),n([ce()],Gn.prototype,"_config",void 0),n([ce()],Gn.prototype,"_helpers",void 0),Gn=n([de("weather-radar-card-editor")],Gn);var qn={version:"Version",invalid_configuration:"Invalid configuration",show_warning:"Show Warning"},Yn={common:qn},Kn={version:"Versjon",invalid_configuration:"Ikke gyldig konfiguration",show_warning:"Vis advarsel"},Zn={common:Kn};const Qn={en:Object.freeze({__proto__:null,common:qn,default:Yn}),nb:Object.freeze({__proto__:null,common:Kn,default:Zn})};function Jn(e,t="",i=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let r;try{r=e.split(".").reduce(((e,t)=>e[t]),Qn[n])}catch(t){r=e.split(".").reduce(((e,t)=>e[t]),Qn.en)}return void 0===r&&(r=e.split(".").reduce(((e,t)=>e[t]),Qn.en)),""!==t&&""!==i&&(r=r.replace(t,i)),r}console.info(`%c WEATHER-RADAR-CARD \n%c ${Jn("common.version")} 2.1.0 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"weather-radar-card",name:"Weather Radar Card",description:"A rain radar card using the new tiled images from RainViewer"});let er=class extends ae{constructor(){super(...arguments),this.isPanel=!1}static async getConfigElement(){return document.createElement("weather-radar-card-editor")}static getStubConfig(){return{}}setConfig(e){this._config=e}getCardSize(){return 10}shouldUpdate(){return!0}render(){if(this._config.show_warning)return this.showWarning(Jn("common.show_warning"));const e=`\n \n \n \n Weather Radar Card\n \n \n \n \n