From 40b1eb759e7491b602803aeea5113e769935e3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Pereira=20Mu=C3=B1oz?= Date: Fri, 24 Jan 2025 01:14:16 +0100 Subject: [PATCH] Add divider and divider_color to order item options --- dist/custom-sidebar-json.js | 2 +- dist/custom-sidebar-yaml.js | 2 +- dist/custom-sidebar.js | 2 +- .../02-main-configuration-options.mdx | 5 ++-- .../03-themeable-configuration-options.mdx | 3 ++- src/checker.ts | 2 +- src/constants/global.ts | 3 +++ src/constants/index.ts | 14 +++++----- src/custom-sidebar.ts | 5 ++++ src/styles/index.ts | 12 +++++++++ src/types/index.ts | 5 ++-- src/validators/index.ts | 10 ++++++-- .../color-overriding-divider-color.png | Bin 0 -> 19088 bytes ...04 - item-color-options-overriding.spec.ts | 10 +++++++- tests/15 - validator-errors.spec.ts | 24 ++++++++++++++++++ 15 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 src/constants/global.ts create mode 100644 test-snapshots/04 - item-color-options-overriding.spec.ts/chromium/color-overriding-divider-color.png diff --git a/dist/custom-sidebar-json.js b/dist/custom-sidebar-json.js index ddaba99..a3df856 100644 --- a/dist/custom-sidebar-json.js +++ b/dist/custom-sidebar-json.js @@ -1 +1 @@ -!function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<])(".concat(Object.values(se).join("|"),")($|[ \\?)+:\\}\\]><.])"),"gm"),this._scopped=fe(e,o,i),this._watchForPanelUrlChange(),this._watchForEntitiesChange()}return e.prototype._executeRenderingFunctions=function(e){var t=this;this._subscriptions.get(e).forEach((function(e,n){e.forEach((function(e){t.trackTemplate(n,e)}))}))},e.prototype._watchForPanelUrlChange=function(){var e=this;window.addEventListener(_e.LOCATION_CHANGED,(function(t){e._panelUrlWatchCallback()})),window.addEventListener(_e.POPSTATE,(function(){e._panelUrlWatchCallback()}))},e.prototype._panelUrlWatchCallback=function(){this._subscriptions.has(se.PANEL_URL)&&this._executeRenderingFunctions(se.PANEL_URL)},e.prototype._watchForEntitiesChange=function(){var e=this;window.hassConnection.then((function(t){t.conn.subscribeMessage((function(t){return e._entityWatchCallback(t)}),{type:_e.SUBSCRIBE_EVENTS,event_type:_e.STATE_CHANGE_EVENT})}))},e.prototype._entityWatchCallback=function(e){if(this._subscriptions.size){var t=e.data.entity_id;this._subscriptions.has(t)&&this._executeRenderingFunctions(t)}},e.prototype._storeTracked=function(e,t){var n=this;this._scopped.tracked.forEach((function(o){if(n._subscriptions.has(o)){var r=n._subscriptions.get(o);if(r.has(e)){var i=r.get(e);i.has(t)||i.add(t)}else r.set(e,new Set([t]))}else n._subscriptions.set(o,new Map([[e,new Set([t])]]))}))},e.prototype._untrackTemplate=function(e,t){var n=this;this._subscriptions.forEach((function(o,r){if(o.has(e)){var i=o.get(e);i.has(t)&&i.delete(t),0===i.size&&(o.delete(e),0===o.size&&n._subscriptions.delete(r))}}))},e.prototype.renderTemplate=function(e){try{var t=new Map(Object.entries(this._variables)),n=e.trim().replace(this._clientSideEntitiesRegExp,"$1clientSide.$2$3"),o=n.includes("return")||!this._autoReturn?n:"return ".concat(n);return(new(Function.bind.apply(Function,ie(ie([void 0,"hass","states","is_state","state_attr","is_state_attr","has_value","entities","entity_prop","is_entity_prop","devices","device_attr","is_device_attr","device_id","areas","area_id","area_name","area_entities","area_devices","user_name","user_is_admin","user_is_owner","user_agent","clientSide","ref","unref"],Array.from(t.keys()),!1),["".concat('"use strict";'," ").concat(o)],!1)))).apply(void 0,ie([this._scopped.hass,this._scopped.states,this._scopped.is_state.bind(this._scopped),this._scopped.state_attr.bind(this._scopped),this._scopped.is_state_attr.bind(this._scopped),this._scopped.has_value.bind(this._scopped),this._scopped.entities,this._scopped.entity_prop,this._scopped.is_entity_prop.bind(this._scopped),this._scopped.devices,this._scopped.device_attr.bind(this._scopped),this._scopped.is_device_attr.bind(this._scopped),this._scopped.device_id.bind(this._scopped),this._scopped.areas.bind(this._scopped),this._scopped.area_id.bind(this._scopped),this._scopped.area_name.bind(this._scopped),this._scopped.area_entities.bind(this._scopped),this._scopped.area_devices.bind(this._scopped),this._scopped.user_name,this._scopped.user_is_admin,this._scopped.user_is_owner,this._scopped.user_agent,this._scopped.clientSideProxy,this._scopped.ref.bind(this._scopped,this._entityWatchCallback.bind(this)),this._scopped.unref.bind(this._scopped,this.cleanTracked.bind(this))],Array.from(t.values()),!1))}catch(e){if(this._throwErrors)throw e;return void(this._throwWarnings&&console.warn(e))}},e.prototype.trackTemplate=function(e,t){var n=this;this._scopped.cleanTracked();var o=this.renderTemplate(e);return this._storeTracked(e,t),t(o),function(){return n._untrackTemplate(e,t)}},e.prototype.cleanTracked=function(e){e?this._subscriptions.has(e)&&this._subscriptions.delete(e):this._subscriptions.clear()},Object.defineProperty(e.prototype,"variables",{get:function(){return this._variables},set:function(e){this._variables=e},enumerable:!1,configurable:!0}),e}(),Re=function(){function e(e,t){void 0===t&&(t={}),this._renderer=r((function(){return e.hass}),(function(e){return!!(e&&e.areas&&e.devices&&e.entities&&e.states&&e.user)}),{retries:100,delay:50,rejectMessage:"The provided element doesn't contain a proper or initialised hass object"}).then((function(){return new ve(e,t)}))}return e.prototype.getRenderer=function(){return this._renderer},e}(),Ne=/([A-Z])([a-z0-9_-]+)/g,be=function(e){return Object.entries(e).map((function(e){var t=e[0],n=e[1];return"".concat(function(e){return e.replace(Ne,(function(e,t,n,o){var r=t.toLocaleLowerCase();return o?"-".concat(r).concat(n):"--".concat(r).concat(n)}))}(t),":").concat(n)})).join(";")+";"},me=function(e){return(Array.isArray(e)?e:[e]).map((function(e){return"string"==typeof e?e:Object.entries(e).map((function(e){var t=e[0],n=e[1];return!1===n?"".concat(t,"{display: none !important}"):"".concat(t,"{").concat(be(n),"}")})).join("")})).join("")},ye=function(e,t){return"".concat(t,"_").concat(e)},Se=function(e){return e instanceof ShadowRoot?e.host.localName:e.localName},Ce=function(e,t){var n=ye(Se(e),t);return e.querySelector("#".concat(n))},Le=function(){function e(e){var t,n,o;void 0===e&&(e={}),this._prefix=null!==(t=e.prefix)&&void 0!==t?t:"ha-styles-manager",this._namespace=null!==(n=e.namespace)&&void 0!==n?n:"home-assistant-styles-manager",this._throwWarnings=null===(o=e.throwWarnings)||void 0===o||o}return e.prototype.getStyleElement=function(e){return Ce(e,this._prefix)},e.prototype.addStyle=function(e,t){!function(e,t,n,o,r){if(t){var i=Ce(t,n);if(!i){var c=ye(Se(t),n);(i=document.createElement("style")).setAttribute("id",c),t.appendChild(i)}i.innerHTML="string"==typeof e?e:me(e)}else r&&console.warn("".concat(o,': no element has been provided calling "addStyle"'))}(e,t,this._prefix,this._namespace,this._throwWarnings)},e.prototype.removeStyle=function(e){!function(e,t,n,o){if(e){var r=Ce(e,t);r?r.remove():o&&console.warn("".concat(n,': no style to remove calling "removeStyle"'))}else o&&console.warn("".concat(n,': no element has been provided calling "removeStyle"'))}(e,this._prefix,this._namespace,this._throwWarnings)},e}();!function(e){e.HIDDEN="hidden",e.NARROW="narrow",e.EXTENDED="extended"}(Oe||(Oe={})),function(e){e.DOCKED="docked",e.AUTO="auto",e.ALWAYS_HIDDEN="always_hidden"}(he||(he={})),function(e){e.AND="AND",e.OR="OR"}(pe||(pe={})),function(e){e.TEXT="text",e.DATA_PANEL="data-panel",e.HREF="href"}(Ie||(Ie={})),function(e){e.CALL_SERVICE="call-service",e.JAVASCRIPT="javascript"}(Te||(Te={}));var De,ge="custom-sidebar",we="sidebar-config",Pe="".concat("/local/").concat(we),He="base";!function(e){e.BOOLEAN="boolean",e.STRING="string",e.UNDEFINED="undefined",e.NUMBER="number"}(De||(De={}));var Me,Be,xe,Fe,Ge,Ue="[object Object]",je="data-blocked";!function(e){e.SIDEBAR="ha-sidebar",e.PAPER_LISTBOX="paper-listbox",e.PAPER_ICON_ITEM="paper-icon-item",e.HA_SVG_ICON="ha-svg-icon",e.HA_ICON="ha-icon",e.HA_ICON_BUTTON="ha-icon-button"}(Me||(Me={})),function(e){e.HOST=":host",e.HOST_EXPANDED=":host([expanded])",e.SCOPE=":scope",e.TITLE=".title",e.ITEM='a[role="option"]',e.ITEM_SELECTED=".iron-selected",e.ITEM_HOVER='a[role="option"]:hover',e.SPACER=".spacer",e.ITEM_TEXT=".item-text",e.NOTIFICATION_BADGE=".notification-badge",e.NOTIFICATIONS_BADGE_COLLAPSED=".notification-badge-collapsed",e.CONFIGURATION_BADGE=".configuration-badge",e.HA_MENU_BUTTON="ha-panel-lovelace$ hui-root$ .toolbar > ha-menu-button",e.EDIT_SIDEBAR_BUTTON="ha-panel-profile ha-profile-section-general$ ha-settings-row mwc-button",e.SIDEBAR_NOTIFICATIONS_CONTAINER=".notifications-container",e.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER=".notifications-container:hover",e.SIDEBAR_NOTIFICATIONS=".notifications",e.PROFILE=".profile",e.MENU=".menu",e.DIVIDER=".divider",e.MC_DRAWER=".mdc-drawer",e.HA_SCROLLBAR=".ha-scrollbar",e.DATA_INFO="[data-info]"}(Be||(Be={})),function(e){e.AFTER="::after",e.BEFORE="::before",e.WEBKIT_SCROLLBAR_THUMB="::-webkit-scrollbar-thumb"}(xe||(xe={})),function(e){e.PRIMARY_BACKGROUND_COLOR="--primary-background-color",e.SIDEBAR_BACKGROUND_COLOR="--sidebar-background-color",e.SIDEBAR_TITLE_COLOR="--sidebar-menu-button-text-color",e.SIDEBAR_BUTTON_COLOR="--sidebar-icon-color",e.SIDEBAR_MENU_BUTTON_BACKGROUND_COLOR="--sidebar-menu-button-background-color",e.SIDEBAR_ICON_COLOR="--sidebar-icon-color",e.SIDEBAR_SELECTED_ICON_COLOR="--sidebar-selected-icon-color",e.SIDEBAR_TEXT_COLOR="--sidebar-text-color",e.SIDEBAR_SELECTED_TEXT_COLOR="--sidebar-selected-text-color",e.ACCENT_COLOR="--accent-color",e.TEXT_ACCENT_COLOR="--text-accent-color",e.TEXT_PRIMARY_COLOR="--text-primary-color",e.PRIMARY_TEXT_COLOR="--primary-text-color",e.DIVIDER_COLOR="--divider-color",e.SCROLLBAR_THUMB_COLOR="--scrollbar-thumb-color"}(Fe||(Fe={})),function(e){e.BACKGROUND="--custom-sidebar-background",e.BORDER_COLOR="--custom-sidebar-border-color",e.MENU_BACKGROUND="--custom-sidebar-menu-background",e.TITLE_COLOR="--custom-sidebar-title-color",e.SUBTITLE_COLOR="--custom-sidebar-subtitle-color",e.BUTTON_COLOR="--custom-sidebar-button-color",e.DIVIDER_COLOR="--custom-sidebar-divider-color",e.DIVIDER_TOP_COLOR="--custom-sidebar-divider-top-color",e.DIVIDER_BOTTOM_COLOR="--custom-sidebar-divider-bottom-color",e.SCROLLBAR_THUMB_COLOR="--custom-sidebar-scrollbar-thumb-color",e.ITEM_BACKGROUND="--custom-sidebar-item-background",e.ITEM_BACKGROUND_HOVER="--custom-sidebar-item-background-hover",e.ICON_COLOR="--custom-sidebar-icon-color",e.ICON_COLOR_SELECTED="--custom-sidebar-icon-color-selected",e.ICON_COLOR_HOVER="--custom-sidebar-icon-color-hover",e.TEXT_COLOR="--custom-sidebar-text-color",e.TEXT_COLOR_SELECTED="--custom-sidebar-text-color-selected",e.TEXT_COLOR_HOVER="--custom-sidebar-text-color-hover",e.SELECTION_BACKGROUND="--custom-sidebar-selection-background",e.SELECTION_OPACITY="--custom-sidebar-selection-opacity",e.INFO_COLOR="--custom-sidebar-info-color",e.INFO_COLOR_SELECTED="--custom-sidebar-info-color-selected",e.INFO_COLOR_HOVER="--custom-sidebar-info-color-hover",e.NOTIFICATION_COLOR="--custom-sidebar-notification-color",e.NOTIFICATION_COLOR_SELECTED="--custom-sidebar-notification-color-selected",e.NOTIFICATION_COLOR_HOVER="--custom-sidebar-notification-color-hover",e.NOTIFICATION_TEXT_COLOR="--custom-sidebar-notification-text-color",e.NOTIFICATION_TEXT_COLOR_SELECTED="--custom-sidebar-notification-text-color-selected",e.NOTIFICATION_TEXT_COLOR_HOVER="--custom-sidebar-notification-text-color-hover"}(Ge||(Ge={}));var ke,Ve,Xe,We,Ke,qe=["item_background","item_background_hover","icon_color","icon_color_selected","icon_color_hover","text_color","text_color_selected","text_color_hover","selection_background","info_color","info_color_selected","info_color_hover","notification_color","notification_color_selected","notification_color_hover","notification_text_color","notification_text_color_selected","notification_text_color_hover"],Ye=["selection_opacity"],$e=[["item_background",Ge.ITEM_BACKGROUND],["item_background_hover",Ge.ITEM_BACKGROUND_HOVER],["icon_color",Ge.ICON_COLOR],["icon_color_selected",Ge.ICON_COLOR_SELECTED],["icon_color_hover",Ge.ICON_COLOR_HOVER],["text_color",Ge.TEXT_COLOR],["text_color_selected",Ge.TEXT_COLOR_SELECTED],["text_color_hover",Ge.TEXT_COLOR_HOVER],["selection_background",Ge.SELECTION_BACKGROUND],["selection_opacity",Ge.SELECTION_OPACITY],["info_color",Ge.INFO_COLOR],["info_color_selected",Ge.INFO_COLOR_SELECTED],["info_color_hover",Ge.INFO_COLOR_HOVER],["notification_color",Ge.NOTIFICATION_COLOR],["notification_color_selected",Ge.NOTIFICATION_COLOR_SELECTED],["notification_color_hover",Ge.NOTIFICATION_COLOR_HOVER],["notification_text_color",Ge.NOTIFICATION_TEXT_COLOR],["notification_text_color_selected",Ge.NOTIFICATION_TEXT_COLOR_SELECTED],["notification_text_color_hover",Ge.NOTIFICATION_TEXT_COLOR_HOVER]],Je=o([["title_color",Ge.TITLE_COLOR],["subtitle_color",Ge.SUBTITLE_COLOR],["sidebar_button_color",Ge.BUTTON_COLOR],["sidebar_background",Ge.BACKGROUND],["menu_background",Ge.MENU_BACKGROUND],["scrollbar_thumb_color",Ge.SCROLLBAR_THUMB_COLOR],["divider_color",Ge.DIVIDER_COLOR],["divider_top_color",Ge.DIVIDER_TOP_COLOR],["divider_bottom_color",Ge.DIVIDER_BOTTOM_COLOR]],$e,!0);!function(e){e.NOTIFICATIONS_BADGE="notification-badge",e.NOTIFICATIONS_BADGE_COLLAPSED="notification-badge-collapsed",e.IRON_SELECTED="iron-selected"}(ke||(ke={})),function(e){e.PANEL="data-panel",e.ROLE="role",e.PROCESSED="data-processed",e.WITH_NOTIFICATION="data-notification",e.ARIA_SELECTED="aria-selected",e.ARIA_DISABLED="aria-disabled",e.DISABLED="disabled",e.HREF="href",e.STYLE="style"}(Ve||(Ve={})),function(e){e.CLICK="click",e.MOUSEDOWN="mousedown",e.MOUSEENTER="mouseenter",e.MOUSELEAVE="mouseleave",e.KEYDOWN="keydown",e.HASS_EDIT_SIDEBAR="hass-edit-sidebar",e.RENDER_TEMPLATE="render_template",e.LOCATION_CHANGED="location-changed"}(Xe||(Xe={})),function(e){e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.TAB="Tab"}(We||(We={})),function(e){e.PAPER_ICON_ITEM="PAPER-ICON-ITEM",e.A="A"}(Ke||(Ke={}));var ze,Qe,Ze,et,tt,nt,ot,rt,it,ct,at,st,_t,ut,lt,dt,Et,ft,Ot,ht,pt,It,Tt,At,vt=["HOME-ASSISTANT","HOME-ASSISTANT-MAIN","HA-SIDEBAR"],Rt=((Ae={})[Oe.HIDDEN]=he.ALWAYS_HIDDEN,Ae[Oe.NARROW]=he.AUTO,Ae[Oe.EXTENDED]=he.DOCKED,Ae),Nt="/profile",bt=/^\s*\[\[\[([\s\S]+)\]\]\]\s*$/,mt=/\{\{[\s\S]*\}\}|\{%[\s\S]*%\}/,yt=/@partial\s+([\w-]+)/g,St=/^\s*([a-z_]+)\.([\w-]+)\s*$/,Ct=/^\s*ref\(([\s\S]*)\)\s*$/,Lt=function(e){return Array.isArray(e)?e.map((function(e){return e.toLowerCase()})):e.toLowerCase().split(/\s*,\s*/)},Dt=function(){return new Promise((function(e){setTimeout(e,1)}))},gt=o(o([],qe,!0),Ye,!0),wt=["id","exceptions","extendable_configs","extend_from","user","not_user","device","not_device","is_admin"],Pt=["js_variables","jinja_variables","partials"],Ht=function(){function t(e,t,n){var o;this._config=e,this._extendable=new Map(Object.entries(null!==(o=this._config.extendable_configs)&&void 0!==o?o:[])),this._user=t,this._userAgent=n,this._exceptions=this._getExceptions(),this._buildFlattenConfig()}return t.prototype._getExceptions=function(){var e=this;if(this._config.exceptions){var t=this._user.name.toLocaleLowerCase();return this._config.exceptions.filter((function(n){var o,r=null!==(o=n.matchers_conditions)&&void 0!==o?o:pe.OR,i=void 0!==n.user&&Lt(n.user).includes(t),c=void 0!==n.not_user&&!Lt(n.not_user).includes(t),a=void 0!==n.device&&Lt(n.device).some((function(t){return e._userAgent.includes(t)})),s=void 0!==n.not_device&&!Lt(n.not_device).some((function(t){return e._userAgent.includes(t)})),_=void 0!==n.is_admin&&n.is_admin===e._user.is_admin,u=void 0!==n.is_owner&&n.is_owner===e._user.is_owner;return r===pe.OR?i||c||a||s||_||u:(void 0===n.user||i)&&(void 0===n.not_user||c)&&(void 0===n.device||a)&&(void 0===n.not_device||s)&&(void 0===n.is_admin||_)&&(void 0===n.is_owner||u)}))}return[]},t.prototype._mergeConfigs=function(){for(var t=[],n=0;n ")," > ").concat(r));return Mt(t[r].trim(),t,o(o([],n,!0),[r],!1))}return console.warn("".concat(ge,": partial ").concat(r," doesn't exist")),""}))},Bt=function(){for(var e=[],t=0;t ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT)]={maxWidth:"calc(100% - 100px)"},ze["".concat(Be.HOST_EXPANDED," ").concat(Me.PAPER_LISTBOX," > ").concat(Be.ITEM," > ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT)]={display:"flex",flexDirection:"column",gap:"5px",lineHeight:"1"},ze["".concat(Be.HOST_EXPANDED," ").concat(Me.PAPER_LISTBOX," > ").concat(Be.ITEM," > ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT).concat(xe.AFTER)]={content:"attr(data-info)",display:"none",fontSize:"11px",lineHeight:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ze["{ SELECTOR.HOST_EXPANDED } ".concat(Me.PAPER_LISTBOX," > ").concat(Be.ITEM," > ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.NOTIFICATIONS_BADGE_COLLAPSED)]={opacity:"0"},ze["".concat(Be.HOST_EXPANDED," ").concat(Me.PAPER_LISTBOX," > ").concat(Be.ITEM).concat(Be.ITEM_SELECTED," > ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT)]={zIndex:"1"},ze["".concat(Be.HOST," ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.NOTIFICATION_BADGE,":not(").concat(Be.NOTIFICATIONS_BADGE_COLLAPSED,")")]=e({left:"calc(var(--app-drawer-width, 248px) - 22px)",maxWidth:"80px",transform:"translateX(-100%)"},xt),ze["".concat(Be.HOST," ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.NOTIFICATIONS_BADGE_COLLAPSED)]=e({bottom:"14px",left:"26px",maxWidth:"20px"},xt),ze["".concat(Be.HOST," ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.CONFIGURATION_BADGE)]=e({},xt),ze),Gt=((Qe={})["".concat(Be.HOST," ").concat(Be.MENU," > ").concat(Be.TITLE)]={color:Bt(Ge.TITLE_COLOR,Fe.SIDEBAR_TITLE_COLOR,Fe.PRIMARY_TEXT_COLOR)},Qe),Ut=((Ze={})["".concat(Be.HOST," ").concat(Be.MENU," > ").concat(Be.TITLE).concat(xe.AFTER)]={content:"attr(data-subtitle)",color:Bt(Ge.SUBTITLE_COLOR,Ge.TITLE_COLOR,Fe.SIDEBAR_TITLE_COLOR,Fe.PRIMARY_TEXT_COLOR),display:"block",fontSize:"12px",lineHeight:"1.5"},Ze),jt=((et={})["".concat(Be.HOST," ").concat(Be.MENU," > ").concat(Me.HA_ICON_BUTTON)]={color:Bt(Ge.BUTTON_COLOR,Fe.SIDEBAR_ICON_COLOR)},et),kt=((tt={})[Be.HOST]={background:Bt(Ge.BACKGROUND,Fe.SIDEBAR_BACKGROUND_COLOR)+" !important"},tt),Vt=((nt={})["".concat(Be.HOST," ").concat(Be.MENU)]={background:Bt(Ge.MENU_BACKGROUND,Ge.BACKGROUND,Fe.SIDEBAR_MENU_BUTTON_BACKGROUND_COLOR,Fe.PRIMARY_BACKGROUND_COLOR),borderBottomColor:Bt(Ge.DIVIDER_TOP_COLOR,Ge.DIVIDER_COLOR,Fe.DIVIDER_COLOR),borderBottomStyle:"solid",borderBottomWidth:"1px"},nt),Xt=((ot={})["".concat(Be.HOST," ").concat(Be.DIVIDER).concat(xe.BEFORE)]={backgroundColor:Bt(Ge.DIVIDER_BOTTOM_COLOR,Ge.DIVIDER_COLOR,Fe.DIVIDER_COLOR)},ot),Wt=((rt={})["".concat(Be.HOST," > ").concat(Be.MC_DRAWER)]={borderColor:Bt(Ge.BORDER_COLOR,Fe.DIVIDER_COLOR,"rgba(0,0,0,.12)")},rt),Kt=((it={})["".concat(Be.HOST," ").concat(Me.PAPER_LISTBOX).concat(Be.HA_SCROLLBAR)]={scrollbarColor:Bt(Ge.SCROLLBAR_THUMB_COLOR,Fe.SCROLLBAR_THUMB_COLOR)+" transparent"},it["".concat(Be.HOST," ").concat(Me.PAPER_LISTBOX).concat(Be.HA_SCROLLBAR).concat(xe.WEBKIT_SCROLLBAR_THUMB)]={background:Bt(Ge.SCROLLBAR_THUMB_COLOR,Fe.SCROLLBAR_THUMB_COLOR)},it),qt=((ct={})["".concat(Be.MENU,"[").concat(je,"]")]={pointerEvents:"none"},ct["".concat(Be.MENU,"[").concat(je,"] > ").concat(Me.HA_ICON_BUTTON)]={pointerEvents:"all"},ct),Yt=((at={})["".concat(Be.HOST," ").concat(Be.ITEM,":not(").concat(Be.ITEM_SELECTED,") > ").concat(Me.PAPER_ICON_ITEM)]={background:Bt(Ge.ITEM_BACKGROUND,"none")},at),$t=((st={})["".concat(Be.HOST," :is(").concat(Be.ITEM_HOVER,", ").concat(Be.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Be.ITEM_SELECTED,") > ").concat(Me.PAPER_ICON_ITEM)]={background:Bt(Ge.ITEM_BACKGROUND_HOVER,Ge.ITEM_BACKGROUND,"none")},st),Jt=((_t={})["".concat(Be.HOST," ").concat(Me.PAPER_ICON_ITEM," > :is(").concat(Me.HA_SVG_ICON,", ").concat(Me.HA_ICON,")")]={color:Bt(Ge.ICON_COLOR,Fe.SIDEBAR_ICON_COLOR)},_t),zt=((ut={})["".concat(Be.HOST," ").concat(Be.ITEM_SELECTED," > ").concat(Me.PAPER_ICON_ITEM," > :is(").concat(Me.HA_SVG_ICON,", ").concat(Me.HA_ICON,")")]={color:Bt(Ge.ICON_COLOR_SELECTED,Fe.SIDEBAR_SELECTED_ICON_COLOR)},ut),Qt=((lt={})["".concat(Be.HOST," :is(").concat(Be.ITEM_HOVER,", ").concat(Be.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Be.ITEM_SELECTED,") > ").concat(Me.PAPER_ICON_ITEM," > :is(").concat(Me.HA_SVG_ICON,", ").concat(Me.HA_ICON,")")]={color:Bt(Ge.ICON_COLOR_HOVER,Ge.ICON_COLOR,Fe.SIDEBAR_ICON_COLOR)},lt),Zt=((dt={})["".concat(Be.HOST," ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT)]={color:Bt(Ge.TEXT_COLOR,Fe.SIDEBAR_TEXT_COLOR)},dt),en=((Et={})["".concat(Be.HOST," ").concat(Be.ITEM_SELECTED," > ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT)]={color:Bt(Ge.TEXT_COLOR_SELECTED,Fe.SIDEBAR_SELECTED_TEXT_COLOR)},Et),tn=((ft={})["".concat(Be.HOST," :is(").concat(Be.ITEM_HOVER,", ").concat(Be.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Be.ITEM_SELECTED,") > ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT)]={color:Bt(Ge.TEXT_COLOR_HOVER,Ge.TEXT_COLOR,Fe.SIDEBAR_TEXT_COLOR)},ft),nn=((Ot={})["".concat(Be.HOST," :is(").concat(Be.ITEM,", ").concat(Be.SIDEBAR_NOTIFICATIONS_CONTAINER,") > ").concat(Me.PAPER_ICON_ITEM).concat(xe.BEFORE)]={background:Bt(Ge.SELECTION_BACKGROUND,Ge.ICON_COLOR_SELECTED,Fe.SIDEBAR_SELECTED_ICON_COLOR),opacity:Bt(Ge.SELECTION_OPACITY,"0.12")},Ot),on=((ht={})["".concat(Be.HOST_EXPANDED," ").concat(Me.PAPER_LISTBOX," > ").concat(Be.ITEM," > ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT).concat(Be.DATA_INFO).concat(xe.AFTER)]={color:Bt(Ge.INFO_COLOR,Fe.SIDEBAR_TEXT_COLOR),display:"block"},ht),rn=((pt={})["".concat(Be.HOST_EXPANDED," ").concat(Me.PAPER_LISTBOX," > ").concat(Be.ITEM).concat(Be.ITEM_SELECTED," > ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT).concat(Be.DATA_INFO).concat(xe.AFTER)]={color:Bt(Ge.INFO_COLOR_SELECTED,Fe.SIDEBAR_SELECTED_TEXT_COLOR)},pt),cn=((It={})["".concat(Be.HOST_EXPANDED," :is(").concat(Be.ITEM_HOVER,", ").concat(Be.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Be.ITEM_SELECTED,") > ").concat(Me.PAPER_ICON_ITEM," > ").concat(Be.ITEM_TEXT).concat(Be.DATA_INFO).concat(xe.AFTER)]={color:Bt(Ge.INFO_COLOR_HOVER,Ge.INFO_COLOR,Fe.SIDEBAR_TEXT_COLOR)},It),an=((Tt={})["".concat(Be.HOST," ").concat(Be.ITEM_SELECTED," > ").concat(Me.PAPER_ICON_ITEM," > :is(").concat(Be.NOTIFICATION_BADGE,", ").concat(Be.CONFIGURATION_BADGE,")")]={backgroundColor:Bt(Ge.NOTIFICATION_COLOR_SELECTED,Ge.NOTIFICATION_COLOR,Fe.ACCENT_COLOR),color:Bt(Ge.NOTIFICATION_TEXT_COLOR_SELECTED,Ge.NOTIFICATION_TEXT_COLOR,Fe.TEXT_ACCENT_COLOR,Fe.TEXT_PRIMARY_COLOR)},Tt),sn=((At={})["".concat(Be.HOST," :is(").concat(Be.ITEM_HOVER,", ").concat(Be.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Be.ITEM_SELECTED,") > ").concat(Me.PAPER_ICON_ITEM," > :is(").concat(Be.NOTIFICATION_BADGE,", ").concat(Be.CONFIGURATION_BADGE,")")]={backgroundColor:Bt(Ge.NOTIFICATION_COLOR_HOVER,Ge.NOTIFICATION_COLOR,Fe.ACCENT_COLOR),color:Bt(Ge.NOTIFICATION_TEXT_COLOR_HOVER,Ge.NOTIFICATION_TEXT_COLOR,Fe.TEXT_ACCENT_COLOR,Fe.TEXT_PRIMARY_COLOR)},At),_n="Invalid configuration",un=o(o(["title","subtitle","sidebar_background","title_color","subtitle_color","sidebar_button_color","sidebar_border_color","menu_background","divider_color","divider_top_color","divider_bottom_color","scrollbar_thumb_color","styles"],qe,!0),["default_path"],!0),ln=["js_variables","jinja_variables","partials","extendable_configs"],dn=function(e,t,n){t.forEach((function(t){if(typeof e[t]!==De.UNDEFINED&&typeof e[t]!==De.STRING)throw new SyntaxError("".concat(n,' "').concat(String(t),'" property should be a string'))}))},En=function(e,t,n){t.forEach((function(t){if(typeof e[t]!==De.UNDEFINED&&typeof e[t]!==De.STRING&&typeof e[t]!==De.NUMBER)throw new SyntaxError("".concat(n,' "').concat(String(t),'" property should be a number or a string'))}))},fn=function(e,t,n){t.forEach((function(t){if(typeof e[t]!==De.UNDEFINED&&typeof e[t]!==De.BOOLEAN)throw new SyntaxError("".concat(n,' "').concat(String(t),'" property should be a boolean'))}))},On=function(e,t,n){t.forEach((function(t){if(typeof e[t]!==De.UNDEFINED&&typeof e[t]!==De.BOOLEAN&&typeof e[t]!==De.STRING)throw new SyntaxError("".concat(n,' "').concat(String(t),'" property should be a boolean or a string'))}))},hn=function(e,t){e.forEach((function(e){var n=e[0],o=e[1];if(!pn(o))throw new SyntaxError("".concat(t,' "').concat(n,'" property should be a string or an array of strings'))}))},pn=function(e){return typeof e===De.UNDEFINED||(typeof e===De.STRING||Array.isArray(e)&&e.some((function(e){return typeof e===De.STRING})))},In=function(e,t,n,o){(void 0===o&&(o=!1),e)&&(Array.isArray(e)?e:[e]).forEach((function(e){var r;if(e===He&&!o)throw new SyntaxError("".concat(n,' "entend_from" can only be "base" in exceptions'));if(e!==He&&!(e in(null!==(r=t.extendable_configs)&&void 0!==r?r:{})))throw new SyntaxError("".concat(n,' "').concat(e,'" doesn\'t exist in "extendable_configs"'))}))},Tn=function(e,t,n){e&&(Array.isArray(e)?e:[e]).forEach((function(e){if(n.includes(e))throw new SyntaxError("".concat(_n,', circular extend dependency detected in "').concat(n.join(" > ")," > ").concat(e,'"'));if(e===He)throw new SyntaxError("".concat(_n,', error in extendable config "').concat(n[0],'": "entend_from" can only be "base" in exceptions'));if(!(e in t.extendable_configs))throw new SyntaxError("".concat(_n,', error in "').concat(n[n.length-1],'": "').concat(e,'" doesn\'t exist in "extendable_configs"'));Tn(t.extendable_configs[e].extend_from,t,o(o([],n,!0),[e],!1))}))},An=function(e,t){ln.forEach((function(n){if(n in e)throw new SyntaxError("".concat(t,' "').concat(n,'" option can only be placed in the main config'))}))},vn=function(e,t,n){if("string"==typeof t&&(bt.test(t)||mt.test(t)))console.warn('"'.concat(e,'" property should not have templates. "').concat(n.join(" > "),'" seems to be a template'));else if(typeof t!==De.STRING&&typeof t!==De.NUMBER&&typeof t!==De.BOOLEAN)if(Array.isArray(t))t.forEach((function(t,r){vn(e,t,o(o([],n,!0),["[".concat(r,"]")],!1))}));else{if(Object.prototype.toString.call(t)!==Ue)throw new SyntaxError("".concat(_n,', "').concat(e,": ").concat(n.join(" > "),'" has a wrong type ').concat(Object.prototype.toString.call(t)));var r=t;Object.entries(r).forEach((function(t){var r=t[0],i=t[1];vn(e,i,o(o([],n,!0),[r],!1))}))}},Rn=function(e,t){if(typeof t!==De.UNDEFINED){if(Object.prototype.toString.call(t)!==Ue)throw new SyntaxError("".concat(_n,', "').concat(e,'" property should be an object'));Object.entries(t).forEach((function(t){var n=t[0],o=t[1];vn(e,o,[n])}))}},Nn=function(e,t){if(typeof e!==De.UNDEFINED){if(!Array.isArray(e))throw new SyntaxError("".concat(_n,", exceptions should be an array"));e.forEach((function(e){!function(e,t){var n;if(An(e,"".concat(_n,", exceptions")),dn(e,o([],un,!0),"".concat(_n,", exceptions")),En(e,o([],Ye,!0),"".concat(_n,", exceptions")),hn([["user",e.user],["not_user",e.not_user],["device",e.device],["not_device",e.not_device],["extend_from",e.extend_from]],"".concat(_n,", exceptions")),In(e.extend_from,t,"".concat(_n,", error in exception:"),!0),typeof e.matchers_conditions!==De.UNDEFINED&&e.matchers_conditions!==pe.AND&&e.matchers_conditions!==pe.OR)throw new SyntaxError("".concat(_n,', exceptions "matchers_conditions" property should be "').concat(pe.AND,'" or "').concat(pe.OR,'"'));if(typeof e.order!==De.UNDEFINED&&!Array.isArray(e.order))throw new SyntaxError("".concat(_n,', exceptions "order" property should be an array'));if(On(e,["sidebar_editable"],"".concat(_n,", exceptions")),fn(e,["hide_all","is_admin","is_owner"],"".concat(_n,", exceptions")),typeof e.sidebar_mode!==De.UNDEFINED&&!(e.sidebar_mode in Rt))throw new SyntaxError("".concat(_n,', exceptions "sidebar_mode" property should be ').concat(Oe.HIDDEN,", ").concat(Oe.NARROW," or ").concat(Oe.EXTENDED));if(e.user&&e.not_user)throw new SyntaxError("".concat(_n,', exceptions "user" and "not_user" properties cannot be used together'));if(e.device&&e.not_device)throw new SyntaxError("".concat(_n,', exceptions "device" and "not_device" properties cannot be used together'));null===(n=e.order)||void 0===n||n.forEach(bn)}(e,t)}))}},bn=function(e){if(An(e,"".concat(_n," in ").concat(e.item,",")),!e.item)throw new SyntaxError("".concat(_n,', every item in an "order" array should have an "item" property'));if(dn(e,o(["item","info"],qe,!0),"".concat(_n," in ").concat(e.item,",")),En(e,o([],Ye,!0),"".concat(_n," in ").concat(e.item,",")),On(e,["hide"],"".concat(_n," in ").concat(e.item,",")),function(e,t){if(typeof e.on_click!==De.UNDEFINED){if(Object.prototype.toString.call(e.on_click)!==Ue)throw new SyntaxError("".concat(t,' "on_click" property should be an object'));if(typeof e.on_click.action!==De.STRING)throw new SyntaxError("".concat(t,' the "action" parameter should be a string'));if(!Object.values(Te).includes(e.on_click.action))throw new SyntaxError("".concat(t,' the "action" parameter should be one of these values: ').concat(Object.values(Te).join(", ")));if(e.on_click.action===Te.CALL_SERVICE){if(typeof e.on_click.service!==De.STRING)throw new SyntaxError("".concat(t,' the "service" parameter should be a string'));if(typeof e.on_click.data!==De.UNDEFINED&&Object.prototype.toString.call(e.on_click.data)!==Ue)throw new SyntaxError("".concat(t,' the "data" parameter needs to be an object'))}if(e.on_click.action===Te.JAVASCRIPT&&typeof e.on_click.code!==De.STRING)throw new SyntaxError("".concat(t,' the "code" parameter should be a string'))}}(e,"".concat(_n," in ").concat(e.item,",")),e.new_item){if(dn(e,["href","icon"],"".concat(_n," in ").concat(e.item,",")),!e.href&&!e.on_click)throw new SyntaxError("".concat(_n," in ").concat(e.item,', if you set "new_item" as "true", it is necessary an "href" or an "on_click "property'));if(!e.icon)throw new SyntaxError("".concat(_n," in ").concat(e.item,', if you set "new_item" as "true", "icon" property is necessary'))}},mn=function(e){var t;if(dn(e,o([],un,!0),"".concat(_n,",")),hn([["extend_from",e.extend_from]],"".concat(_n,",")),In(e.extend_from,e,"".concat(_n,", error in main config:")),function(e){e.extendable_configs&&Object.entries(e.extendable_configs).forEach((function(t){var n=t[0],o=t[1];Tn(o.extend_from,e,[n])}))}(e),En(e,o([],Ye,!0),"".concat(_n,",")),On(e,["sidebar_editable"],"".concat(_n,",")),fn(e,["hide_all"],"".concat(_n,",")),typeof e.sidebar_mode!==De.UNDEFINED&&!(e.sidebar_mode in Rt))throw new SyntaxError("".concat(_n,', "sidebar_mode" property should be ').concat(Oe.HIDDEN,", ").concat(Oe.NARROW," or ").concat(Oe.EXTENDED));if(typeof e.order!==De.UNDEFINED&&!Array.isArray(e.order))throw new SyntaxError("".concat(_n,', "order" property should be an array'));if(typeof e.partials!==De.UNDEFINED){if(Object.prototype.toString.call(e.partials)!==Ue)throw new SyntaxError("".concat(_n,', "partials" property should be an object'));Object.entries(e.partials).forEach((function(e){var t=e[0];if(typeof e[1]!==De.STRING)throw new SyntaxError("".concat(_n,', "partials" should be an object with strings. The partial ').concat(t," is not a string"))}))}Rn("js_variables",e.js_variables),Rn("jinja_variables",e.jinja_variables),null===(t=e.order)||void 0===t||t.forEach(bn),Nn(e.exceptions,e)},yn=function(){return t(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(n){return e="".concat(ge,": JSON config file not found."),t="Make sure you have valid config in /config/www/".concat(we,".json file."),[2,new Promise((function(n){fetch("".concat(Pe,".json?hash=").concat(Math.random().toString(16).slice(2))).then((function(o){if(!o.ok)throw Error("".concat(e,"\n").concat(t));o.json().then((function(e){var o;(null===(o=e.id)||void 0===o?void 0:o.startsWith("example_json"))&&console.warn("".concat(ge,": You seem to be using the example configuration.\n").concat(t)),mn(e),n(e)})).catch((function(e){throw Error("".concat(ge,": ").concat(e.message))}))})).catch((function(){throw Error("".concat(e,"\n").concat(t))}))}))]}))}))},Sn=function(){function o(){var e=this;this._parseJavaScriptVariables=function(){var t,n=null!==(t=e._config.js_variables)&&void 0!==t?t:{},o=Object.entries(n).filter((function(t){var n=t[0],o=t[1];if("string"==typeof o&&Ct.test(o)){var r=o.replace(Ct,"$1");return e._renderer.renderTemplate("\n const myRef = ref('".concat(n,"');\n myRef.value = ").concat(r,";\n return;\n ")),!1}return!0}));return Object.fromEntries(o)};var t=new re;t.addEventListener(B.ON_LISTEN,(function(t){e._homeAssistant=t.detail.HOME_ASSISTANT,e._main=t.detail.HOME_ASSISTANT_MAIN,e._haDrawer=t.detail.HA_DRAWER,e._sidebar=t.detail.HA_SIDEBAR,e._partialPanelResolver=t.detail.PARTIAL_PANEL_RESOLVER}),{once:!0}),t.addEventListener(B.ON_PANEL_LOAD,this._panelLoaded.bind(this)),t.listen(),this._styleManager=new Le({prefix:ge,namespace:ge,throwWarnings:!1}),this._items=[],this._sidebarScroll=0,this._isSidebarEditable=void 0,this._itemTouchedBinded=this._itemTouched.bind(this),this._mouseEnterBinded=this._mouseEnter.bind(this),this._mouseLeaveBinded=this._mouseLeave.bind(this),this._configPromise=yn(),this._process()}return o.prototype._getConfig=function(){return t(this,void 0,void 0,(function(){var e,t=this;return n(this,(function(n){switch(n.label){case 0:return e=this,[4,this._configPromise.then((function(e){return function(e,t,n){return new Ht(n,e,t).config}(t._ha.hass.user,navigator.userAgent.toLowerCase(),e)}))];case 1:return e._config=n.sent(),[2]}}))}))},o.prototype._getElements=function(){return t(this,void 0,void 0,(function(){var e,t,o,i;return n(this,(function(n){switch(n.label){case 0:return e={retries:100,delay:50,shouldReject:!1},[4,this._sidebar.selector.$.query(Me.PAPER_LISTBOX).element];case 1:return t=n.sent(),[4,r((function(){return t.querySelector(":scope > ".concat(Be.SPACER))}),(function(e){return!!e}),e)];case 2:return o=n.sent(),[4,r((function(){return t.querySelectorAll(":scope > ".concat(Be.ITEM))}),(function(e){return Array.from(e).every((function(e){return e.querySelector(Be.ITEM_TEXT).innerText.trim().length>0}))}),e)];case 3:return i=n.sent(),[2,[t,i,o]]}}))}))},o.prototype._hideAnchor=function(e,t){t?e.style.display="none":e.style.removeProperty("display")},o.prototype._buildNewItem=function(e){var t=document.createElement("a");return t.href=e.href?e.href:"#",t.target=e.target||"",t.tabIndex=-1,t.setAttribute(Ve.ROLE,"option"),t.setAttribute(Ve.PANEL,e.item.toLowerCase().replace(/\s+/,"-")),t.setAttribute(Ve.ARIA_SELECTED,"false"),t.innerHTML='\n \n \n \n ').concat(e.item,'\n \n \n \n ').trim(),t},o.prototype._getTemplateString=function(e){return t(this,void 0,void 0,(function(){var t,o;return n(this,(function(n){switch(n.label){case 0:return t="",e instanceof Promise||"string"==typeof e||"number"==typeof e&&!Number.isNaN(e)||"boolean"==typeof e||"object"==typeof e?"string"!=typeof e?[3,1]:(t=e.trim(),[3,6]):[3,6];case 1:return"number"!=typeof e&&"boolean"!=typeof e?[3,2]:(t=e.toString(),[3,6]);case 2:return e instanceof Promise?[4,e]:[3,5];case 3:return o=n.sent(),[4,this._getTemplateString(o)];case 4:return t=n.sent(),[3,6];case 5:t=JSON.stringify(e),n.label=6;case 6:return[2,t]}}))}))},o.prototype._subscribeTitle=function(){var e=this;this._sidebar.selector.$.query(Be.TITLE).element.then((function(t){e._config.title&&e._subscribeTemplate(e._config.title,(function(e){t.innerHTML=e})),e._config.subtitle&&e._subscribeTemplate(e._config.subtitle,(function(e){t.dataset.subtitle=e}))}))},o.prototype._subscribeSideBarEdition=function(){var e=this,t=function(e){e.preventDefault(),e.stopImmediatePropagation()},n=function(e,n){e.removeEventListener(Xe.HASS_EDIT_SIDEBAR,t,!0),n.removeAttribute(je)},o=function(e,n){e.removeEventListener(Xe.HASS_EDIT_SIDEBAR,t,!0),e.addEventListener(Xe.HASS_EDIT_SIDEBAR,t,!0),n.setAttribute(je,"")};Promise.all([this._main.element,this._sidebar.selector.$.query(Be.MENU).element]).then((function(t){var r=t[0],i=t[1];"boolean"==typeof e._config.sidebar_editable&&(e._isSidebarEditable=e._config.sidebar_editable,e._isSidebarEditable||o(r,i)),"string"==typeof e._config.sidebar_editable&&e._subscribeTemplate(e._config.sidebar_editable,(function(t){"true"===t||"false"===t?(e._isSidebarEditable=!("false"===t),e._isSidebarEditable?n(r,i):o(r,i)):(e._isSidebarEditable=void 0,n(r,i)),e._checkProfileEditableButton()}))}))},o.prototype._subscribeName=function(e,t){var n=e.querySelector(Be.ITEM_TEXT);this._subscribeTemplate(t,(function(e){n.innerHTML=e}))},o.prototype._subscribeIcon=function(e,t){this._subscribeTemplate(t,(function(t){var n=e.querySelector(Me.HA_ICON);if(!n){(n=document.createElement(Me.HA_ICON)).setAttribute("slot","item-icon");var o=e.querySelector(Me.HA_SVG_ICON);o?o.replaceWith(n):e.querySelector(Me.PAPER_ICON_ITEM).prepend(n)}n.setAttribute("icon",t)}))},o.prototype._subscribeInfo=function(e,t){var n=e.querySelector(Be.ITEM_TEXT);this._subscribeTemplate(t,(function(e){n.dataset.info=e}))},o.prototype._subscribeNotification=function(e,t){var n=e.querySelector("".concat(Be.NOTIFICATION_BADGE,":not(").concat(Be.NOTIFICATIONS_BADGE_COLLAPSED,")")),o=e.querySelector(Be.NOTIFICATIONS_BADGE_COLLAPSED);n||((n=document.createElement("span")).classList.add(ke.NOTIFICATIONS_BADGE),e.querySelector(Me.PAPER_ICON_ITEM).append(n)),o||((o=document.createElement("span")).classList.add(ke.NOTIFICATIONS_BADGE,ke.NOTIFICATIONS_BADGE_COLLAPSED),e.querySelector("".concat(Me.HA_SVG_ICON,", ").concat(Me.HA_ICON)).after(o));this._subscribeTemplate(t,(function(t){t.length?(n.innerHTML=t,o.innerHTML=t,e.setAttribute(Ve.WITH_NOTIFICATION,"true")):(n.innerHTML="",o.innerHTML="",e.removeAttribute(Ve.WITH_NOTIFICATION))}))},o.prototype._subscribeHide=function(e,t){var n=this;"boolean"==typeof t?this._hideAnchor(e,t):this._subscribeTemplate(t,(function(t){n._hideAnchor(e,"true"===t)}))},o.prototype._subscribeTemplateColorChanges=function(e,t,n){var o=this;n.forEach((function(n){var r=n[0],i=n[1];e[r]&&o._subscribeTemplate(e[r],(function(e){t.style.setProperty(i,e)}))}))},o.prototype._subscribeTemplate=function(e,t){bt.test(e)?this._createJsTemplateSubscription(e.replace(bt,"$1"),t):mt.test(e)?this._createJinjaTemplateSubscription(e,t):this._getTemplateString(e).then((function(e){t(e)}))},o.prototype._createJsTemplateSubscription=function(e,t){var n=this;this._renderer.trackTemplate(Mt(e,this._config.partials),(function(e){n._getTemplateString(e).then((function(e){t(e)}))}))},o.prototype._createJinjaTemplateSubscription=function(t,n){var o=this;window.hassConnection.then((function(r){r.conn.subscribeMessage((function(e){n("".concat(e.result))}),{type:Xe.RENDER_TEMPLATE,template:Mt(t,o._config.partials),variables:e({user_name:o._ha.hass.user.name,user_is_admin:o._ha.hass.user.is_admin,user_is_owner:o._ha.hass.user.is_owner,user_agent:window.navigator.userAgent},o._config.jinja_variables)})}))},o.prototype._focusItem=function(e,t,n){var o=this._items.length,r="none",i=0;if(t)for(var c=(_=e+1)+o,a=_;ao-1?a-o:a;if(this._items[s].style.display!==r){i=s;break}}else{var _;for(c=(_=e-1)-o,a=_;a>c;a--){s=a<0?o+a:a;if(this._items[s].style.display!==r){i=s;break}}}n?this._items[i].querySelector(Me.PAPER_ICON_ITEM).focus():(this._items[i].focus(),this._items[i].tabIndex=0)},o.prototype._focusItemByKeyboard=function(e,t){var n=e.querySelector("\n ".concat(Be.SCOPE," > ").concat(Be.ITEM,":not(.").concat(ke.IRON_SELECTED,"):focus,\n ").concat(Be.SCOPE," > ").concat(Be.ITEM,":focus,\n ").concat(Be.SCOPE," > ").concat(Be.ITEM,":has(> ").concat(Me.PAPER_ICON_ITEM,":focus)\n ")),o=0;this._items.forEach((function(e,t){e===n&&(o=t),e.tabIndex=-1})),this._focusItem(o,t,!1)},o.prototype._focusItemByTab=function(e,t,n){if(t.nodeName===Ke.A){var o=t,r=this._items.indexOf(o),i=this._items.length-1;if(n&&r0)this._focusItem(r,n,!0);else(n?e.querySelector(Be.SIDEBAR_NOTIFICATIONS):e.querySelector(Me.HA_ICON_BUTTON)).focus()}else{if(n)e.querySelector("".concat(Be.PROFILE," > ").concat(Me.PAPER_ICON_ITEM)).focus();else this._focusItem(0,n,!0)}},o.prototype._getActivePaperIconElement=function(e){void 0===e&&(e=document);var t=e.activeElement;return t?t instanceof HTMLElement&&(t.nodeName===Ke.PAPER_ICON_ITEM||t.nodeName===Ke.A&&"option"===t.getAttribute("role"))?t:t.shadowRoot&&vt.includes(t.nodeName)?this._getActivePaperIconElement(t.shadowRoot):null:null},o.prototype._processDefaultPath=function(){var e,t=this._config.default_path;if(t)if(t.startsWith("/")){var n=[null,"",t];(e=window.history).replaceState.apply(e,n),window.dispatchEvent(new CustomEvent(Xe.LOCATION_CHANGED,{detail:{replace:t}}))}else console.warn("".concat(ge,': ignoring default_path property as it doesn\'t start with "/".'))},o.prototype._processSidebar=function(){var e=this;Promise.all([this._main.element,this._partialPanelResolver.element]).then((function(o){var r=o[0],i=o[1],c=e._config.sidebar_mode,a=matchMedia("(max-width: 870px)");if(c){r.hass.dockedSidebar=Rt[c];var s=function(o){return t(e,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return c===Oe.HIDDEN?[3,5]:[4,Dt()];case 1:return e.sent(),r.narrow=!1,[4,Dt()];case 2:return e.sent(),i.narrow=o,[4,Dt()];case 3:return e.sent(),o?[4,this._partialPanelResolver.selector.query(Be.HA_MENU_BUTTON).element]:[3,5];case 4:e.sent().narrow=!1,e.label=5;case 5:return[2]}}))}))};a.addEventListener("change",(function(e){s(e.matches)})),s(a.matches)}})),Promise.all([this._haDrawer.selector.$.query(Be.MC_DRAWER).element,this._sidebar.element,this._sidebar.selector.$.element,this._sidebar.selector.$.query(Me.PAPER_LISTBOX).element]).then((function(t){var n=t[0],o=t[1],r=t[2],i=t[3];e._subscribeTemplateColorChanges(e._config,o,Je),e._subscribeTemplateColorChanges(e._config,n,[["sidebar_border_color",Ge.BORDER_COLOR]]),i.addEventListener(Xe.KEYDOWN,(function(t){t.key!==We.ARROW_DOWN&&t.key!==We.ARROW_UP||(t.preventDefault(),t.stopImmediatePropagation(),e._focusItemByKeyboard(i,t.key===We.ARROW_DOWN))}),!0),window.addEventListener(Xe.KEYDOWN,(function(t){if(t.key===We.TAB){var n=e._getActivePaperIconElement();if(n)if(n.nodeName===Ke.PAPER_ICON_ITEM){var o=n.parentElement;o.getAttribute(Ve.HREF)!==Nt&&(t.preventDefault(),t.stopImmediatePropagation(),e._focusItemByTab(r,o,!t.shiftKey))}else n.getAttribute(Ve.HREF)!==Nt&&(t.preventDefault(),t.stopImmediatePropagation(),e._focusItemByTab(r,n,!t.shiftKey))}}),!0),e._styleManager.addStyle(Wt,n),e._styleManager.addStyle([Ft,Gt,Ut,jt,kt,Vt,Xt,Kt,qt,Yt,$t,Jt,zt,Qt,Zt,en,tn,nn,on,rn,cn,an,sn,e._config.styles||""],r)}))},o.prototype._rearrange=function(){var t=this;this._getElements().then((function(n){var o=t._config,r=o.order,i=o.hide_all,c=n[0],a=n[1],s=n[2],_=0,u=!1;t._items=Array.from(a);var l=new Set;i&&t._items.forEach((function(e){t._hideAnchor(e,!0)}));var d=r.reduce((function(n,o){var r=o.item,i=o.match,c=o.exact,a=o.new_item,s=r.toLocaleLowerCase(),_=a?void 0:t._items.find((function(e){var t=i===Ie.DATA_PANEL?e.getAttribute(Ve.PANEL):i===Ie.HREF?e.getAttribute(Ve.HREF):e.querySelector(Be.ITEM_TEXT).innerText.trim();return!((!c||r!==t)&&(c||!(null==t?void 0:t.toLowerCase().includes(s))))&&(!l.has(e)&&(l.add(e),!0))}));return _&&_.setAttribute(Ve.PROCESSED,"true"),(a||_)&&n.push(e(e({},o),{element:_})),a||_||console.warn("".concat(ge,": you have an order item in your configuration that didn't match any sidebar item: \"").concat(r,'"')),n}),[]),E=function(){u||(t._items.forEach((function(e){e.hasAttribute(Ve.PROCESSED)||(e.style.order="".concat(_))})),_++,s.style.order="".concat(_),_++,u=!0)};d.forEach((function(e){if(e.bottom&&E(),e.new_item){var n=t._buildNewItem(e);c.append(n),e.element=n,e.element.setAttribute(Ve.PROCESSED,"true"),t._items.push(e.element)}else if(e.element){var o=e.element;e.href&&(o.href=e.href),e.target&&(o.target=e.target)}e.element.style.order="".concat(_),e.name&&t._subscribeName(e.element,e.name),e.icon&&t._subscribeIcon(e.element,e.icon),e.info&&t._subscribeInfo(e.element,e.info),e.notification&&t._subscribeNotification(e.element,e.notification),void 0!==e.hide&&t._subscribeHide(e.element,e.hide),t._subscribeTemplateColorChanges(e,e.element,$e),e.new_item&&(e.element.addEventListener(Xe.MOUSEENTER,t._mouseEnterBinded),e.element.addEventListener(Xe.MOUSELEAVE,t._mouseLeaveBinded)),e.element.addEventListener(Xe.MOUSEDOWN,t._itemTouchedBinded),e.element.addEventListener(Xe.KEYDOWN,(function(e){e.key===We.ENTER&&t._itemTouchedBinded()})),e.on_click&&e.element.addEventListener(Xe.CLICK,t._mouseClick.bind(t,e.on_click),!0),_++})),d.length&&E(),t._items.sort((function(e,t){return+e.style.order-+t.style.order})),t._panelLoaded()}))},o.prototype._itemTouched=function(){return t(this,void 0,void 0,(function(){var e=this;return n(this,(function(t){return this._sidebar.selector.$.query(Me.PAPER_LISTBOX).element.then((function(t){e._sidebarScroll=t.scrollTop})),[2]}))}))},o.prototype._mouseEnter=function(e){this._sidebar.element.then((function(t){t.alwaysExpand||(t._mouseLeaveTimeout&&(clearTimeout(t._mouseLeaveTimeout),t._mouseLeaveTimeout=void 0),t._showTooltip(e.currentTarget))}))},o.prototype._mouseLeave=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return this._sidebar.element.then((function(e){e._mouseLeaveTimeout&&clearTimeout(e._mouseLeaveTimeout),e._mouseLeaveTimeout=window.setTimeout((function(){e._hideTooltip()}),500)})),[2]}))}))},o.prototype._mouseClick=function(e,o){return t(this,void 0,void 0,(function(){var t,r,i,c,a,s,_,u,l;return n(this,(function(n){switch(t=o.currentTarget,r="#"===t.getAttribute(Ve.HREF),i=t.getAttribute(Ve.PANEL),r&&(o.preventDefault(),o.stopImmediatePropagation()),e.action){case Te.CALL_SERVICE:c=e.service,a=e.data,s=void 0===a?{}:a,3===(null==(_=c.match(St))?void 0:_.length)?this._ha.hass.callService(_[1],_[2],s):console.warn("".concat(ge,' ignoring "').concat(Te.CALL_SERVICE,'" action in "').concat(i,'" item. The service parameter is malfomed.'));break;case Te.JAVASCRIPT:u=e.code,l=u.includes("return")?u:"".concat(u,"\n;return;"),this._renderer.renderTemplate(l)}return[2]}))}))},o.prototype._checkProfileEditableButton=function(){return t(this,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:return[4,this._partialPanelResolver.element];case 1:return e=n.sent(),"/profile/general"!==e.__route.path?[3,3]:[4,this._partialPanelResolver.selector.query(Be.EDIT_SIDEBAR_BUTTON).element];case 2:(t=n.sent())&&(!1===this._isSidebarEditable?t.setAttribute(Ve.DISABLED,""):t.removeAttribute(Ve.DISABLED)),n.label=3;case 3:return[2]}}))}))},o.prototype._panelLoaded=function(){return t(this,void 0,void 0,(function(){var e,t,o,r,i;return n(this,(function(n){switch(n.label){case 0:return[4,this._partialPanelResolver.element];case 1:return e=n.sent(),t=e.__route.path,[4,this._sidebar.selector.$.query(Me.PAPER_LISTBOX).element];case 2:return o=n.sent(),r=o.querySelector("\n ".concat(Be.SCOPE," > ").concat(Be.ITEM,'[href="').concat(t,'"],\n ').concat(Be.SCOPE," > ").concat(Be.ITEM,'[href="').concat(t,'/dashboard"]\n ')),i=r?null:this._items.reduce((function(e,n){var o=n.getAttribute(Ve.HREF);return t.startsWith(o)&&(!e||o.length>e.getAttribute(Ve.HREF).length)&&(e=n),e}),null),this._items.forEach((function(e){var t=r&&r===e||!r&&i===e;e.classList.toggle(ke.IRON_SELECTED,t),e.setAttribute(Ve.ARIA_SELECTED,"".concat(t))})),o.scrollTop!==this._sidebarScroll&&(o.scrollTop=this._sidebarScroll),this._checkProfileEditableButton(),[2]}}))}))},o.prototype._process=function(){var e=this;this._homeAssistant.element.then((function(t){e._ha=t,new Re(e._ha).getRenderer().then((function(t){e._renderer=t,e._getConfig().then((function(){e._renderer.variables=e._parseJavaScriptVariables(),e._processDefaultPath(),e._processSidebar(),e._subscribeTitle(),e._subscribeSideBarEdition(),e._rearrange()}))}))}))},o}();window.CustomSidebar||(console.info("%c≡ ".concat(ge.toUpperCase()," (JSON)%cv").concat("8.4.1"),"font-weight: bold; background: #EEEEEE; color: #666666; padding: 2px 5px;","font-weight: normal; background: #E87A24; color: #FFFFFF; padding: 2px 5px"),window.CustomSidebar=new Sn)}(); +!function(){"use strict";var t=function(){return t=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<])(".concat(Object.values(st).join("|"),")($|[ \\?)+:\\}\\]><.])"),"gm"),this._scopped=ft(t,o,i),this._watchForPanelUrlChange(),this._watchForEntitiesChange()}return t.prototype._executeRenderingFunctions=function(t){var e=this;this._subscriptions.get(t).forEach((function(t,n){t.forEach((function(t){e.trackTemplate(n,t)}))}))},t.prototype._watchForPanelUrlChange=function(){var t=this;window.addEventListener(_t.LOCATION_CHANGED,(function(e){t._panelUrlWatchCallback()})),window.addEventListener(_t.POPSTATE,(function(){t._panelUrlWatchCallback()}))},t.prototype._panelUrlWatchCallback=function(){this._subscriptions.has(st.PANEL_URL)&&this._executeRenderingFunctions(st.PANEL_URL)},t.prototype._watchForEntitiesChange=function(){var t=this;window.hassConnection.then((function(e){e.conn.subscribeMessage((function(e){return t._entityWatchCallback(e)}),{type:_t.SUBSCRIBE_EVENTS,event_type:_t.STATE_CHANGE_EVENT})}))},t.prototype._entityWatchCallback=function(t){if(this._subscriptions.size){var e=t.data.entity_id;this._subscriptions.has(e)&&this._executeRenderingFunctions(e)}},t.prototype._storeTracked=function(t,e){var n=this;this._scopped.tracked.forEach((function(o){if(n._subscriptions.has(o)){var r=n._subscriptions.get(o);if(r.has(t)){var i=r.get(t);i.has(e)||i.add(e)}else r.set(t,new Set([e]))}else n._subscriptions.set(o,new Map([[t,new Set([e])]]))}))},t.prototype._untrackTemplate=function(t,e){var n=this;this._subscriptions.forEach((function(o,r){if(o.has(t)){var i=o.get(t);i.has(e)&&i.delete(e),0===i.size&&(o.delete(t),0===o.size&&n._subscriptions.delete(r))}}))},t.prototype.renderTemplate=function(t){try{var e=new Map(Object.entries(this._variables)),n=t.trim().replace(this._clientSideEntitiesRegExp,"$1clientSide.$2$3"),o=n.includes("return")||!this._autoReturn?n:"return ".concat(n);return(new(Function.bind.apply(Function,it(it([void 0,"hass","states","is_state","state_attr","is_state_attr","has_value","entities","entity_prop","is_entity_prop","devices","device_attr","is_device_attr","device_id","areas","area_id","area_name","area_entities","area_devices","user_name","user_is_admin","user_is_owner","user_agent","clientSide","ref","unref"],Array.from(e.keys()),!1),["".concat('"use strict";'," ").concat(o)],!1)))).apply(void 0,it([this._scopped.hass,this._scopped.states,this._scopped.is_state.bind(this._scopped),this._scopped.state_attr.bind(this._scopped),this._scopped.is_state_attr.bind(this._scopped),this._scopped.has_value.bind(this._scopped),this._scopped.entities,this._scopped.entity_prop,this._scopped.is_entity_prop.bind(this._scopped),this._scopped.devices,this._scopped.device_attr.bind(this._scopped),this._scopped.is_device_attr.bind(this._scopped),this._scopped.device_id.bind(this._scopped),this._scopped.areas.bind(this._scopped),this._scopped.area_id.bind(this._scopped),this._scopped.area_name.bind(this._scopped),this._scopped.area_entities.bind(this._scopped),this._scopped.area_devices.bind(this._scopped),this._scopped.user_name,this._scopped.user_is_admin,this._scopped.user_is_owner,this._scopped.user_agent,this._scopped.clientSideProxy,this._scopped.ref.bind(this._scopped,this._entityWatchCallback.bind(this)),this._scopped.unref.bind(this._scopped,this.cleanTracked.bind(this))],Array.from(e.values()),!1))}catch(t){if(this._throwErrors)throw t;return void(this._throwWarnings&&console.warn(t))}},t.prototype.trackTemplate=function(t,e){var n=this;this._scopped.cleanTracked();var o=this.renderTemplate(t);return this._storeTracked(t,e),e(o),function(){return n._untrackTemplate(t,e)}},t.prototype.cleanTracked=function(t){t?this._subscriptions.has(t)&&this._subscriptions.delete(t):this._subscriptions.clear()},Object.defineProperty(t.prototype,"variables",{get:function(){return this._variables},set:function(t){this._variables=t},enumerable:!1,configurable:!0}),t}(),vt=function(){function t(t,e){void 0===e&&(e={}),this._renderer=r((function(){return t.hass}),(function(t){return!!(t&&t.areas&&t.devices&&t.entities&&t.states&&t.user)}),{retries:100,delay:50,rejectMessage:"The provided element doesn't contain a proper or initialised hass object"}).then((function(){return new At(t,e)}))}return t.prototype.getRenderer=function(){return this._renderer},t}(),Rt=/([A-Z])([a-z0-9_-]+)/g,Nt=function(t){return Object.entries(t).map((function(t){var e=t[0],n=t[1];return"".concat(function(t){return t.replace(Rt,(function(t,e,n,o){var r=e.toLocaleLowerCase();return o?"-".concat(r).concat(n):"--".concat(r).concat(n)}))}(e),":").concat(n)})).join(";")+";"},bt=function(t){return(Array.isArray(t)?t:[t]).map((function(t){return"string"==typeof t?t:Object.entries(t).map((function(t){var e=t[0],n=t[1];return!1===n?"".concat(e,"{display: none !important}"):"".concat(e,"{").concat(Nt(n),"}")})).join("")})).join("")},mt=function(t,e){return"".concat(e,"_").concat(t)},yt=function(t){return t instanceof ShadowRoot?t.host.localName:t.localName},St=function(t,e){var n=mt(yt(t),e);return t.querySelector("#".concat(n))},Ct=function(){function t(t){var e,n,o;void 0===t&&(t={}),this._prefix=null!==(e=t.prefix)&&void 0!==e?e:"ha-styles-manager",this._namespace=null!==(n=t.namespace)&&void 0!==n?n:"home-assistant-styles-manager",this._throwWarnings=null===(o=t.throwWarnings)||void 0===o||o}return t.prototype.getStyleElement=function(t){return St(t,this._prefix)},t.prototype.addStyle=function(t,e){!function(t,e,n,o,r){if(e){var i=St(e,n);if(!i){var c=mt(yt(e),n);(i=document.createElement("style")).setAttribute("id",c),e.appendChild(i)}i.innerHTML="string"==typeof t?t:bt(t)}else r&&console.warn("".concat(o,': no element has been provided calling "addStyle"'))}(t,e,this._prefix,this._namespace,this._throwWarnings)},t.prototype.removeStyle=function(t){!function(t,e,n,o){if(t){var r=St(t,e);r?r.remove():o&&console.warn("".concat(n,': no style to remove calling "removeStyle"'))}else o&&console.warn("".concat(n,': no element has been provided calling "removeStyle"'))}(t,this._prefix,this._namespace,this._throwWarnings)},t}();!function(t){t.HIDDEN="hidden",t.NARROW="narrow",t.EXTENDED="extended"}(Ot||(Ot={})),function(t){t.DOCKED="docked",t.AUTO="auto",t.ALWAYS_HIDDEN="always_hidden"}(ht||(ht={})),function(t){t.AND="AND",t.OR="OR"}(pt||(pt={})),function(t){t.TEXT="text",t.DATA_PANEL="data-panel",t.HREF="href"}(It||(It={})),function(t){t.CALL_SERVICE="call-service",t.JAVASCRIPT="javascript"}(Tt||(Tt={}));var Lt,Dt,gt="custom-sidebar",wt="sidebar-config",Pt="".concat("/local/").concat(wt),Ht="base";!function(t){t.BOOLEAN="boolean",t.STRING="string",t.UNDEFINED="undefined",t.NUMBER="number"}(Dt||(Dt={}));var Mt,Bt,xt,Ft,Gt,Ut="[object Object]",jt="data-blocked";!function(t){t.SIDEBAR="ha-sidebar",t.PAPER_LISTBOX="paper-listbox",t.PAPER_ICON_ITEM="paper-icon-item",t.HA_SVG_ICON="ha-svg-icon",t.HA_ICON="ha-icon",t.HA_ICON_BUTTON="ha-icon-button"}(Mt||(Mt={})),function(t){t.HOST=":host",t.HOST_EXPANDED=":host([expanded])",t.SCOPE=":scope",t.TITLE=".title",t.ITEM='a[role="option"]',t.ITEM_SELECTED=".iron-selected",t.ITEM_HOVER='a[role="option"]:hover',t.SPACER=".spacer",t.ITEM_TEXT=".item-text",t.NOTIFICATION_BADGE=".notification-badge",t.NOTIFICATIONS_BADGE_COLLAPSED=".notification-badge-collapsed",t.CONFIGURATION_BADGE=".configuration-badge",t.HA_MENU_BUTTON="ha-panel-lovelace$ hui-root$ .toolbar > ha-menu-button",t.EDIT_SIDEBAR_BUTTON="ha-panel-profile ha-profile-section-general$ ha-settings-row mwc-button",t.SIDEBAR_NOTIFICATIONS_CONTAINER=".notifications-container",t.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER=".notifications-container:hover",t.SIDEBAR_NOTIFICATIONS=".notifications",t.PROFILE=".profile",t.MENU=".menu",t.DIVIDER=".divider",t.MC_DRAWER=".mdc-drawer",t.HA_SCROLLBAR=".ha-scrollbar",t.DATA_INFO="[data-info]"}(Bt||(Bt={})),function(t){t.AFTER="::after",t.BEFORE="::before",t.WEBKIT_SCROLLBAR_THUMB="::-webkit-scrollbar-thumb"}(xt||(xt={})),function(t){t.PRIMARY_BACKGROUND_COLOR="--primary-background-color",t.SIDEBAR_BACKGROUND_COLOR="--sidebar-background-color",t.SIDEBAR_TITLE_COLOR="--sidebar-menu-button-text-color",t.SIDEBAR_BUTTON_COLOR="--sidebar-icon-color",t.SIDEBAR_MENU_BUTTON_BACKGROUND_COLOR="--sidebar-menu-button-background-color",t.SIDEBAR_ICON_COLOR="--sidebar-icon-color",t.SIDEBAR_SELECTED_ICON_COLOR="--sidebar-selected-icon-color",t.SIDEBAR_TEXT_COLOR="--sidebar-text-color",t.SIDEBAR_SELECTED_TEXT_COLOR="--sidebar-selected-text-color",t.ACCENT_COLOR="--accent-color",t.TEXT_ACCENT_COLOR="--text-accent-color",t.TEXT_PRIMARY_COLOR="--text-primary-color",t.PRIMARY_TEXT_COLOR="--primary-text-color",t.DIVIDER_COLOR="--divider-color",t.SCROLLBAR_THUMB_COLOR="--scrollbar-thumb-color"}(Ft||(Ft={})),function(t){t.BACKGROUND="--custom-sidebar-background",t.BORDER_COLOR="--custom-sidebar-border-color",t.MENU_BACKGROUND="--custom-sidebar-menu-background",t.TITLE_COLOR="--custom-sidebar-title-color",t.SUBTITLE_COLOR="--custom-sidebar-subtitle-color",t.BUTTON_COLOR="--custom-sidebar-button-color",t.DIVIDER_COLOR="--custom-sidebar-divider-color",t.DIVIDER_TOP_COLOR="--custom-sidebar-divider-top-color",t.DIVIDER_BOTTOM_COLOR="--custom-sidebar-divider-bottom-color",t.SCROLLBAR_THUMB_COLOR="--custom-sidebar-scrollbar-thumb-color",t.ITEM_BACKGROUND="--custom-sidebar-item-background",t.ITEM_BACKGROUND_HOVER="--custom-sidebar-item-background-hover",t.ICON_COLOR="--custom-sidebar-icon-color",t.ICON_COLOR_SELECTED="--custom-sidebar-icon-color-selected",t.ICON_COLOR_HOVER="--custom-sidebar-icon-color-hover",t.TEXT_COLOR="--custom-sidebar-text-color",t.TEXT_COLOR_SELECTED="--custom-sidebar-text-color-selected",t.TEXT_COLOR_HOVER="--custom-sidebar-text-color-hover",t.SELECTION_BACKGROUND="--custom-sidebar-selection-background",t.SELECTION_OPACITY="--custom-sidebar-selection-opacity",t.INFO_COLOR="--custom-sidebar-info-color",t.INFO_COLOR_SELECTED="--custom-sidebar-info-color-selected",t.INFO_COLOR_HOVER="--custom-sidebar-info-color-hover",t.NOTIFICATION_COLOR="--custom-sidebar-notification-color",t.NOTIFICATION_COLOR_SELECTED="--custom-sidebar-notification-color-selected",t.NOTIFICATION_COLOR_HOVER="--custom-sidebar-notification-color-hover",t.NOTIFICATION_TEXT_COLOR="--custom-sidebar-notification-text-color",t.NOTIFICATION_TEXT_COLOR_SELECTED="--custom-sidebar-notification-text-color-selected",t.NOTIFICATION_TEXT_COLOR_HOVER="--custom-sidebar-notification-text-color-hover"}(Gt||(Gt={}));var kt,Vt,Xt,Wt,Kt,qt=["item_background","item_background_hover","icon_color","icon_color_selected","icon_color_hover","text_color","text_color_selected","text_color_hover","selection_background","info_color","info_color_selected","info_color_hover","notification_color","notification_color_selected","notification_color_hover","notification_text_color","notification_text_color_selected","notification_text_color_hover","divider_color"],Yt=["selection_opacity"],$t=[["item_background",Gt.ITEM_BACKGROUND],["item_background_hover",Gt.ITEM_BACKGROUND_HOVER],["icon_color",Gt.ICON_COLOR],["icon_color_selected",Gt.ICON_COLOR_SELECTED],["icon_color_hover",Gt.ICON_COLOR_HOVER],["text_color",Gt.TEXT_COLOR],["text_color_selected",Gt.TEXT_COLOR_SELECTED],["text_color_hover",Gt.TEXT_COLOR_HOVER],["selection_background",Gt.SELECTION_BACKGROUND],["selection_opacity",Gt.SELECTION_OPACITY],["info_color",Gt.INFO_COLOR],["info_color_selected",Gt.INFO_COLOR_SELECTED],["info_color_hover",Gt.INFO_COLOR_HOVER],["notification_color",Gt.NOTIFICATION_COLOR],["notification_color_selected",Gt.NOTIFICATION_COLOR_SELECTED],["notification_color_hover",Gt.NOTIFICATION_COLOR_HOVER],["notification_text_color",Gt.NOTIFICATION_TEXT_COLOR],["notification_text_color_selected",Gt.NOTIFICATION_TEXT_COLOR_SELECTED],["notification_text_color_hover",Gt.NOTIFICATION_TEXT_COLOR_HOVER],["divider_color",Gt.DIVIDER_COLOR]],Jt=o([["title_color",Gt.TITLE_COLOR],["subtitle_color",Gt.SUBTITLE_COLOR],["sidebar_button_color",Gt.BUTTON_COLOR],["sidebar_background",Gt.BACKGROUND],["menu_background",Gt.MENU_BACKGROUND],["scrollbar_thumb_color",Gt.SCROLLBAR_THUMB_COLOR],["divider_top_color",Gt.DIVIDER_TOP_COLOR],["divider_bottom_color",Gt.DIVIDER_BOTTOM_COLOR]],$t,!0);!function(t){t.NOTIFICATIONS_BADGE="notification-badge",t.NOTIFICATIONS_BADGE_COLLAPSED="notification-badge-collapsed",t.IRON_SELECTED="iron-selected"}(kt||(kt={})),function(t){t.PANEL="data-panel",t.ROLE="role",t.PROCESSED="data-processed",t.WITH_NOTIFICATION="data-notification",t.WITH_DIVIDER="data-divider",t.ARIA_SELECTED="aria-selected",t.ARIA_DISABLED="aria-disabled",t.DISABLED="disabled",t.HREF="href",t.STYLE="style"}(Vt||(Vt={})),function(t){t.CLICK="click",t.MOUSEDOWN="mousedown",t.MOUSEENTER="mouseenter",t.MOUSELEAVE="mouseleave",t.KEYDOWN="keydown",t.HASS_EDIT_SIDEBAR="hass-edit-sidebar",t.RENDER_TEMPLATE="render_template",t.LOCATION_CHANGED="location-changed"}(Xt||(Xt={})),function(t){t.ARROW_DOWN="ArrowDown",t.ARROW_UP="ArrowUp",t.ENTER="Enter",t.TAB="Tab"}(Wt||(Wt={})),function(t){t.PAPER_ICON_ITEM="PAPER-ICON-ITEM",t.A="A"}(Kt||(Kt={}));var zt,Qt,Zt,te,ee,ne,oe,re,ie,ce,ae,se,_e,ue,le,de,Ee,fe,Oe,he,pe,Ie,Te,Ae,ve,Re=["HOME-ASSISTANT","HOME-ASSISTANT-MAIN","HA-SIDEBAR"],Ne=((Lt={})[Ot.HIDDEN]=ht.ALWAYS_HIDDEN,Lt[Ot.NARROW]=ht.AUTO,Lt[Ot.EXTENDED]=ht.DOCKED,Lt),be="/profile",me=/^\s*\[\[\[([\s\S]+)\]\]\]\s*$/,ye=/\{\{[\s\S]*\}\}|\{%[\s\S]*%\}/,Se=/@partial\s+([\w-]+)/g,Ce=/^\s*([a-z_]+)\.([\w-]+)\s*$/,Le=/^\s*ref\(([\s\S]*)\)\s*$/,De=function(t){return Array.isArray(t)?t.map((function(t){return t.toLowerCase()})):t.toLowerCase().split(/\s*,\s*/)},ge=function(){return new Promise((function(t){setTimeout(t,1)}))},we=o(o([],qt,!0),Yt,!0),Pe=["id","exceptions","extendable_configs","extend_from","user","not_user","device","not_device","is_admin"],He=["js_variables","jinja_variables","partials"],Me=function(){function e(t,e,n){var o;this._config=t,this._extendable=new Map(Object.entries(null!==(o=this._config.extendable_configs)&&void 0!==o?o:[])),this._user=e,this._userAgent=n,this._exceptions=this._getExceptions(),this._buildFlattenConfig()}return e.prototype._getExceptions=function(){var t=this;if(this._config.exceptions){var e=this._user.name.toLocaleLowerCase();return this._config.exceptions.filter((function(n){var o,r=null!==(o=n.matchers_conditions)&&void 0!==o?o:pt.OR,i=void 0!==n.user&&De(n.user).includes(e),c=void 0!==n.not_user&&!De(n.not_user).includes(e),a=void 0!==n.device&&De(n.device).some((function(e){return t._userAgent.includes(e)})),s=void 0!==n.not_device&&!De(n.not_device).some((function(e){return t._userAgent.includes(e)})),_=void 0!==n.is_admin&&n.is_admin===t._user.is_admin,u=void 0!==n.is_owner&&n.is_owner===t._user.is_owner;return r===pt.OR?i||c||a||s||_||u:(void 0===n.user||i)&&(void 0===n.not_user||c)&&(void 0===n.device||a)&&(void 0===n.not_device||s)&&(void 0===n.is_admin||_)&&(void 0===n.is_owner||u)}))}return[]},e.prototype._mergeConfigs=function(){for(var e=[],n=0;n ")," > ").concat(r));return Be(e[r].trim(),e,o(o([],n,!0),[r],!1))}return console.warn("".concat(gt,": partial ").concat(r," doesn't exist")),""}))},xe=function(){for(var t=[],e=0;e ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT)]={maxWidth:"calc(100% - 100px)"},zt["".concat(Bt.HOST_EXPANDED," ").concat(Mt.PAPER_LISTBOX," > ").concat(Bt.ITEM," > ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT)]={display:"flex",flexDirection:"column",gap:"5px",lineHeight:"1"},zt["".concat(Bt.HOST_EXPANDED," ").concat(Mt.PAPER_LISTBOX," > ").concat(Bt.ITEM," > ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT).concat(xt.AFTER)]={content:"attr(data-info)",display:"none",fontSize:"11px",lineHeight:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},zt["{ SELECTOR.HOST_EXPANDED } ".concat(Mt.PAPER_LISTBOX," > ").concat(Bt.ITEM," > ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.NOTIFICATIONS_BADGE_COLLAPSED)]={opacity:"0"},zt["".concat(Bt.HOST_EXPANDED," ").concat(Mt.PAPER_LISTBOX," > ").concat(Bt.ITEM).concat(Bt.ITEM_SELECTED," > ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT)]={zIndex:"1"},zt["".concat(Bt.HOST," ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.NOTIFICATION_BADGE,":not(").concat(Bt.NOTIFICATIONS_BADGE_COLLAPSED,")")]=t({left:"calc(var(--app-drawer-width, 248px) - 22px)",maxWidth:"80px",transform:"translateX(-100%)"},Fe),zt["".concat(Bt.HOST," ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.NOTIFICATIONS_BADGE_COLLAPSED)]=t({bottom:"14px",left:"26px",maxWidth:"20px"},Fe),zt["".concat(Bt.HOST," ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.CONFIGURATION_BADGE)]=t({},Fe),zt),Ue=((Qt={})["".concat(Bt.HOST," ").concat(Bt.MENU," > ").concat(Bt.TITLE)]={color:xe(Gt.TITLE_COLOR,Ft.SIDEBAR_TITLE_COLOR,Ft.PRIMARY_TEXT_COLOR)},Qt),je=((Zt={})["".concat(Bt.HOST," ").concat(Bt.MENU," > ").concat(Bt.TITLE).concat(xt.AFTER)]={content:"attr(data-subtitle)",color:xe(Gt.SUBTITLE_COLOR,Gt.TITLE_COLOR,Ft.SIDEBAR_TITLE_COLOR,Ft.PRIMARY_TEXT_COLOR),display:"block",fontSize:"12px",lineHeight:"1.5"},Zt),ke=((te={})["".concat(Bt.HOST," ").concat(Bt.MENU," > ").concat(Mt.HA_ICON_BUTTON)]={color:xe(Gt.BUTTON_COLOR,Ft.SIDEBAR_ICON_COLOR)},te),Ve=((ee={})[Bt.HOST]={background:xe(Gt.BACKGROUND,Ft.SIDEBAR_BACKGROUND_COLOR)+" !important"},ee),Xe=((ne={})["".concat(Bt.HOST," ").concat(Bt.MENU)]={background:xe(Gt.MENU_BACKGROUND,Gt.BACKGROUND,Ft.SIDEBAR_MENU_BUTTON_BACKGROUND_COLOR,Ft.PRIMARY_BACKGROUND_COLOR),borderBottomColor:xe(Gt.DIVIDER_TOP_COLOR,Gt.DIVIDER_COLOR,Ft.DIVIDER_COLOR),borderBottomStyle:"solid",borderBottomWidth:"1px"},ne),We=((oe={})["".concat(Bt.HOST," ").concat(Bt.DIVIDER).concat(xt.BEFORE)]={backgroundColor:xe(Gt.DIVIDER_BOTTOM_COLOR,Gt.DIVIDER_COLOR,Ft.DIVIDER_COLOR)},oe),Ke=((re={})["".concat(Bt.HOST," > ").concat(Bt.MC_DRAWER)]={borderColor:xe(Gt.BORDER_COLOR,Ft.DIVIDER_COLOR,"rgba(0,0,0,.12)")},re),qe=((ie={})["".concat(Bt.HOST," ").concat(Mt.PAPER_LISTBOX).concat(Bt.HA_SCROLLBAR)]={scrollbarColor:xe(Gt.SCROLLBAR_THUMB_COLOR,Ft.SCROLLBAR_THUMB_COLOR)+" transparent"},ie["".concat(Bt.HOST," ").concat(Mt.PAPER_LISTBOX).concat(Bt.HA_SCROLLBAR).concat(xt.WEBKIT_SCROLLBAR_THUMB)]={background:xe(Gt.SCROLLBAR_THUMB_COLOR,Ft.SCROLLBAR_THUMB_COLOR)},ie),Ye=((ce={})["".concat(Bt.MENU,"[").concat(jt,"]")]={pointerEvents:"none"},ce["".concat(Bt.MENU,"[").concat(jt,"] > ").concat(Mt.HA_ICON_BUTTON)]={pointerEvents:"all"},ce),$e=((ae={})["".concat(Bt.HOST," ").concat(Bt.ITEM,":not(").concat(Bt.ITEM_SELECTED,") > ").concat(Mt.PAPER_ICON_ITEM)]={background:xe(Gt.ITEM_BACKGROUND,"none")},ae),Je=((se={})["".concat(Bt.HOST," :is(").concat(Bt.ITEM_HOVER,", ").concat(Bt.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Bt.ITEM_SELECTED,") > ").concat(Mt.PAPER_ICON_ITEM)]={background:xe(Gt.ITEM_BACKGROUND_HOVER,Gt.ITEM_BACKGROUND,"none")},se),ze=((_e={})["".concat(Bt.HOST," ").concat(Bt.ITEM,"[").concat(Vt.WITH_DIVIDER,"]")]={borderBottom:"1px solid",borderBottomColor:xe(Gt.DIVIDER_COLOR,Ft.DIVIDER_COLOR),marginBottom:"10px",paddingBottom:"10px"},_e),Qe=((ue={})["".concat(Bt.HOST," ").concat(Mt.PAPER_ICON_ITEM," > :is(").concat(Mt.HA_SVG_ICON,", ").concat(Mt.HA_ICON,")")]={color:xe(Gt.ICON_COLOR,Ft.SIDEBAR_ICON_COLOR)},ue),Ze=((le={})["".concat(Bt.HOST," ").concat(Bt.ITEM_SELECTED," > ").concat(Mt.PAPER_ICON_ITEM," > :is(").concat(Mt.HA_SVG_ICON,", ").concat(Mt.HA_ICON,")")]={color:xe(Gt.ICON_COLOR_SELECTED,Ft.SIDEBAR_SELECTED_ICON_COLOR)},le),tn=((de={})["".concat(Bt.HOST," :is(").concat(Bt.ITEM_HOVER,", ").concat(Bt.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Bt.ITEM_SELECTED,") > ").concat(Mt.PAPER_ICON_ITEM," > :is(").concat(Mt.HA_SVG_ICON,", ").concat(Mt.HA_ICON,")")]={color:xe(Gt.ICON_COLOR_HOVER,Gt.ICON_COLOR,Ft.SIDEBAR_ICON_COLOR)},de),en=((Ee={})["".concat(Bt.HOST," ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT)]={color:xe(Gt.TEXT_COLOR,Ft.SIDEBAR_TEXT_COLOR)},Ee),nn=((fe={})["".concat(Bt.HOST," ").concat(Bt.ITEM_SELECTED," > ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT)]={color:xe(Gt.TEXT_COLOR_SELECTED,Ft.SIDEBAR_SELECTED_TEXT_COLOR)},fe),on=((Oe={})["".concat(Bt.HOST," :is(").concat(Bt.ITEM_HOVER,", ").concat(Bt.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Bt.ITEM_SELECTED,") > ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT)]={color:xe(Gt.TEXT_COLOR_HOVER,Gt.TEXT_COLOR,Ft.SIDEBAR_TEXT_COLOR)},Oe),rn=((he={})["".concat(Bt.HOST," :is(").concat(Bt.ITEM,", ").concat(Bt.SIDEBAR_NOTIFICATIONS_CONTAINER,") > ").concat(Mt.PAPER_ICON_ITEM).concat(xt.BEFORE)]={background:xe(Gt.SELECTION_BACKGROUND,Gt.ICON_COLOR_SELECTED,Ft.SIDEBAR_SELECTED_ICON_COLOR),opacity:xe(Gt.SELECTION_OPACITY,"0.12")},he),cn=((pe={})["".concat(Bt.HOST_EXPANDED," ").concat(Mt.PAPER_LISTBOX," > ").concat(Bt.ITEM," > ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT).concat(Bt.DATA_INFO).concat(xt.AFTER)]={color:xe(Gt.INFO_COLOR,Ft.SIDEBAR_TEXT_COLOR),display:"block"},pe),an=((Ie={})["".concat(Bt.HOST_EXPANDED," ").concat(Mt.PAPER_LISTBOX," > ").concat(Bt.ITEM).concat(Bt.ITEM_SELECTED," > ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT).concat(Bt.DATA_INFO).concat(xt.AFTER)]={color:xe(Gt.INFO_COLOR_SELECTED,Ft.SIDEBAR_SELECTED_TEXT_COLOR)},Ie),sn=((Te={})["".concat(Bt.HOST_EXPANDED," :is(").concat(Bt.ITEM_HOVER,", ").concat(Bt.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Bt.ITEM_SELECTED,") > ").concat(Mt.PAPER_ICON_ITEM," > ").concat(Bt.ITEM_TEXT).concat(Bt.DATA_INFO).concat(xt.AFTER)]={color:xe(Gt.INFO_COLOR_HOVER,Gt.INFO_COLOR,Ft.SIDEBAR_TEXT_COLOR)},Te),_n=((Ae={})["".concat(Bt.HOST," ").concat(Bt.ITEM_SELECTED," > ").concat(Mt.PAPER_ICON_ITEM," > :is(").concat(Bt.NOTIFICATION_BADGE,", ").concat(Bt.CONFIGURATION_BADGE,")")]={backgroundColor:xe(Gt.NOTIFICATION_COLOR_SELECTED,Gt.NOTIFICATION_COLOR,Ft.ACCENT_COLOR),color:xe(Gt.NOTIFICATION_TEXT_COLOR_SELECTED,Gt.NOTIFICATION_TEXT_COLOR,Ft.TEXT_ACCENT_COLOR,Ft.TEXT_PRIMARY_COLOR)},Ae),un=((ve={})["".concat(Bt.HOST," :is(").concat(Bt.ITEM_HOVER,", ").concat(Bt.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(Bt.ITEM_SELECTED,") > ").concat(Mt.PAPER_ICON_ITEM," > :is(").concat(Bt.NOTIFICATION_BADGE,", ").concat(Bt.CONFIGURATION_BADGE,")")]={backgroundColor:xe(Gt.NOTIFICATION_COLOR_HOVER,Gt.NOTIFICATION_COLOR,Ft.ACCENT_COLOR),color:xe(Gt.NOTIFICATION_TEXT_COLOR_HOVER,Gt.NOTIFICATION_TEXT_COLOR,Ft.TEXT_ACCENT_COLOR,Ft.TEXT_PRIMARY_COLOR)},ve),ln="Invalid configuration",dn=o(o(["title","subtitle","sidebar_background","title_color","subtitle_color","sidebar_button_color","sidebar_border_color","menu_background","divider_color","divider_top_color","divider_bottom_color","scrollbar_thumb_color","styles"],qt,!0),["default_path"],!0),En=["js_variables","jinja_variables","partials","extendable_configs"],fn=function(t,e,n){e.forEach((function(e){if(typeof t[e]!==Dt.UNDEFINED&&typeof t[e]!==Dt.STRING)throw new SyntaxError("".concat(n,' "').concat(String(e),'" property should be a string'))}))},On=function(t,e,n){e.forEach((function(e){if(typeof t[e]!==Dt.UNDEFINED&&typeof t[e]!==Dt.STRING&&typeof t[e]!==Dt.NUMBER)throw new SyntaxError("".concat(n,' "').concat(String(e),'" property should be a number or a string'))}))},hn=function(t,e,n){e.forEach((function(e){if(typeof t[e]!==Dt.UNDEFINED&&typeof t[e]!==Dt.BOOLEAN)throw new SyntaxError("".concat(n,' "').concat(String(e),'" property should be a boolean'))}))},pn=function(t,e,n){e.forEach((function(e){if(typeof t[e]!==Dt.UNDEFINED&&typeof t[e]!==Dt.BOOLEAN&&typeof t[e]!==Dt.STRING)throw new SyntaxError("".concat(n,' "').concat(String(e),'" property should be a boolean or a string'))}))},In=function(t,e){t.forEach((function(t){var n=t[0],o=t[1];if(!Tn(o))throw new SyntaxError("".concat(e,' "').concat(n,'" property should be a string or an array of strings'))}))},Tn=function(t){return typeof t===Dt.UNDEFINED||(typeof t===Dt.STRING||Array.isArray(t)&&t.some((function(t){return typeof t===Dt.STRING})))},An=function(t,e,n,o){(void 0===o&&(o=!1),t)&&(Array.isArray(t)?t:[t]).forEach((function(t){var r;if(t===Ht&&!o)throw new SyntaxError("".concat(n,' "entend_from" can only be "base" in exceptions'));if(t!==Ht&&!(t in(null!==(r=e.extendable_configs)&&void 0!==r?r:{})))throw new SyntaxError("".concat(n,' "').concat(t,'" doesn\'t exist in "extendable_configs"'))}))},vn=function(t,e,n){t&&(Array.isArray(t)?t:[t]).forEach((function(t){if(n.includes(t))throw new SyntaxError("".concat(ln,', circular extend dependency detected in "').concat(n.join(" > ")," > ").concat(t,'"'));if(t===Ht)throw new SyntaxError("".concat(ln,', error in extendable config "').concat(n[0],'": "entend_from" can only be "base" in exceptions'));if(!(t in e.extendable_configs))throw new SyntaxError("".concat(ln,', error in "').concat(n[n.length-1],'": "').concat(t,'" doesn\'t exist in "extendable_configs"'));vn(e.extendable_configs[t].extend_from,e,o(o([],n,!0),[t],!1))}))},Rn=function(t,e){En.forEach((function(n){if(n in t)throw new SyntaxError("".concat(e,' "').concat(n,'" option can only be placed in the main config'))}))},Nn=function(t,e,n){if("string"==typeof e&&(me.test(e)||ye.test(e)))console.warn('"'.concat(t,'" property should not have templates. "').concat(n.join(" > "),'" seems to be a template'));else if(typeof e!==Dt.STRING&&typeof e!==Dt.NUMBER&&typeof e!==Dt.BOOLEAN)if(Array.isArray(e))e.forEach((function(e,r){Nn(t,e,o(o([],n,!0),["[".concat(r,"]")],!1))}));else{if(Object.prototype.toString.call(e)!==Ut)throw new SyntaxError("".concat(ln,', "').concat(t,": ").concat(n.join(" > "),'" has a wrong type ').concat(Object.prototype.toString.call(e)));var r=e;Object.entries(r).forEach((function(e){var r=e[0],i=e[1];Nn(t,i,o(o([],n,!0),[r],!1))}))}},bn=function(t,e){if(typeof e!==Dt.UNDEFINED){if(Object.prototype.toString.call(e)!==Ut)throw new SyntaxError("".concat(ln,', "').concat(t,'" property should be an object'));Object.entries(e).forEach((function(e){var n=e[0],o=e[1];Nn(t,o,[n])}))}},mn=function(t,e){if(typeof t!==Dt.UNDEFINED){if(!Array.isArray(t))throw new SyntaxError("".concat(ln,", exceptions should be an array"));t.forEach((function(t){!function(t,e){var n;if(Rn(t,"".concat(ln,", exceptions")),fn(t,o([],dn,!0),"".concat(ln,", exceptions")),On(t,o([],Yt,!0),"".concat(ln,", exceptions")),In([["user",t.user],["not_user",t.not_user],["device",t.device],["not_device",t.not_device],["extend_from",t.extend_from]],"".concat(ln,", exceptions")),An(t.extend_from,e,"".concat(ln,", error in exception:"),!0),typeof t.matchers_conditions!==Dt.UNDEFINED&&t.matchers_conditions!==pt.AND&&t.matchers_conditions!==pt.OR)throw new SyntaxError("".concat(ln,', exceptions "matchers_conditions" property should be "').concat(pt.AND,'" or "').concat(pt.OR,'"'));if(typeof t.order!==Dt.UNDEFINED&&!Array.isArray(t.order))throw new SyntaxError("".concat(ln,', exceptions "order" property should be an array'));if(pn(t,["sidebar_editable"],"".concat(ln,", exceptions")),hn(t,["hide_all","is_admin","is_owner"],"".concat(ln,", exceptions")),typeof t.sidebar_mode!==Dt.UNDEFINED&&!(t.sidebar_mode in Ne))throw new SyntaxError("".concat(ln,', exceptions "sidebar_mode" property should be ').concat(Ot.HIDDEN,", ").concat(Ot.NARROW," or ").concat(Ot.EXTENDED));if(t.user&&t.not_user)throw new SyntaxError("".concat(ln,', exceptions "user" and "not_user" properties cannot be used together'));if(t.device&&t.not_device)throw new SyntaxError("".concat(ln,', exceptions "device" and "not_device" properties cannot be used together'));null===(n=t.order)||void 0===n||n.forEach(yn)}(t,e)}))}},yn=function(t){if(Rn(t,"".concat(ln," in ").concat(t.item,",")),!t.item)throw new SyntaxError("".concat(ln,', every item in an "order" array should have an "item" property'));if(fn(t,o(["item","info"],qt,!0),"".concat(ln," in ").concat(t.item,",")),On(t,o([],Yt,!0),"".concat(ln," in ").concat(t.item,",")),pn(t,["hide"],"".concat(ln," in ").concat(t.item,",")),hn(t,["divider"],"".concat(ln," in ").concat(t.item,",")),function(t,e){if(typeof t.on_click!==Dt.UNDEFINED){if(Object.prototype.toString.call(t.on_click)!==Ut)throw new SyntaxError("".concat(e,' "on_click" property should be an object'));if(typeof t.on_click.action!==Dt.STRING)throw new SyntaxError("".concat(e,' the "action" parameter should be a string'));if(!Object.values(Tt).includes(t.on_click.action))throw new SyntaxError("".concat(e,' the "action" parameter should be one of these values: ').concat(Object.values(Tt).join(", ")));if(t.on_click.action===Tt.CALL_SERVICE){if(typeof t.on_click.service!==Dt.STRING)throw new SyntaxError("".concat(e,' the "service" parameter should be a string'));if(typeof t.on_click.data!==Dt.UNDEFINED&&Object.prototype.toString.call(t.on_click.data)!==Ut)throw new SyntaxError("".concat(e,' the "data" parameter needs to be an object'))}if(t.on_click.action===Tt.JAVASCRIPT&&typeof t.on_click.code!==Dt.STRING)throw new SyntaxError("".concat(e,' the "code" parameter should be a string'))}}(t,"".concat(ln," in ").concat(t.item,",")),t.new_item){if(fn(t,["href","icon"],"".concat(ln," in ").concat(t.item,",")),!t.href&&!t.on_click)throw new SyntaxError("".concat(ln," in ").concat(t.item,', if you set "new_item" as "true", it is necessary an "href" or an "on_click "property'));if(!t.icon)throw new SyntaxError("".concat(ln," in ").concat(t.item,', if you set "new_item" as "true", "icon" property is necessary'))}},Sn=function(t){var e;if(fn(t,o([],dn,!0),"".concat(ln,",")),In([["extend_from",t.extend_from]],"".concat(ln,",")),An(t.extend_from,t,"".concat(ln,", error in main config:")),function(t){t.extendable_configs&&Object.entries(t.extendable_configs).forEach((function(e){var n=e[0],o=e[1];vn(o.extend_from,t,[n])}))}(t),On(t,o([],Yt,!0),"".concat(ln,",")),pn(t,["sidebar_editable"],"".concat(ln,",")),hn(t,["hide_all"],"".concat(ln,",")),typeof t.sidebar_mode!==Dt.UNDEFINED&&!(t.sidebar_mode in Ne))throw new SyntaxError("".concat(ln,', "sidebar_mode" property should be ').concat(Ot.HIDDEN,", ").concat(Ot.NARROW," or ").concat(Ot.EXTENDED));if(typeof t.order!==Dt.UNDEFINED&&!Array.isArray(t.order))throw new SyntaxError("".concat(ln,', "order" property should be an array'));if(typeof t.partials!==Dt.UNDEFINED){if(Object.prototype.toString.call(t.partials)!==Ut)throw new SyntaxError("".concat(ln,', "partials" property should be an object'));Object.entries(t.partials).forEach((function(t){var e=t[0];if(typeof t[1]!==Dt.STRING)throw new SyntaxError("".concat(ln,', "partials" should be an object with strings. The partial ').concat(e," is not a string"))}))}bn("js_variables",t.js_variables),bn("jinja_variables",t.jinja_variables),null===(e=t.order)||void 0===e||e.forEach(yn),mn(t.exceptions,t)},Cn=function(){return e(void 0,void 0,void 0,(function(){var t,e;return n(this,(function(n){return t="".concat(gt,": JSON config file not found."),e="Make sure you have valid config in /config/www/".concat(wt,".json file."),[2,new Promise((function(n){fetch("".concat(Pt,".json?hash=").concat(Math.random().toString(16).slice(2))).then((function(o){if(!o.ok)throw Error("".concat(t,"\n").concat(e));o.json().then((function(t){var o;(null===(o=t.id)||void 0===o?void 0:o.startsWith("example_json"))&&console.warn("".concat(gt,": You seem to be using the example configuration.\n").concat(e)),Sn(t),n(t)})).catch((function(t){throw Error("".concat(gt,": ").concat(t.message))}))})).catch((function(){throw Error("".concat(t,"\n").concat(e))}))}))]}))}))},Ln=function(){function o(){var t=this;this._parseJavaScriptVariables=function(){var e,n=null!==(e=t._config.js_variables)&&void 0!==e?e:{},o=Object.entries(n).filter((function(e){var n=e[0],o=e[1];if("string"==typeof o&&Le.test(o)){var r=o.replace(Le,"$1");return t._renderer.renderTemplate("\n const myRef = ref('".concat(n,"');\n myRef.value = ").concat(r,";\n return;\n ")),!1}return!0}));return Object.fromEntries(o)};var e=new rt;e.addEventListener(B.ON_LISTEN,(function(e){t._homeAssistant=e.detail.HOME_ASSISTANT,t._main=e.detail.HOME_ASSISTANT_MAIN,t._haDrawer=e.detail.HA_DRAWER,t._sidebar=e.detail.HA_SIDEBAR,t._partialPanelResolver=e.detail.PARTIAL_PANEL_RESOLVER}),{once:!0}),e.addEventListener(B.ON_PANEL_LOAD,this._panelLoaded.bind(this)),e.listen(),this._styleManager=new Ct({prefix:gt,namespace:gt,throwWarnings:!1}),this._items=[],this._sidebarScroll=0,this._isSidebarEditable=void 0,this._itemTouchedBinded=this._itemTouched.bind(this),this._mouseEnterBinded=this._mouseEnter.bind(this),this._mouseLeaveBinded=this._mouseLeave.bind(this),this._configPromise=Cn(),this._process()}return o.prototype._getConfig=function(){return e(this,void 0,void 0,(function(){var t,e=this;return n(this,(function(n){switch(n.label){case 0:return t=this,[4,this._configPromise.then((function(t){return function(t,e,n){return new Me(n,t,e).config}(e._ha.hass.user,navigator.userAgent.toLowerCase(),t)}))];case 1:return t._config=n.sent(),[2]}}))}))},o.prototype._getElements=function(){return e(this,void 0,void 0,(function(){var t,e,o,i;return n(this,(function(n){switch(n.label){case 0:return t={retries:100,delay:50,shouldReject:!1},[4,this._sidebar.selector.$.query(Mt.PAPER_LISTBOX).element];case 1:return e=n.sent(),[4,r((function(){return e.querySelector(":scope > ".concat(Bt.SPACER))}),(function(t){return!!t}),t)];case 2:return o=n.sent(),[4,r((function(){return e.querySelectorAll(":scope > ".concat(Bt.ITEM))}),(function(t){return Array.from(t).every((function(t){return t.querySelector(Bt.ITEM_TEXT).innerText.trim().length>0}))}),t)];case 3:return i=n.sent(),[2,[e,i,o]]}}))}))},o.prototype._hideAnchor=function(t,e){e?t.style.display="none":t.style.removeProperty("display")},o.prototype._buildNewItem=function(t){var e=document.createElement("a");return e.href=t.href?t.href:"#",e.target=t.target||"",e.tabIndex=-1,e.setAttribute(Vt.ROLE,"option"),e.setAttribute(Vt.PANEL,t.item.toLowerCase().replace(/\s+/,"-")),e.setAttribute(Vt.ARIA_SELECTED,"false"),e.innerHTML='\n \n \n \n ').concat(t.item,'\n \n \n \n ').trim(),e},o.prototype._getTemplateString=function(t){return e(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return e="",t instanceof Promise||"string"==typeof t||"number"==typeof t&&!Number.isNaN(t)||"boolean"==typeof t||"object"==typeof t?"string"!=typeof t?[3,1]:(e=t.trim(),[3,6]):[3,6];case 1:return"number"!=typeof t&&"boolean"!=typeof t?[3,2]:(e=t.toString(),[3,6]);case 2:return t instanceof Promise?[4,t]:[3,5];case 3:return o=n.sent(),[4,this._getTemplateString(o)];case 4:return e=n.sent(),[3,6];case 5:e=JSON.stringify(t),n.label=6;case 6:return[2,e]}}))}))},o.prototype._subscribeTitle=function(){var t=this;this._sidebar.selector.$.query(Bt.TITLE).element.then((function(e){t._config.title&&t._subscribeTemplate(t._config.title,(function(t){e.innerHTML=t})),t._config.subtitle&&t._subscribeTemplate(t._config.subtitle,(function(t){e.dataset.subtitle=t}))}))},o.prototype._subscribeSideBarEdition=function(){var t=this,e=function(t){t.preventDefault(),t.stopImmediatePropagation()},n=function(t,n){t.removeEventListener(Xt.HASS_EDIT_SIDEBAR,e,!0),n.removeAttribute(jt)},o=function(t,n){t.removeEventListener(Xt.HASS_EDIT_SIDEBAR,e,!0),t.addEventListener(Xt.HASS_EDIT_SIDEBAR,e,!0),n.setAttribute(jt,"")};Promise.all([this._main.element,this._sidebar.selector.$.query(Bt.MENU).element]).then((function(e){var r=e[0],i=e[1];"boolean"==typeof t._config.sidebar_editable&&(t._isSidebarEditable=t._config.sidebar_editable,t._isSidebarEditable||o(r,i)),"string"==typeof t._config.sidebar_editable&&t._subscribeTemplate(t._config.sidebar_editable,(function(e){"true"===e||"false"===e?(t._isSidebarEditable=!("false"===e),t._isSidebarEditable?n(r,i):o(r,i)):(t._isSidebarEditable=void 0,n(r,i)),t._checkProfileEditableButton()}))}))},o.prototype._subscribeName=function(t,e){var n=t.querySelector(Bt.ITEM_TEXT);this._subscribeTemplate(e,(function(t){n.innerHTML=t}))},o.prototype._subscribeIcon=function(t,e){this._subscribeTemplate(e,(function(e){var n=t.querySelector(Mt.HA_ICON);if(!n){(n=document.createElement(Mt.HA_ICON)).setAttribute("slot","item-icon");var o=t.querySelector(Mt.HA_SVG_ICON);o?o.replaceWith(n):t.querySelector(Mt.PAPER_ICON_ITEM).prepend(n)}n.setAttribute("icon",e)}))},o.prototype._subscribeInfo=function(t,e){var n=t.querySelector(Bt.ITEM_TEXT);this._subscribeTemplate(e,(function(t){n.dataset.info=t}))},o.prototype._subscribeNotification=function(t,e){var n=t.querySelector("".concat(Bt.NOTIFICATION_BADGE,":not(").concat(Bt.NOTIFICATIONS_BADGE_COLLAPSED,")")),o=t.querySelector(Bt.NOTIFICATIONS_BADGE_COLLAPSED);n||((n=document.createElement("span")).classList.add(kt.NOTIFICATIONS_BADGE),t.querySelector(Mt.PAPER_ICON_ITEM).append(n)),o||((o=document.createElement("span")).classList.add(kt.NOTIFICATIONS_BADGE,kt.NOTIFICATIONS_BADGE_COLLAPSED),t.querySelector("".concat(Mt.HA_SVG_ICON,", ").concat(Mt.HA_ICON)).after(o));this._subscribeTemplate(e,(function(e){e.length?(n.innerHTML=e,o.innerHTML=e,t.setAttribute(Vt.WITH_NOTIFICATION,"true")):(n.innerHTML="",o.innerHTML="",t.removeAttribute(Vt.WITH_NOTIFICATION))}))},o.prototype._subscribeHide=function(t,e){var n=this;"boolean"==typeof e?this._hideAnchor(t,e):this._subscribeTemplate(e,(function(e){n._hideAnchor(t,"true"===e)}))},o.prototype._subscribeTemplateColorChanges=function(t,e,n){var o=this;n.forEach((function(n){var r=n[0],i=n[1];t[r]&&o._subscribeTemplate(t[r],(function(t){e.style.setProperty(i,t)}))}))},o.prototype._subscribeTemplate=function(t,e){me.test(t)?this._createJsTemplateSubscription(t.replace(me,"$1"),e):ye.test(t)?this._createJinjaTemplateSubscription(t,e):this._getTemplateString(t).then((function(t){e(t)}))},o.prototype._createJsTemplateSubscription=function(t,e){var n=this;this._renderer.trackTemplate(Be(t,this._config.partials),(function(t){n._getTemplateString(t).then((function(t){e(t)}))}))},o.prototype._createJinjaTemplateSubscription=function(e,n){var o=this;window.hassConnection.then((function(r){r.conn.subscribeMessage((function(t){n("".concat(t.result))}),{type:Xt.RENDER_TEMPLATE,template:Be(e,o._config.partials),variables:t({user_name:o._ha.hass.user.name,user_is_admin:o._ha.hass.user.is_admin,user_is_owner:o._ha.hass.user.is_owner,user_agent:window.navigator.userAgent},o._config.jinja_variables)})}))},o.prototype._focusItem=function(t,e,n){var o=this._items.length,r="none",i=0;if(e)for(var c=(_=t+1)+o,a=_;ao-1?a-o:a;if(this._items[s].style.display!==r){i=s;break}}else{var _;for(c=(_=t-1)-o,a=_;a>c;a--){s=a<0?o+a:a;if(this._items[s].style.display!==r){i=s;break}}}n?this._items[i].querySelector(Mt.PAPER_ICON_ITEM).focus():(this._items[i].focus(),this._items[i].tabIndex=0)},o.prototype._focusItemByKeyboard=function(t,e){var n=t.querySelector("\n ".concat(Bt.SCOPE," > ").concat(Bt.ITEM,":not(.").concat(kt.IRON_SELECTED,"):focus,\n ").concat(Bt.SCOPE," > ").concat(Bt.ITEM,":focus,\n ").concat(Bt.SCOPE," > ").concat(Bt.ITEM,":has(> ").concat(Mt.PAPER_ICON_ITEM,":focus)\n ")),o=0;this._items.forEach((function(t,e){t===n&&(o=e),t.tabIndex=-1})),this._focusItem(o,e,!1)},o.prototype._focusItemByTab=function(t,e,n){if(e.nodeName===Kt.A){var o=e,r=this._items.indexOf(o),i=this._items.length-1;if(n&&r0)this._focusItem(r,n,!0);else(n?t.querySelector(Bt.SIDEBAR_NOTIFICATIONS):t.querySelector(Mt.HA_ICON_BUTTON)).focus()}else{if(n)t.querySelector("".concat(Bt.PROFILE," > ").concat(Mt.PAPER_ICON_ITEM)).focus();else this._focusItem(0,n,!0)}},o.prototype._getActivePaperIconElement=function(t){void 0===t&&(t=document);var e=t.activeElement;return e?e instanceof HTMLElement&&(e.nodeName===Kt.PAPER_ICON_ITEM||e.nodeName===Kt.A&&"option"===e.getAttribute("role"))?e:e.shadowRoot&&Re.includes(e.nodeName)?this._getActivePaperIconElement(e.shadowRoot):null:null},o.prototype._processDefaultPath=function(){var t,e=this._config.default_path;if(e)if(e.startsWith("/")){var n=[null,"",e];(t=window.history).replaceState.apply(t,n),window.dispatchEvent(new CustomEvent(Xt.LOCATION_CHANGED,{detail:{replace:e}}))}else console.warn("".concat(gt,': ignoring default_path property as it doesn\'t start with "/".'))},o.prototype._processSidebar=function(){var t=this;Promise.all([this._main.element,this._partialPanelResolver.element]).then((function(o){var r=o[0],i=o[1],c=t._config.sidebar_mode,a=matchMedia("(max-width: 870px)");if(c){r.hass.dockedSidebar=Ne[c];var s=function(o){return e(t,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return c===Ot.HIDDEN?[3,5]:[4,ge()];case 1:return t.sent(),r.narrow=!1,[4,ge()];case 2:return t.sent(),i.narrow=o,[4,ge()];case 3:return t.sent(),o?[4,this._partialPanelResolver.selector.query(Bt.HA_MENU_BUTTON).element]:[3,5];case 4:t.sent().narrow=!1,t.label=5;case 5:return[2]}}))}))};a.addEventListener("change",(function(t){s(t.matches)})),s(a.matches)}})),Promise.all([this._haDrawer.selector.$.query(Bt.MC_DRAWER).element,this._sidebar.element,this._sidebar.selector.$.element,this._sidebar.selector.$.query(Mt.PAPER_LISTBOX).element]).then((function(e){var n=e[0],o=e[1],r=e[2],i=e[3];t._subscribeTemplateColorChanges(t._config,o,Jt),t._subscribeTemplateColorChanges(t._config,n,[["sidebar_border_color",Gt.BORDER_COLOR]]),i.addEventListener(Xt.KEYDOWN,(function(e){e.key!==Wt.ARROW_DOWN&&e.key!==Wt.ARROW_UP||(e.preventDefault(),e.stopImmediatePropagation(),t._focusItemByKeyboard(i,e.key===Wt.ARROW_DOWN))}),!0),window.addEventListener(Xt.KEYDOWN,(function(e){if(e.key===Wt.TAB){var n=t._getActivePaperIconElement();if(n)if(n.nodeName===Kt.PAPER_ICON_ITEM){var o=n.parentElement;o.getAttribute(Vt.HREF)!==be&&(e.preventDefault(),e.stopImmediatePropagation(),t._focusItemByTab(r,o,!e.shiftKey))}else n.getAttribute(Vt.HREF)!==be&&(e.preventDefault(),e.stopImmediatePropagation(),t._focusItemByTab(r,n,!e.shiftKey))}}),!0),t._styleManager.addStyle(Ke,n),t._styleManager.addStyle([Ge,Ue,je,ke,Ve,Xe,We,qe,Ye,$e,Je,ze,Qe,Ze,tn,en,nn,on,rn,cn,an,sn,_n,un,t._config.styles||""],r)}))},o.prototype._rearrange=function(){var e=this;this._getElements().then((function(n){var o=e._config,r=o.order,i=o.hide_all,c=n[0],a=n[1],s=n[2],_=0,u=!1;e._items=Array.from(a);var l=new Set;i&&e._items.forEach((function(t){e._hideAnchor(t,!0)}));var d=r.reduce((function(n,o){var r=o.item,i=o.match,c=o.exact,a=o.new_item,s=r.toLocaleLowerCase(),_=a?void 0:e._items.find((function(t){var e=i===It.DATA_PANEL?t.getAttribute(Vt.PANEL):i===It.HREF?t.getAttribute(Vt.HREF):t.querySelector(Bt.ITEM_TEXT).innerText.trim();return!((!c||r!==e)&&(c||!(null==e?void 0:e.toLowerCase().includes(s))))&&(!l.has(t)&&(l.add(t),!0))}));return _&&_.setAttribute(Vt.PROCESSED,"true"),(a||_)&&n.push(t(t({},o),{element:_})),a||_||console.warn("".concat(gt,": you have an order item in your configuration that didn't match any sidebar item: \"").concat(r,'"')),n}),[]),E=function(){u||(e._items.forEach((function(t){t.hasAttribute(Vt.PROCESSED)||(t.style.order="".concat(_))})),_++,s.style.order="".concat(_),_++,u=!0)};d.forEach((function(t){if(t.bottom&&E(),t.new_item){var n=e._buildNewItem(t);c.append(n),t.element=n,t.element.setAttribute(Vt.PROCESSED,"true"),e._items.push(t.element)}else if(t.element){var o=t.element;t.href&&(o.href=t.href),t.target&&(o.target=t.target)}t.element.style.order="".concat(_),t.divider&&t.element.setAttribute(Vt.WITH_DIVIDER,"true"),t.name&&e._subscribeName(t.element,t.name),t.icon&&e._subscribeIcon(t.element,t.icon),t.info&&e._subscribeInfo(t.element,t.info),t.notification&&e._subscribeNotification(t.element,t.notification),void 0!==t.hide&&e._subscribeHide(t.element,t.hide),e._subscribeTemplateColorChanges(t,t.element,$t),t.new_item&&(t.element.addEventListener(Xt.MOUSEENTER,e._mouseEnterBinded),t.element.addEventListener(Xt.MOUSELEAVE,e._mouseLeaveBinded)),t.element.addEventListener(Xt.MOUSEDOWN,e._itemTouchedBinded),t.element.addEventListener(Xt.KEYDOWN,(function(t){t.key===Wt.ENTER&&e._itemTouchedBinded()})),t.on_click&&t.element.addEventListener(Xt.CLICK,e._mouseClick.bind(e,t.on_click),!0),_++})),d.length&&E(),e._items.sort((function(t,e){return+t.style.order-+e.style.order})),e._panelLoaded()}))},o.prototype._itemTouched=function(){return e(this,void 0,void 0,(function(){var t=this;return n(this,(function(e){return this._sidebar.selector.$.query(Mt.PAPER_LISTBOX).element.then((function(e){t._sidebarScroll=e.scrollTop})),[2]}))}))},o.prototype._mouseEnter=function(t){this._sidebar.element.then((function(e){e.alwaysExpand||(e._mouseLeaveTimeout&&(clearTimeout(e._mouseLeaveTimeout),e._mouseLeaveTimeout=void 0),e._showTooltip(t.currentTarget))}))},o.prototype._mouseLeave=function(){return e(this,void 0,void 0,(function(){return n(this,(function(t){return this._sidebar.element.then((function(t){t._mouseLeaveTimeout&&clearTimeout(t._mouseLeaveTimeout),t._mouseLeaveTimeout=window.setTimeout((function(){t._hideTooltip()}),500)})),[2]}))}))},o.prototype._mouseClick=function(t,o){return e(this,void 0,void 0,(function(){var e,r,i,c,a,s,_,u,l;return n(this,(function(n){switch(e=o.currentTarget,r="#"===e.getAttribute(Vt.HREF),i=e.getAttribute(Vt.PANEL),r&&(o.preventDefault(),o.stopImmediatePropagation()),t.action){case Tt.CALL_SERVICE:c=t.service,a=t.data,s=void 0===a?{}:a,3===(null==(_=c.match(Ce))?void 0:_.length)?this._ha.hass.callService(_[1],_[2],s):console.warn("".concat(gt,' ignoring "').concat(Tt.CALL_SERVICE,'" action in "').concat(i,'" item. The service parameter is malfomed.'));break;case Tt.JAVASCRIPT:u=t.code,l=u.includes("return")?u:"".concat(u,"\n;return;"),this._renderer.renderTemplate(l)}return[2]}))}))},o.prototype._checkProfileEditableButton=function(){return e(this,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:return[4,this._partialPanelResolver.element];case 1:return t=n.sent(),"/profile/general"!==t.__route.path?[3,3]:[4,this._partialPanelResolver.selector.query(Bt.EDIT_SIDEBAR_BUTTON).element];case 2:(e=n.sent())&&(!1===this._isSidebarEditable?e.setAttribute(Vt.DISABLED,""):e.removeAttribute(Vt.DISABLED)),n.label=3;case 3:return[2]}}))}))},o.prototype._panelLoaded=function(){return e(this,void 0,void 0,(function(){var t,e,o,r,i;return n(this,(function(n){switch(n.label){case 0:return[4,this._partialPanelResolver.element];case 1:return t=n.sent(),e=t.__route.path,[4,this._sidebar.selector.$.query(Mt.PAPER_LISTBOX).element];case 2:return o=n.sent(),r=o.querySelector("\n ".concat(Bt.SCOPE," > ").concat(Bt.ITEM,'[href="').concat(e,'"],\n ').concat(Bt.SCOPE," > ").concat(Bt.ITEM,'[href="').concat(e,'/dashboard"]\n ')),i=r?null:this._items.reduce((function(t,n){var o=n.getAttribute(Vt.HREF);return e.startsWith(o)&&(!t||o.length>t.getAttribute(Vt.HREF).length)&&(t=n),t}),null),this._items.forEach((function(t){var e=r&&r===t||!r&&i===t;t.classList.toggle(kt.IRON_SELECTED,e),t.setAttribute(Vt.ARIA_SELECTED,"".concat(e))})),o.scrollTop!==this._sidebarScroll&&(o.scrollTop=this._sidebarScroll),this._checkProfileEditableButton(),[2]}}))}))},o.prototype._process=function(){var t=this;this._homeAssistant.element.then((function(e){t._ha=e,new vt(t._ha).getRenderer().then((function(e){t._renderer=e,t._getConfig().then((function(){t._renderer.variables=t._parseJavaScriptVariables(),t._processDefaultPath(),t._processSidebar(),t._subscribeTitle(),t._subscribeSideBarEdition(),t._rearrange()}))}))}))},o}();window.CustomSidebar||(console.info("%c≡ ".concat(gt.toUpperCase()," (JSON)%cv").concat("8.4.1"),"font-weight: bold; background: #EEEEEE; color: #666666; padding: 2px 5px;","font-weight: normal; background: #E87A24; color: #FFFFFF; padding: 2px 5px"),window.CustomSidebar=new Ln)}(); diff --git a/dist/custom-sidebar-yaml.js b/dist/custom-sidebar-yaml.js index 0d29843..b950ae6 100644 --- a/dist/custom-sidebar-yaml.js +++ b/dist/custom-sidebar-yaml.js @@ -1 +1 @@ -!function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<])(".concat(Object.values(se).join("|"),")($|[ \\?)+:\\}\\]><.])"),"gm"),this._scopped=pe(e,o,i),this._watchForPanelUrlChange(),this._watchForEntitiesChange()}return e.prototype._executeRenderingFunctions=function(e){var t=this;this._subscriptions.get(e).forEach((function(e,n){e.forEach((function(e){t.trackTemplate(n,e)}))}))},e.prototype._watchForPanelUrlChange=function(){var e=this;window.addEventListener(le.LOCATION_CHANGED,(function(t){e._panelUrlWatchCallback()})),window.addEventListener(le.POPSTATE,(function(){e._panelUrlWatchCallback()}))},e.prototype._panelUrlWatchCallback=function(){this._subscriptions.has(se.PANEL_URL)&&this._executeRenderingFunctions(se.PANEL_URL)},e.prototype._watchForEntitiesChange=function(){var e=this;window.hassConnection.then((function(t){t.conn.subscribeMessage((function(t){return e._entityWatchCallback(t)}),{type:le.SUBSCRIBE_EVENTS,event_type:le.STATE_CHANGE_EVENT})}))},e.prototype._entityWatchCallback=function(e){if(this._subscriptions.size){var t=e.data.entity_id;this._subscriptions.has(t)&&this._executeRenderingFunctions(t)}},e.prototype._storeTracked=function(e,t){var n=this;this._scopped.tracked.forEach((function(o){if(n._subscriptions.has(o)){var r=n._subscriptions.get(o);if(r.has(e)){var i=r.get(e);i.has(t)||i.add(t)}else r.set(e,new Set([t]))}else n._subscriptions.set(o,new Map([[e,new Set([t])]]))}))},e.prototype._untrackTemplate=function(e,t){var n=this;this._subscriptions.forEach((function(o,r){if(o.has(e)){var i=o.get(e);i.has(t)&&i.delete(t),0===i.size&&(o.delete(e),0===o.size&&n._subscriptions.delete(r))}}))},e.prototype.renderTemplate=function(e){try{var t=new Map(Object.entries(this._variables)),n=e.trim().replace(this._clientSideEntitiesRegExp,"$1clientSide.$2$3"),o=n.includes("return")||!this._autoReturn?n:"return ".concat(n);return(new(Function.bind.apply(Function,ie(ie([void 0,"hass","states","is_state","state_attr","is_state_attr","has_value","entities","entity_prop","is_entity_prop","devices","device_attr","is_device_attr","device_id","areas","area_id","area_name","area_entities","area_devices","user_name","user_is_admin","user_is_owner","user_agent","clientSide","ref","unref"],Array.from(t.keys()),!1),["".concat('"use strict";'," ").concat(o)],!1)))).apply(void 0,ie([this._scopped.hass,this._scopped.states,this._scopped.is_state.bind(this._scopped),this._scopped.state_attr.bind(this._scopped),this._scopped.is_state_attr.bind(this._scopped),this._scopped.has_value.bind(this._scopped),this._scopped.entities,this._scopped.entity_prop,this._scopped.is_entity_prop.bind(this._scopped),this._scopped.devices,this._scopped.device_attr.bind(this._scopped),this._scopped.is_device_attr.bind(this._scopped),this._scopped.device_id.bind(this._scopped),this._scopped.areas.bind(this._scopped),this._scopped.area_id.bind(this._scopped),this._scopped.area_name.bind(this._scopped),this._scopped.area_entities.bind(this._scopped),this._scopped.area_devices.bind(this._scopped),this._scopped.user_name,this._scopped.user_is_admin,this._scopped.user_is_owner,this._scopped.user_agent,this._scopped.clientSideProxy,this._scopped.ref.bind(this._scopped,this._entityWatchCallback.bind(this)),this._scopped.unref.bind(this._scopped,this.cleanTracked.bind(this))],Array.from(t.values()),!1))}catch(e){if(this._throwErrors)throw e;return void(this._throwWarnings&&console.warn(e))}},e.prototype.trackTemplate=function(e,t){var n=this;this._scopped.cleanTracked();var o=this.renderTemplate(e);return this._storeTracked(e,t),t(o),function(){return n._untrackTemplate(e,t)}},e.prototype.cleanTracked=function(e){e?this._subscriptions.has(e)&&this._subscriptions.delete(e):this._subscriptions.clear()},Object.defineProperty(e.prototype,"variables",{get:function(){return this._variables},set:function(e){this._variables=e},enumerable:!1,configurable:!0}),e}(),ve=function(){function e(e,t){void 0===t&&(t={}),this._renderer=r((function(){return e.hass}),(function(e){return!!(e&&e.areas&&e.devices&&e.entities&&e.states&&e.user)}),{retries:100,delay:50,rejectMessage:"The provided element doesn't contain a proper or initialised hass object"}).then((function(){return new Te(e,t)}))}return e.prototype.getRenderer=function(){return this._renderer},e}(),be=/([A-Z])([a-z0-9_-]+)/g,ye=function(e){return Object.entries(e).map((function(e){var t=e[0],n=e[1];return"".concat(function(e){return e.replace(be,(function(e,t,n,o){var r=t.toLocaleLowerCase();return o?"-".concat(r).concat(n):"--".concat(r).concat(n)}))}(t),":").concat(n)})).join(";")+";"},ge=function(e){return(Array.isArray(e)?e:[e]).map((function(e){return"string"==typeof e?e:Object.entries(e).map((function(e){var t=e[0],n=e[1];return!1===n?"".concat(t,"{display: none !important}"):"".concat(t,"{").concat(ye(n),"}")})).join("")})).join("")},Ne=function(e,t){return"".concat(t,"_").concat(e)},Re=function(e){return e instanceof ShadowRoot?e.host.localName:e.localName},Ce=function(e,t){var n=Ne(Re(e),t);return e.querySelector("#".concat(n))},Se=function(){function e(e){var t,n,o;void 0===e&&(e={}),this._prefix=null!==(t=e.prefix)&&void 0!==t?t:"ha-styles-manager",this._namespace=null!==(n=e.namespace)&&void 0!==n?n:"home-assistant-styles-manager",this._throwWarnings=null===(o=e.throwWarnings)||void 0===o||o}return e.prototype.getStyleElement=function(e){return Ce(e,this._prefix)},e.prototype.addStyle=function(e,t){!function(e,t,n,o,r){if(t){var i=Ce(t,n);if(!i){var a=Ne(Re(t),n);(i=document.createElement("style")).setAttribute("id",a),t.appendChild(i)}i.innerHTML="string"==typeof e?e:ge(e)}else r&&console.warn("".concat(o,': no element has been provided calling "addStyle"'))}(e,t,this._prefix,this._namespace,this._throwWarnings)},e.prototype.removeStyle=function(e){!function(e,t,n,o){if(e){var r=Ce(e,t);r?r.remove():o&&console.warn("".concat(n,': no style to remove calling "removeStyle"'))}else o&&console.warn("".concat(n,': no element has been provided calling "removeStyle"'))}(e,this._prefix,this._namespace,this._throwWarnings)},e}();!function(e){e.HIDDEN="hidden",e.NARROW="narrow",e.EXTENDED="extended"}(he||(he={})),function(e){e.DOCKED="docked",e.AUTO="auto",e.ALWAYS_HIDDEN="always_hidden"}(Ee||(Ee={})),function(e){e.AND="AND",e.OR="OR"}(Oe||(Oe={})),function(e){e.TEXT="text",e.DATA_PANEL="data-panel",e.HREF="href"}(Ae||(Ae={})),function(e){e.CALL_SERVICE="call-service",e.JAVASCRIPT="javascript"}(me||(me={}));var Le,we="custom-sidebar",De="sidebar-config",xe="".concat("/local/").concat(De),Me="base";!function(e){e.BOOLEAN="boolean",e.STRING="string",e.UNDEFINED="undefined",e.NUMBER="number"}(Le||(Le={}));var Pe,He,Fe,Be,ke,je="[object Object]",Ge="data-blocked";!function(e){e.SIDEBAR="ha-sidebar",e.PAPER_LISTBOX="paper-listbox",e.PAPER_ICON_ITEM="paper-icon-item",e.HA_SVG_ICON="ha-svg-icon",e.HA_ICON="ha-icon",e.HA_ICON_BUTTON="ha-icon-button"}(Pe||(Pe={})),function(e){e.HOST=":host",e.HOST_EXPANDED=":host([expanded])",e.SCOPE=":scope",e.TITLE=".title",e.ITEM='a[role="option"]',e.ITEM_SELECTED=".iron-selected",e.ITEM_HOVER='a[role="option"]:hover',e.SPACER=".spacer",e.ITEM_TEXT=".item-text",e.NOTIFICATION_BADGE=".notification-badge",e.NOTIFICATIONS_BADGE_COLLAPSED=".notification-badge-collapsed",e.CONFIGURATION_BADGE=".configuration-badge",e.HA_MENU_BUTTON="ha-panel-lovelace$ hui-root$ .toolbar > ha-menu-button",e.EDIT_SIDEBAR_BUTTON="ha-panel-profile ha-profile-section-general$ ha-settings-row mwc-button",e.SIDEBAR_NOTIFICATIONS_CONTAINER=".notifications-container",e.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER=".notifications-container:hover",e.SIDEBAR_NOTIFICATIONS=".notifications",e.PROFILE=".profile",e.MENU=".menu",e.DIVIDER=".divider",e.MC_DRAWER=".mdc-drawer",e.HA_SCROLLBAR=".ha-scrollbar",e.DATA_INFO="[data-info]"}(He||(He={})),function(e){e.AFTER="::after",e.BEFORE="::before",e.WEBKIT_SCROLLBAR_THUMB="::-webkit-scrollbar-thumb"}(Fe||(Fe={})),function(e){e.PRIMARY_BACKGROUND_COLOR="--primary-background-color",e.SIDEBAR_BACKGROUND_COLOR="--sidebar-background-color",e.SIDEBAR_TITLE_COLOR="--sidebar-menu-button-text-color",e.SIDEBAR_BUTTON_COLOR="--sidebar-icon-color",e.SIDEBAR_MENU_BUTTON_BACKGROUND_COLOR="--sidebar-menu-button-background-color",e.SIDEBAR_ICON_COLOR="--sidebar-icon-color",e.SIDEBAR_SELECTED_ICON_COLOR="--sidebar-selected-icon-color",e.SIDEBAR_TEXT_COLOR="--sidebar-text-color",e.SIDEBAR_SELECTED_TEXT_COLOR="--sidebar-selected-text-color",e.ACCENT_COLOR="--accent-color",e.TEXT_ACCENT_COLOR="--text-accent-color",e.TEXT_PRIMARY_COLOR="--text-primary-color",e.PRIMARY_TEXT_COLOR="--primary-text-color",e.DIVIDER_COLOR="--divider-color",e.SCROLLBAR_THUMB_COLOR="--scrollbar-thumb-color"}(Be||(Be={})),function(e){e.BACKGROUND="--custom-sidebar-background",e.BORDER_COLOR="--custom-sidebar-border-color",e.MENU_BACKGROUND="--custom-sidebar-menu-background",e.TITLE_COLOR="--custom-sidebar-title-color",e.SUBTITLE_COLOR="--custom-sidebar-subtitle-color",e.BUTTON_COLOR="--custom-sidebar-button-color",e.DIVIDER_COLOR="--custom-sidebar-divider-color",e.DIVIDER_TOP_COLOR="--custom-sidebar-divider-top-color",e.DIVIDER_BOTTOM_COLOR="--custom-sidebar-divider-bottom-color",e.SCROLLBAR_THUMB_COLOR="--custom-sidebar-scrollbar-thumb-color",e.ITEM_BACKGROUND="--custom-sidebar-item-background",e.ITEM_BACKGROUND_HOVER="--custom-sidebar-item-background-hover",e.ICON_COLOR="--custom-sidebar-icon-color",e.ICON_COLOR_SELECTED="--custom-sidebar-icon-color-selected",e.ICON_COLOR_HOVER="--custom-sidebar-icon-color-hover",e.TEXT_COLOR="--custom-sidebar-text-color",e.TEXT_COLOR_SELECTED="--custom-sidebar-text-color-selected",e.TEXT_COLOR_HOVER="--custom-sidebar-text-color-hover",e.SELECTION_BACKGROUND="--custom-sidebar-selection-background",e.SELECTION_OPACITY="--custom-sidebar-selection-opacity",e.INFO_COLOR="--custom-sidebar-info-color",e.INFO_COLOR_SELECTED="--custom-sidebar-info-color-selected",e.INFO_COLOR_HOVER="--custom-sidebar-info-color-hover",e.NOTIFICATION_COLOR="--custom-sidebar-notification-color",e.NOTIFICATION_COLOR_SELECTED="--custom-sidebar-notification-color-selected",e.NOTIFICATION_COLOR_HOVER="--custom-sidebar-notification-color-hover",e.NOTIFICATION_TEXT_COLOR="--custom-sidebar-notification-text-color",e.NOTIFICATION_TEXT_COLOR_SELECTED="--custom-sidebar-notification-text-color-selected",e.NOTIFICATION_TEXT_COLOR_HOVER="--custom-sidebar-notification-text-color-hover"}(ke||(ke={}));var Ue,Ve,Xe,We,qe,Ke=["item_background","item_background_hover","icon_color","icon_color_selected","icon_color_hover","text_color","text_color_selected","text_color_hover","selection_background","info_color","info_color_selected","info_color_hover","notification_color","notification_color_selected","notification_color_hover","notification_text_color","notification_text_color_selected","notification_text_color_hover"],Ye=["selection_opacity"],$e=[["item_background",ke.ITEM_BACKGROUND],["item_background_hover",ke.ITEM_BACKGROUND_HOVER],["icon_color",ke.ICON_COLOR],["icon_color_selected",ke.ICON_COLOR_SELECTED],["icon_color_hover",ke.ICON_COLOR_HOVER],["text_color",ke.TEXT_COLOR],["text_color_selected",ke.TEXT_COLOR_SELECTED],["text_color_hover",ke.TEXT_COLOR_HOVER],["selection_background",ke.SELECTION_BACKGROUND],["selection_opacity",ke.SELECTION_OPACITY],["info_color",ke.INFO_COLOR],["info_color_selected",ke.INFO_COLOR_SELECTED],["info_color_hover",ke.INFO_COLOR_HOVER],["notification_color",ke.NOTIFICATION_COLOR],["notification_color_selected",ke.NOTIFICATION_COLOR_SELECTED],["notification_color_hover",ke.NOTIFICATION_COLOR_HOVER],["notification_text_color",ke.NOTIFICATION_TEXT_COLOR],["notification_text_color_selected",ke.NOTIFICATION_TEXT_COLOR_SELECTED],["notification_text_color_hover",ke.NOTIFICATION_TEXT_COLOR_HOVER]],Je=o([["title_color",ke.TITLE_COLOR],["subtitle_color",ke.SUBTITLE_COLOR],["sidebar_button_color",ke.BUTTON_COLOR],["sidebar_background",ke.BACKGROUND],["menu_background",ke.MENU_BACKGROUND],["scrollbar_thumb_color",ke.SCROLLBAR_THUMB_COLOR],["divider_color",ke.DIVIDER_COLOR],["divider_top_color",ke.DIVIDER_TOP_COLOR],["divider_bottom_color",ke.DIVIDER_BOTTOM_COLOR]],$e,!0);!function(e){e.NOTIFICATIONS_BADGE="notification-badge",e.NOTIFICATIONS_BADGE_COLLAPSED="notification-badge-collapsed",e.IRON_SELECTED="iron-selected"}(Ue||(Ue={})),function(e){e.PANEL="data-panel",e.ROLE="role",e.PROCESSED="data-processed",e.WITH_NOTIFICATION="data-notification",e.ARIA_SELECTED="aria-selected",e.ARIA_DISABLED="aria-disabled",e.DISABLED="disabled",e.HREF="href",e.STYLE="style"}(Ve||(Ve={})),function(e){e.CLICK="click",e.MOUSEDOWN="mousedown",e.MOUSEENTER="mouseenter",e.MOUSELEAVE="mouseleave",e.KEYDOWN="keydown",e.HASS_EDIT_SIDEBAR="hass-edit-sidebar",e.RENDER_TEMPLATE="render_template",e.LOCATION_CHANGED="location-changed"}(Xe||(Xe={})),function(e){e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.TAB="Tab"}(We||(We={})),function(e){e.PAPER_ICON_ITEM="PAPER-ICON-ITEM",e.A="A"}(qe||(qe={}));var ze,Qe,Ze,et,tt,nt,ot,rt,it,at,ct,st,lt,ut,dt,ft,_t,pt,ht,Et,Ot,At,mt,It,Tt=["HOME-ASSISTANT","HOME-ASSISTANT-MAIN","HA-SIDEBAR"],vt=((Ie={})[he.HIDDEN]=Ee.ALWAYS_HIDDEN,Ie[he.NARROW]=Ee.AUTO,Ie[he.EXTENDED]=Ee.DOCKED,Ie),bt="/profile",yt=/^\s*\[\[\[([\s\S]+)\]\]\]\s*$/,gt=/\{\{[\s\S]*\}\}|\{%[\s\S]*%\}/,Nt=/@partial\s+([\w-]+)/g,Rt=/^\s*([a-z_]+)\.([\w-]+)\s*$/,Ct=/^\s*ref\(([\s\S]*)\)\s*$/,St=function(e){return Array.isArray(e)?e.map((function(e){return e.toLowerCase()})):e.toLowerCase().split(/\s*,\s*/)},Lt=function(){return new Promise((function(e){setTimeout(e,1)}))},wt=o(o([],Ke,!0),Ye,!0),Dt=["id","exceptions","extendable_configs","extend_from","user","not_user","device","not_device","is_admin"],xt=["js_variables","jinja_variables","partials"],Mt=function(){function t(e,t,n){var o;this._config=e,this._extendable=new Map(Object.entries(null!==(o=this._config.extendable_configs)&&void 0!==o?o:[])),this._user=t,this._userAgent=n,this._exceptions=this._getExceptions(),this._buildFlattenConfig()}return t.prototype._getExceptions=function(){var e=this;if(this._config.exceptions){var t=this._user.name.toLocaleLowerCase();return this._config.exceptions.filter((function(n){var o,r=null!==(o=n.matchers_conditions)&&void 0!==o?o:Oe.OR,i=void 0!==n.user&&St(n.user).includes(t),a=void 0!==n.not_user&&!St(n.not_user).includes(t),c=void 0!==n.device&&St(n.device).some((function(t){return e._userAgent.includes(t)})),s=void 0!==n.not_device&&!St(n.not_device).some((function(t){return e._userAgent.includes(t)})),l=void 0!==n.is_admin&&n.is_admin===e._user.is_admin,u=void 0!==n.is_owner&&n.is_owner===e._user.is_owner;return r===Oe.OR?i||a||c||s||l||u:(void 0===n.user||i)&&(void 0===n.not_user||a)&&(void 0===n.device||c)&&(void 0===n.not_device||s)&&(void 0===n.is_admin||l)&&(void 0===n.is_owner||u)}))}return[]},t.prototype._mergeConfigs=function(){for(var t=[],n=0;n ")," > ").concat(r));return Pt(t[r].trim(),t,o(o([],n,!0),[r],!1))}return console.warn("".concat(we,": partial ").concat(r," doesn't exist")),""}))},Ht=function(){for(var e=[],t=0;t ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={maxWidth:"calc(100% - 100px)"},ze["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={display:"flex",flexDirection:"column",gap:"5px",lineHeight:"1"},ze["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT).concat(Fe.AFTER)]={content:"attr(data-info)",display:"none",fontSize:"11px",lineHeight:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ze["{ SELECTOR.HOST_EXPANDED } ".concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.NOTIFICATIONS_BADGE_COLLAPSED)]={opacity:"0"},ze["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM).concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={zIndex:"1"},ze["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.NOTIFICATION_BADGE,":not(").concat(He.NOTIFICATIONS_BADGE_COLLAPSED,")")]=e({left:"calc(var(--app-drawer-width, 248px) - 22px)",maxWidth:"80px",transform:"translateX(-100%)"},Ft),ze["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.NOTIFICATIONS_BADGE_COLLAPSED)]=e({bottom:"14px",left:"26px",maxWidth:"20px"},Ft),ze["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.CONFIGURATION_BADGE)]=e({},Ft),ze),kt=((Qe={})["".concat(He.HOST," ").concat(He.MENU," > ").concat(He.TITLE)]={color:Ht(ke.TITLE_COLOR,Be.SIDEBAR_TITLE_COLOR,Be.PRIMARY_TEXT_COLOR)},Qe),jt=((Ze={})["".concat(He.HOST," ").concat(He.MENU," > ").concat(He.TITLE).concat(Fe.AFTER)]={content:"attr(data-subtitle)",color:Ht(ke.SUBTITLE_COLOR,ke.TITLE_COLOR,Be.SIDEBAR_TITLE_COLOR,Be.PRIMARY_TEXT_COLOR),display:"block",fontSize:"12px",lineHeight:"1.5"},Ze),Gt=((et={})["".concat(He.HOST," ").concat(He.MENU," > ").concat(Pe.HA_ICON_BUTTON)]={color:Ht(ke.BUTTON_COLOR,Be.SIDEBAR_ICON_COLOR)},et),Ut=((tt={})[He.HOST]={background:Ht(ke.BACKGROUND,Be.SIDEBAR_BACKGROUND_COLOR)+" !important"},tt),Vt=((nt={})["".concat(He.HOST," ").concat(He.MENU)]={background:Ht(ke.MENU_BACKGROUND,ke.BACKGROUND,Be.SIDEBAR_MENU_BUTTON_BACKGROUND_COLOR,Be.PRIMARY_BACKGROUND_COLOR),borderBottomColor:Ht(ke.DIVIDER_TOP_COLOR,ke.DIVIDER_COLOR,Be.DIVIDER_COLOR),borderBottomStyle:"solid",borderBottomWidth:"1px"},nt),Xt=((ot={})["".concat(He.HOST," ").concat(He.DIVIDER).concat(Fe.BEFORE)]={backgroundColor:Ht(ke.DIVIDER_BOTTOM_COLOR,ke.DIVIDER_COLOR,Be.DIVIDER_COLOR)},ot),Wt=((rt={})["".concat(He.HOST," > ").concat(He.MC_DRAWER)]={borderColor:Ht(ke.BORDER_COLOR,Be.DIVIDER_COLOR,"rgba(0,0,0,.12)")},rt),qt=((it={})["".concat(He.HOST," ").concat(Pe.PAPER_LISTBOX).concat(He.HA_SCROLLBAR)]={scrollbarColor:Ht(ke.SCROLLBAR_THUMB_COLOR,Be.SCROLLBAR_THUMB_COLOR)+" transparent"},it["".concat(He.HOST," ").concat(Pe.PAPER_LISTBOX).concat(He.HA_SCROLLBAR).concat(Fe.WEBKIT_SCROLLBAR_THUMB)]={background:Ht(ke.SCROLLBAR_THUMB_COLOR,Be.SCROLLBAR_THUMB_COLOR)},it),Kt=((at={})["".concat(He.MENU,"[").concat(Ge,"]")]={pointerEvents:"none"},at["".concat(He.MENU,"[").concat(Ge,"] > ").concat(Pe.HA_ICON_BUTTON)]={pointerEvents:"all"},at),Yt=((ct={})["".concat(He.HOST," ").concat(He.ITEM,":not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM)]={background:Ht(ke.ITEM_BACKGROUND,"none")},ct),$t=((st={})["".concat(He.HOST," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM)]={background:Ht(ke.ITEM_BACKGROUND_HOVER,ke.ITEM_BACKGROUND,"none")},st),Jt=((lt={})["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(Pe.HA_SVG_ICON,", ").concat(Pe.HA_ICON,")")]={color:Ht(ke.ICON_COLOR,Be.SIDEBAR_ICON_COLOR)},lt),zt=((ut={})["".concat(He.HOST," ").concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(Pe.HA_SVG_ICON,", ").concat(Pe.HA_ICON,")")]={color:Ht(ke.ICON_COLOR_SELECTED,Be.SIDEBAR_SELECTED_ICON_COLOR)},ut),Qt=((dt={})["".concat(He.HOST," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(Pe.HA_SVG_ICON,", ").concat(Pe.HA_ICON,")")]={color:Ht(ke.ICON_COLOR_HOVER,ke.ICON_COLOR,Be.SIDEBAR_ICON_COLOR)},dt),Zt=((ft={})["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={color:Ht(ke.TEXT_COLOR,Be.SIDEBAR_TEXT_COLOR)},ft),en=((_t={})["".concat(He.HOST," ").concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={color:Ht(ke.TEXT_COLOR_SELECTED,Be.SIDEBAR_SELECTED_TEXT_COLOR)},_t),tn=((pt={})["".concat(He.HOST," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={color:Ht(ke.TEXT_COLOR_HOVER,ke.TEXT_COLOR,Be.SIDEBAR_TEXT_COLOR)},pt),nn=((ht={})["".concat(He.HOST," :is(").concat(He.ITEM,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER,") > ").concat(Pe.PAPER_ICON_ITEM).concat(Fe.BEFORE)]={background:Ht(ke.SELECTION_BACKGROUND,ke.ICON_COLOR_SELECTED,Be.SIDEBAR_SELECTED_ICON_COLOR),opacity:Ht(ke.SELECTION_OPACITY,"0.12")},ht),on=((Et={})["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT).concat(He.DATA_INFO).concat(Fe.AFTER)]={color:Ht(ke.INFO_COLOR,Be.SIDEBAR_TEXT_COLOR),display:"block"},Et),rn=((Ot={})["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM).concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT).concat(He.DATA_INFO).concat(Fe.AFTER)]={color:Ht(ke.INFO_COLOR_SELECTED,Be.SIDEBAR_SELECTED_TEXT_COLOR)},Ot),an=((At={})["".concat(He.HOST_EXPANDED," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT).concat(He.DATA_INFO).concat(Fe.AFTER)]={color:Ht(ke.INFO_COLOR_HOVER,ke.INFO_COLOR,Be.SIDEBAR_TEXT_COLOR)},At),cn=((mt={})["".concat(He.HOST," ").concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(He.NOTIFICATION_BADGE,", ").concat(He.CONFIGURATION_BADGE,")")]={backgroundColor:Ht(ke.NOTIFICATION_COLOR_SELECTED,ke.NOTIFICATION_COLOR,Be.ACCENT_COLOR),color:Ht(ke.NOTIFICATION_TEXT_COLOR_SELECTED,ke.NOTIFICATION_TEXT_COLOR,Be.TEXT_ACCENT_COLOR,Be.TEXT_PRIMARY_COLOR)},mt),sn=((It={})["".concat(He.HOST," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(He.NOTIFICATION_BADGE,", ").concat(He.CONFIGURATION_BADGE,")")]={backgroundColor:Ht(ke.NOTIFICATION_COLOR_HOVER,ke.NOTIFICATION_COLOR,Be.ACCENT_COLOR),color:Ht(ke.NOTIFICATION_TEXT_COLOR_HOVER,ke.NOTIFICATION_TEXT_COLOR,Be.TEXT_ACCENT_COLOR,Be.TEXT_PRIMARY_COLOR)},It);function ln(e){return null==e}var un={isNothing:ln,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:ln(e)?[]:[e]},repeat:function(e,t){var n,o="";for(n=0;nc&&(t=o-c+(i=" ... ").length),n-o>c&&(n=o+c-(a=" ...").length),{str:i+e.slice(t,n).replace(/\t/g,"→")+a,pos:o-t+i.length}}function hn(e,t){return un.repeat(" ",t-e.length)+e}var En=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,o=/\r?\n|\r|\0/g,r=[0],i=[],a=-1;n=o.exec(e.buffer);)i.push(n.index),r.push(n.index+n[0].length),e.position<=n.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var c,s,l="",u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)s=pn(e.buffer,r[a-c],i[a-c],e.position-(r[a]-r[a-c]),d),l=un.repeat(" ",t.indent)+hn((e.line-c+1).toString(),u)+" | "+s.str+"\n"+l;for(s=pn(e.buffer,r[a],i[a],e.position,d),l+=un.repeat(" ",t.indent)+hn((e.line+1).toString(),u)+" | "+s.str+"\n",l+=un.repeat("-",t.indent+u+3+s.pos)+"^\n",c=1;c<=t.linesAfter&&!(a+c>=i.length);c++)s=pn(e.buffer,r[a+c],i[a+c],e.position-(r[a]-r[a+c]),d),l+=un.repeat(" ",t.indent)+hn((e.line+c+1).toString(),u)+" | "+s.str+"\n";return l.replace(/\n$/,"")},On=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],An=["scalar","sequence","mapping"];var mn=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===On.indexOf(t))throw new _n('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===An.indexOf(this.kind))throw new _n('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function In(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,o){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=o)})),n[t]=e})),n}function Tn(e){return this.extend(e)}Tn.prototype.extend=function(e){var t=[],n=[];if(e instanceof mn)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new _n("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof mn))throw new _n("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new _n("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new _n("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof mn))throw new _n("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var o=Object.create(Tn.prototype);return o.implicit=(this.implicit||[]).concat(t),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=In(o,"implicit"),o.compiledExplicit=In(o,"explicit"),o.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function o(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),xn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Mn=/^[-+]?[0-9]+e/;var Pn=new mn("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!xn.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||un.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(un.isNegativeZero(e))return"-0.0";return n=e.toString(10),Mn.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),Hn=Nn.extend({implicit:[Rn,Cn,Dn,Pn]}),Fn=Hn,Bn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),kn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var jn=new mn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Bn.exec(e)||null!==kn.exec(e))},construct:function(e){var t,n,o,r,i,a,c,s,l=0,u=null;if(null===(t=Bn.exec(e))&&(t=kn.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],o=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,o,r));if(i=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),s=new Date(Date.UTC(n,o,r,i,a,c,l)),u&&s.setTime(s.getTime()-u),s},instanceOf:Date,represent:function(e){return e.toISOString()}});var Gn=new mn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),Un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var Vn=new mn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,o=0,r=e.length,i=Un;for(n=0;n64)){if(t<0)return!1;o+=6}return o%8==0},construct:function(e){var t,n,o=e.replace(/[\r\n=]/g,""),r=o.length,i=Un,a=0,c=[];for(t=0;t>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|i.indexOf(o.charAt(t));return 0===(n=r%4*6)?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===n?(c.push(a>>10&255),c.push(a>>2&255)):12===n&&c.push(a>>4&255),new Uint8Array(c)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,o="",r=0,i=e.length,a=Un;for(t=0;t>18&63],o+=a[r>>12&63],o+=a[r>>6&63],o+=a[63&r]),r=(r<<8)+e[t];return 0===(n=i%3)?(o+=a[r>>18&63],o+=a[r>>12&63],o+=a[r>>6&63],o+=a[63&r]):2===n?(o+=a[r>>10&63],o+=a[r>>4&63],o+=a[r<<2&63],o+=a[64]):1===n&&(o+=a[r>>2&63],o+=a[r<<4&63],o+=a[64],o+=a[64]),o}}),Xn=Object.prototype.hasOwnProperty,Wn=Object.prototype.toString;var qn=new mn("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,o,r,i,a=[],c=e;for(t=0,n=c.length;t>10),56320+(e-65536&1023))}for(var vo=new Array(256),bo=new Array(256),yo=0;yo<256;yo++)vo[yo]=Io(yo)?1:0,bo[yo]=Io(yo);function go(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||zn,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function No(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=En(n),new _n(t,n)}function Ro(e,t){throw No(e,t)}function Co(e,t){e.onWarning&&e.onWarning.call(null,No(e,t))}var So={YAML:function(e,t,n){var o,r,i;null!==e.version&&Ro(e,"duplication of %YAML directive"),1!==n.length&&Ro(e,"YAML directive accepts exactly one argument"),null===(o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&Ro(e,"ill-formed argument of the YAML directive"),r=parseInt(o[1],10),i=parseInt(o[2],10),1!==r&&Ro(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&Co(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var o,r;2!==n.length&&Ro(e,"TAG directive accepts exactly two arguments"),o=n[0],r=n[1],lo.test(o)||Ro(e,"ill-formed tag handle (first argument) of the TAG directive"),Qn.call(e.tagMap,o)&&Ro(e,'there is a previously declared suffix for "'+o+'" tag handle'),uo.test(r)||Ro(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Ro(e,"tag prefix is malformed: "+r)}e.tagMap[o]=r}};function Lo(e,t,n,o){var r,i,a,c;if(t1&&(e.result+=un.repeat("\n",t-1))}function Fo(e,t){var n,o,r=e.tag,i=e.anchor,a=[],c=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),o=e.input.charCodeAt(e.position);0!==o&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,Ro(e,"tab characters must not be used in indentation")),45===o)&&ho(e.input.charCodeAt(e.position+1));)if(c=!0,e.position++,Mo(e,!0,-1)&&e.lineIndent<=t)a.push(null),o=e.input.charCodeAt(e.position);else if(n=e.line,jo(e,t,to,!1,!0),a.push(e.result),Mo(e,!0,-1),o=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==o)Ro(e,"bad indentation of a sequence entry");else if(e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt)&&(O&&(a=e.line,c=e.lineStart,s=e.position),jo(e,t,no,!0,r)&&(O?h=e.result:E=e.result),O||(Do(e,f,_,p,h,E,a,c,s),p=h=E=null),Mo(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&0!==l)Ro(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Ro(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Ro(e,"repeat of an indentation width identifier"):(l=t+r-1,s=!0)}if(po(i)){do{i=e.input.charCodeAt(++e.position)}while(po(i));if(35===i)do{i=e.input.charCodeAt(++e.position)}while(!_o(i)&&0!==i)}for(;0!==i;){for(xo(e),e.lineIndent=0,i=e.input.charCodeAt(e.position);(!s||e.lineIndentl&&(l=e.lineIndent),_o(i))u++;else{if(e.lineIndent0){for(r=a,i=0;r>0;r--)(a=Oo(c=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+a:Ro(e,"expected hexadecimal character");e.result+=To(i),e.position++}else Ro(e,"unknown escape sequence");n=o=e.position}else _o(c)?(Lo(e,n,o,!0),Ho(e,Mo(e,!1,t)),n=o=e.position):e.position===e.lineStart&&Po(e)?Ro(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}Ro(e,"unexpected end of the stream within a double quoted scalar")}(e,f)?E=!0:!function(e){var t,n,o;if(42!==(o=e.input.charCodeAt(e.position)))return!1;for(o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!ho(o)&&!Eo(o);)o=e.input.charCodeAt(++e.position);return e.position===t&&Ro(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Qn.call(e.anchorMap,n)||Ro(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],Mo(e,!0,-1),!0}(e)?function(e,t,n){var o,r,i,a,c,s,l,u,d=e.kind,f=e.result;if(ho(u=e.input.charCodeAt(e.position))||Eo(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(ho(o=e.input.charCodeAt(e.position+1))||n&&Eo(o)))return!1;for(e.kind="scalar",e.result="",r=i=e.position,a=!1;0!==u;){if(58===u){if(ho(o=e.input.charCodeAt(e.position+1))||n&&Eo(o))break}else if(35===u){if(ho(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Po(e)||n&&Eo(u))break;if(_o(u)){if(c=e.line,s=e.lineStart,l=e.lineIndent,Mo(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=i,e.line=c,e.lineStart=s,e.lineIndent=l;break}}a&&(Lo(e,r,i,!1),Ho(e,e.line-c),r=i=e.position,a=!1),po(u)||(i=e.position+1),u=e.input.charCodeAt(++e.position)}return Lo(e,r,i,!1),!!e.result||(e.kind=d,e.result=f,!1)}(e,f,Zn===n)&&(E=!0,null===e.tag&&(e.tag="?")):(E=!0,null===e.tag&&null===e.anchor||Ro(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===p&&(E=c&&Fo(e,_))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&Ro(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),s=0,l=e.implicitTypes.length;s"),null!==e.result&&d.kind!==e.kind&&Ro(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):Ro(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||E}function Go(e){var t,n,o,r,i=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(Mo(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!ho(r);)r=e.input.charCodeAt(++e.position);for(o=[],(n=e.input.slice(t,e.position)).length<1&&Ro(e,"directive name must not be less than one character in length");0!==r;){for(;po(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!_o(r));break}if(_o(r))break;for(t=e.position;0!==r&&!ho(r);)r=e.input.charCodeAt(++e.position);o.push(e.input.slice(t,e.position))}0!==r&&xo(e),Qn.call(So,n)?So[n](e,n,o):Co(e,'unknown document directive "'+n+'"')}Mo(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,Mo(e,!0,-1)):a&&Ro(e,"directives end mark is expected"),jo(e,e.lineIndent-1,no,!1,!0),Mo(e,!0,-1),e.checkLineBreaks&&co.test(e.input.slice(i,e.position))&&Co(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Po(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Mo(e,!0,-1)):e.position=55296&&o<=56319&&t+1=56320&&n<=57343?1024*(o-55296)+n-56320+65536:o}function wr(e){return/^\n* /.test(e)}var Dr=1,xr=2,Mr=3,Pr=4,Hr=5;function Fr(e,t,n,o,r,i,a,c){var s,l=0,u=null,d=!1,f=!1,_=-1!==o,p=-1,h=function(e){return Rr(e)&&e!==qo&&!Nr(e)&&e!==ir&&e!==lr&&e!==ar&&e!==rr&&e!==dr&&e!==fr&&e!==pr&&e!==Er&&e!==Zo&&e!==tr&&e!==or&&e!==zo&&e!==hr&&e!==cr&&e!==sr&&e!==nr&&e!==Qo&&e!==er&&e!==ur&&e!==_r}(Lr(e,0))&&function(e){return!Nr(e)&&e!==ar}(Lr(e,e.length-1));if(t||a)for(s=0;s=65536?s+=2:s++){if(!Rr(l=Lr(e,s)))return Hr;h=h&&Sr(l,u,c),u=l}else{for(s=0;s=65536?s+=2:s++){if((l=Lr(e,s))===Yo)d=!0,_&&(f=f||s-p-1>o&&" "!==e[p+1],p=s);else if(!Rr(l))return Hr;h=h&&Sr(l,u,c),u=l}f=f||_&&s-p-1>o&&" "!==e[p+1]}return d||f?n>9&&wr(e)?Hr:a?i===vr?Hr:xr:f?Pr:Mr:!h||a||r(e)?i===vr?Hr:xr:Dr}function Br(e,t,n,o,r){e.dump=function(){if(0===t.length)return e.quotingType===vr?'""':"''";if(!e.noCompatMode&&(-1!==Ar.indexOf(t)||mr.test(t)))return e.quotingType===vr?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),c=o||e.flowLevel>-1&&n>=e.flowLevel;switch(Fr(t,c,e.indent,a,(function(t){return function(e,t){var n,o;for(n=0,o=e.implicitTypes.length;n"+kr(t,e.indent)+jr(yr(function(e,t){var n,o,r=/(\n+)([^\n]*)/g,i=(c=e.indexOf("\n"),c=-1!==c?c:e.length,r.lastIndex=c,Gr(e.slice(0,c),t)),a="\n"===e[0]||" "===e[0];var c;for(;o=r.exec(e);){var s=o[1],l=o[2];n=" "===l[0],i+=s+(a||n||""===l?"":"\n")+Gr(l,t),a=n}return i}(t,a),i));case Hr:return'"'+function(e){for(var t,n="",o=0,r=0;r=65536?r+=2:r++)o=Lr(e,r),!(t=Or[o])&&Rr(o)?(n+=e[r],o>=65536&&(n+=e[r+1])):n+=t||Ir(o);return n}(t)+'"';default:throw new _n("impossible error: invalid scalar style")}}()}function kr(e,t){var n=wr(e)?String(t):"",o="\n"===e[e.length-1];return n+(o&&("\n"===e[e.length-2]||"\n"===e)?"+":o?"":"-")+"\n"}function jr(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Gr(e,t){if(""===e||" "===e[0])return e;for(var n,o,r=/ [^ ]/g,i=0,a=0,c=0,s="";n=r.exec(e);)(c=n.index)-i>t&&(o=a>i?a:c,s+="\n"+e.slice(i,o),i=o+1),a=c;return s+="\n",e.length-i>t&&a>i?s+=e.slice(i,a)+"\n"+e.slice(a+1):s+=e.slice(i),s.slice(1)}function Ur(e,t,n,o){var r,i,a,c="",s=e.tag;for(r=0,i=n.length;r tag resolver accepts not "'+s+'" style');o=c.represent[s](t,s)}e.dump=o}return!0}return!1}function Xr(e,t,n,o,r,i,a){e.tag=null,e.dump=n,Vr(e,n,!1)||Vr(e,n,!0);var c,s=Xo.call(e.dump),l=o;o&&(o=e.flowLevel<0||e.flowLevel>t);var u,d,f="[object Object]"===s||"[object Array]"===s;if(f&&(d=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||d||2!==e.indent&&t>0)&&(r=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===s)o&&0!==Object.keys(e.dump).length?(!function(e,t,n,o){var r,i,a,c,s,l,u="",d=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new _n("sortKeys must be a boolean or a function");for(r=0,i=f.length;r1024)&&(e.dump&&Yo===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,s&&(l+=gr(e,t)),Xr(e,t+1,c,!0,s)&&(e.dump&&Yo===e.dump.charCodeAt(0)?l+=":":l+=": ",u+=l+=e.dump));e.tag=d,e.dump=u||"{}"}(e,t,e.dump,r),d&&(e.dump="&ref_"+u+e.dump)):(!function(e,t,n){var o,r,i,a,c,s="",l=e.tag,u=Object.keys(n);for(o=0,r=u.length;o1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Xr(e,t,a,!1,!1)&&(s+=c+=e.dump));e.tag=l,e.dump="{"+s+"}"}(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===s)o&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?Ur(e,t-1,e.dump,r):Ur(e,t,e.dump,r),d&&(e.dump="&ref_"+u+e.dump)):(!function(e,t,n){var o,r,i,a="",c=e.tag;for(o=0,r=n.length;o",e.dump=c+" "+e.dump)}return!0}function Wr(e,t){var n,o,r=[],i=[];for(qr(e,r,i),n=0,o=i.length;n ")," > ").concat(e,'"'));if(e===Me)throw new SyntaxError("".concat($r,', error in extendable config "').concat(n[0],'": "entend_from" can only be "base" in exceptions'));if(!(e in t.extendable_configs))throw new SyntaxError("".concat($r,', error in "').concat(n[n.length-1],'": "').concat(e,'" doesn\'t exist in "extendable_configs"'));ii(t.extendable_configs[e].extend_from,t,o(o([],n,!0),[e],!1))}))},ai=function(e,t){zr.forEach((function(n){if(n in e)throw new SyntaxError("".concat(t,' "').concat(n,'" option can only be placed in the main config'))}))},ci=function(e,t,n){if("string"==typeof t&&(yt.test(t)||gt.test(t)))console.warn('"'.concat(e,'" property should not have templates. "').concat(n.join(" > "),'" seems to be a template'));else if(typeof t!==Le.STRING&&typeof t!==Le.NUMBER&&typeof t!==Le.BOOLEAN)if(Array.isArray(t))t.forEach((function(t,r){ci(e,t,o(o([],n,!0),["[".concat(r,"]")],!1))}));else{if(Object.prototype.toString.call(t)!==je)throw new SyntaxError("".concat($r,', "').concat(e,": ").concat(n.join(" > "),'" has a wrong type ').concat(Object.prototype.toString.call(t)));var r=t;Object.entries(r).forEach((function(t){var r=t[0],i=t[1];ci(e,i,o(o([],n,!0),[r],!1))}))}},si=function(e,t){if(typeof t!==Le.UNDEFINED){if(Object.prototype.toString.call(t)!==je)throw new SyntaxError("".concat($r,', "').concat(e,'" property should be an object'));Object.entries(t).forEach((function(t){var n=t[0],o=t[1];ci(e,o,[n])}))}},li=function(e,t){if(typeof e!==Le.UNDEFINED){if(!Array.isArray(e))throw new SyntaxError("".concat($r,", exceptions should be an array"));e.forEach((function(e){!function(e,t){var n;if(ai(e,"".concat($r,", exceptions")),Qr(e,o([],Jr,!0),"".concat($r,", exceptions")),Zr(e,o([],Ye,!0),"".concat($r,", exceptions")),ni([["user",e.user],["not_user",e.not_user],["device",e.device],["not_device",e.not_device],["extend_from",e.extend_from]],"".concat($r,", exceptions")),ri(e.extend_from,t,"".concat($r,", error in exception:"),!0),typeof e.matchers_conditions!==Le.UNDEFINED&&e.matchers_conditions!==Oe.AND&&e.matchers_conditions!==Oe.OR)throw new SyntaxError("".concat($r,', exceptions "matchers_conditions" property should be "').concat(Oe.AND,'" or "').concat(Oe.OR,'"'));if(typeof e.order!==Le.UNDEFINED&&!Array.isArray(e.order))throw new SyntaxError("".concat($r,', exceptions "order" property should be an array'));if(ti(e,["sidebar_editable"],"".concat($r,", exceptions")),ei(e,["hide_all","is_admin","is_owner"],"".concat($r,", exceptions")),typeof e.sidebar_mode!==Le.UNDEFINED&&!(e.sidebar_mode in vt))throw new SyntaxError("".concat($r,', exceptions "sidebar_mode" property should be ').concat(he.HIDDEN,", ").concat(he.NARROW," or ").concat(he.EXTENDED));if(e.user&&e.not_user)throw new SyntaxError("".concat($r,', exceptions "user" and "not_user" properties cannot be used together'));if(e.device&&e.not_device)throw new SyntaxError("".concat($r,', exceptions "device" and "not_device" properties cannot be used together'));null===(n=e.order)||void 0===n||n.forEach(ui)}(e,t)}))}},ui=function(e){if(ai(e,"".concat($r," in ").concat(e.item,",")),!e.item)throw new SyntaxError("".concat($r,', every item in an "order" array should have an "item" property'));if(Qr(e,o(["item","info"],Ke,!0),"".concat($r," in ").concat(e.item,",")),Zr(e,o([],Ye,!0),"".concat($r," in ").concat(e.item,",")),ti(e,["hide"],"".concat($r," in ").concat(e.item,",")),function(e,t){if(typeof e.on_click!==Le.UNDEFINED){if(Object.prototype.toString.call(e.on_click)!==je)throw new SyntaxError("".concat(t,' "on_click" property should be an object'));if(typeof e.on_click.action!==Le.STRING)throw new SyntaxError("".concat(t,' the "action" parameter should be a string'));if(!Object.values(me).includes(e.on_click.action))throw new SyntaxError("".concat(t,' the "action" parameter should be one of these values: ').concat(Object.values(me).join(", ")));if(e.on_click.action===me.CALL_SERVICE){if(typeof e.on_click.service!==Le.STRING)throw new SyntaxError("".concat(t,' the "service" parameter should be a string'));if(typeof e.on_click.data!==Le.UNDEFINED&&Object.prototype.toString.call(e.on_click.data)!==je)throw new SyntaxError("".concat(t,' the "data" parameter needs to be an object'))}if(e.on_click.action===me.JAVASCRIPT&&typeof e.on_click.code!==Le.STRING)throw new SyntaxError("".concat(t,' the "code" parameter should be a string'))}}(e,"".concat($r," in ").concat(e.item,",")),e.new_item){if(Qr(e,["href","icon"],"".concat($r," in ").concat(e.item,",")),!e.href&&!e.on_click)throw new SyntaxError("".concat($r," in ").concat(e.item,', if you set "new_item" as "true", it is necessary an "href" or an "on_click "property'));if(!e.icon)throw new SyntaxError("".concat($r," in ").concat(e.item,', if you set "new_item" as "true", "icon" property is necessary'))}},di=function(e){var t;if(Qr(e,o([],Jr,!0),"".concat($r,",")),ni([["extend_from",e.extend_from]],"".concat($r,",")),ri(e.extend_from,e,"".concat($r,", error in main config:")),function(e){e.extendable_configs&&Object.entries(e.extendable_configs).forEach((function(t){var n=t[0],o=t[1];ii(o.extend_from,e,[n])}))}(e),Zr(e,o([],Ye,!0),"".concat($r,",")),ti(e,["sidebar_editable"],"".concat($r,",")),ei(e,["hide_all"],"".concat($r,",")),typeof e.sidebar_mode!==Le.UNDEFINED&&!(e.sidebar_mode in vt))throw new SyntaxError("".concat($r,', "sidebar_mode" property should be ').concat(he.HIDDEN,", ").concat(he.NARROW," or ").concat(he.EXTENDED));if(typeof e.order!==Le.UNDEFINED&&!Array.isArray(e.order))throw new SyntaxError("".concat($r,', "order" property should be an array'));if(typeof e.partials!==Le.UNDEFINED){if(Object.prototype.toString.call(e.partials)!==je)throw new SyntaxError("".concat($r,', "partials" property should be an object'));Object.entries(e.partials).forEach((function(e){var t=e[0];if(typeof e[1]!==Le.STRING)throw new SyntaxError("".concat($r,', "partials" should be an object with strings. The partial ').concat(t," is not a string"))}))}si("js_variables",e.js_variables),si("jinja_variables",e.jinja_variables),null===(t=e.order)||void 0===t||t.forEach(ui),li(e.exceptions,e)},fi=function(){return t(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(n){return e="".concat(we,": YAML config file not found."),t="Make sure you have valid config in /config/www/".concat(De,".yaml file."),[2,new Promise((function(n){fetch("".concat(xe,".yaml?hash=").concat(Math.random().toString(16).slice(2))).then((function(o){if(!o.ok)throw Error("".concat(e,"\n").concat(t));o.text().then((function(e){return Yr.load(e)})).then((function(e){var o;(null===(o=e.id)||void 0===o?void 0:o.startsWith("example_yaml"))&&console.warn("".concat(we,": You seem to be using the example configuration.\n").concat(t)),di(e),n(e)})).catch((function(e){throw Error("".concat(we,": ").concat((null==e?void 0:e.message)||e))}))})).catch((function(){throw Error("".concat(e,"\n").concat(t))}))}))]}))}))},_i=function(){function o(){var e=this;this._parseJavaScriptVariables=function(){var t,n=null!==(t=e._config.js_variables)&&void 0!==t?t:{},o=Object.entries(n).filter((function(t){var n=t[0],o=t[1];if("string"==typeof o&&Ct.test(o)){var r=o.replace(Ct,"$1");return e._renderer.renderTemplate("\n const myRef = ref('".concat(n,"');\n myRef.value = ").concat(r,";\n return;\n ")),!1}return!0}));return Object.fromEntries(o)};var t=new re;t.addEventListener(H.ON_LISTEN,(function(t){e._homeAssistant=t.detail.HOME_ASSISTANT,e._main=t.detail.HOME_ASSISTANT_MAIN,e._haDrawer=t.detail.HA_DRAWER,e._sidebar=t.detail.HA_SIDEBAR,e._partialPanelResolver=t.detail.PARTIAL_PANEL_RESOLVER}),{once:!0}),t.addEventListener(H.ON_PANEL_LOAD,this._panelLoaded.bind(this)),t.listen(),this._styleManager=new Se({prefix:we,namespace:we,throwWarnings:!1}),this._items=[],this._sidebarScroll=0,this._isSidebarEditable=void 0,this._itemTouchedBinded=this._itemTouched.bind(this),this._mouseEnterBinded=this._mouseEnter.bind(this),this._mouseLeaveBinded=this._mouseLeave.bind(this),this._configPromise=fi(),this._process()}return o.prototype._getConfig=function(){return t(this,void 0,void 0,(function(){var e,t=this;return n(this,(function(n){switch(n.label){case 0:return e=this,[4,this._configPromise.then((function(e){return function(e,t,n){return new Mt(n,e,t).config}(t._ha.hass.user,navigator.userAgent.toLowerCase(),e)}))];case 1:return e._config=n.sent(),[2]}}))}))},o.prototype._getElements=function(){return t(this,void 0,void 0,(function(){var e,t,o,i;return n(this,(function(n){switch(n.label){case 0:return e={retries:100,delay:50,shouldReject:!1},[4,this._sidebar.selector.$.query(Pe.PAPER_LISTBOX).element];case 1:return t=n.sent(),[4,r((function(){return t.querySelector(":scope > ".concat(He.SPACER))}),(function(e){return!!e}),e)];case 2:return o=n.sent(),[4,r((function(){return t.querySelectorAll(":scope > ".concat(He.ITEM))}),(function(e){return Array.from(e).every((function(e){return e.querySelector(He.ITEM_TEXT).innerText.trim().length>0}))}),e)];case 3:return i=n.sent(),[2,[t,i,o]]}}))}))},o.prototype._hideAnchor=function(e,t){t?e.style.display="none":e.style.removeProperty("display")},o.prototype._buildNewItem=function(e){var t=document.createElement("a");return t.href=e.href?e.href:"#",t.target=e.target||"",t.tabIndex=-1,t.setAttribute(Ve.ROLE,"option"),t.setAttribute(Ve.PANEL,e.item.toLowerCase().replace(/\s+/,"-")),t.setAttribute(Ve.ARIA_SELECTED,"false"),t.innerHTML='\n \n \n \n ').concat(e.item,'\n \n \n \n ').trim(),t},o.prototype._getTemplateString=function(e){return t(this,void 0,void 0,(function(){var t,o;return n(this,(function(n){switch(n.label){case 0:return t="",e instanceof Promise||"string"==typeof e||"number"==typeof e&&!Number.isNaN(e)||"boolean"==typeof e||"object"==typeof e?"string"!=typeof e?[3,1]:(t=e.trim(),[3,6]):[3,6];case 1:return"number"!=typeof e&&"boolean"!=typeof e?[3,2]:(t=e.toString(),[3,6]);case 2:return e instanceof Promise?[4,e]:[3,5];case 3:return o=n.sent(),[4,this._getTemplateString(o)];case 4:return t=n.sent(),[3,6];case 5:t=JSON.stringify(e),n.label=6;case 6:return[2,t]}}))}))},o.prototype._subscribeTitle=function(){var e=this;this._sidebar.selector.$.query(He.TITLE).element.then((function(t){e._config.title&&e._subscribeTemplate(e._config.title,(function(e){t.innerHTML=e})),e._config.subtitle&&e._subscribeTemplate(e._config.subtitle,(function(e){t.dataset.subtitle=e}))}))},o.prototype._subscribeSideBarEdition=function(){var e=this,t=function(e){e.preventDefault(),e.stopImmediatePropagation()},n=function(e,n){e.removeEventListener(Xe.HASS_EDIT_SIDEBAR,t,!0),n.removeAttribute(Ge)},o=function(e,n){e.removeEventListener(Xe.HASS_EDIT_SIDEBAR,t,!0),e.addEventListener(Xe.HASS_EDIT_SIDEBAR,t,!0),n.setAttribute(Ge,"")};Promise.all([this._main.element,this._sidebar.selector.$.query(He.MENU).element]).then((function(t){var r=t[0],i=t[1];"boolean"==typeof e._config.sidebar_editable&&(e._isSidebarEditable=e._config.sidebar_editable,e._isSidebarEditable||o(r,i)),"string"==typeof e._config.sidebar_editable&&e._subscribeTemplate(e._config.sidebar_editable,(function(t){"true"===t||"false"===t?(e._isSidebarEditable=!("false"===t),e._isSidebarEditable?n(r,i):o(r,i)):(e._isSidebarEditable=void 0,n(r,i)),e._checkProfileEditableButton()}))}))},o.prototype._subscribeName=function(e,t){var n=e.querySelector(He.ITEM_TEXT);this._subscribeTemplate(t,(function(e){n.innerHTML=e}))},o.prototype._subscribeIcon=function(e,t){this._subscribeTemplate(t,(function(t){var n=e.querySelector(Pe.HA_ICON);if(!n){(n=document.createElement(Pe.HA_ICON)).setAttribute("slot","item-icon");var o=e.querySelector(Pe.HA_SVG_ICON);o?o.replaceWith(n):e.querySelector(Pe.PAPER_ICON_ITEM).prepend(n)}n.setAttribute("icon",t)}))},o.prototype._subscribeInfo=function(e,t){var n=e.querySelector(He.ITEM_TEXT);this._subscribeTemplate(t,(function(e){n.dataset.info=e}))},o.prototype._subscribeNotification=function(e,t){var n=e.querySelector("".concat(He.NOTIFICATION_BADGE,":not(").concat(He.NOTIFICATIONS_BADGE_COLLAPSED,")")),o=e.querySelector(He.NOTIFICATIONS_BADGE_COLLAPSED);n||((n=document.createElement("span")).classList.add(Ue.NOTIFICATIONS_BADGE),e.querySelector(Pe.PAPER_ICON_ITEM).append(n)),o||((o=document.createElement("span")).classList.add(Ue.NOTIFICATIONS_BADGE,Ue.NOTIFICATIONS_BADGE_COLLAPSED),e.querySelector("".concat(Pe.HA_SVG_ICON,", ").concat(Pe.HA_ICON)).after(o));this._subscribeTemplate(t,(function(t){t.length?(n.innerHTML=t,o.innerHTML=t,e.setAttribute(Ve.WITH_NOTIFICATION,"true")):(n.innerHTML="",o.innerHTML="",e.removeAttribute(Ve.WITH_NOTIFICATION))}))},o.prototype._subscribeHide=function(e,t){var n=this;"boolean"==typeof t?this._hideAnchor(e,t):this._subscribeTemplate(t,(function(t){n._hideAnchor(e,"true"===t)}))},o.prototype._subscribeTemplateColorChanges=function(e,t,n){var o=this;n.forEach((function(n){var r=n[0],i=n[1];e[r]&&o._subscribeTemplate(e[r],(function(e){t.style.setProperty(i,e)}))}))},o.prototype._subscribeTemplate=function(e,t){yt.test(e)?this._createJsTemplateSubscription(e.replace(yt,"$1"),t):gt.test(e)?this._createJinjaTemplateSubscription(e,t):this._getTemplateString(e).then((function(e){t(e)}))},o.prototype._createJsTemplateSubscription=function(e,t){var n=this;this._renderer.trackTemplate(Pt(e,this._config.partials),(function(e){n._getTemplateString(e).then((function(e){t(e)}))}))},o.prototype._createJinjaTemplateSubscription=function(t,n){var o=this;window.hassConnection.then((function(r){r.conn.subscribeMessage((function(e){n("".concat(e.result))}),{type:Xe.RENDER_TEMPLATE,template:Pt(t,o._config.partials),variables:e({user_name:o._ha.hass.user.name,user_is_admin:o._ha.hass.user.is_admin,user_is_owner:o._ha.hass.user.is_owner,user_agent:window.navigator.userAgent},o._config.jinja_variables)})}))},o.prototype._focusItem=function(e,t,n){var o=this._items.length,r="none",i=0;if(t)for(var a=(l=e+1)+o,c=l;co-1?c-o:c;if(this._items[s].style.display!==r){i=s;break}}else{var l;for(a=(l=e-1)-o,c=l;c>a;c--){s=c<0?o+c:c;if(this._items[s].style.display!==r){i=s;break}}}n?this._items[i].querySelector(Pe.PAPER_ICON_ITEM).focus():(this._items[i].focus(),this._items[i].tabIndex=0)},o.prototype._focusItemByKeyboard=function(e,t){var n=e.querySelector("\n ".concat(He.SCOPE," > ").concat(He.ITEM,":not(.").concat(Ue.IRON_SELECTED,"):focus,\n ").concat(He.SCOPE," > ").concat(He.ITEM,":focus,\n ").concat(He.SCOPE," > ").concat(He.ITEM,":has(> ").concat(Pe.PAPER_ICON_ITEM,":focus)\n ")),o=0;this._items.forEach((function(e,t){e===n&&(o=t),e.tabIndex=-1})),this._focusItem(o,t,!1)},o.prototype._focusItemByTab=function(e,t,n){if(t.nodeName===qe.A){var o=t,r=this._items.indexOf(o),i=this._items.length-1;if(n&&r0)this._focusItem(r,n,!0);else(n?e.querySelector(He.SIDEBAR_NOTIFICATIONS):e.querySelector(Pe.HA_ICON_BUTTON)).focus()}else{if(n)e.querySelector("".concat(He.PROFILE," > ").concat(Pe.PAPER_ICON_ITEM)).focus();else this._focusItem(0,n,!0)}},o.prototype._getActivePaperIconElement=function(e){void 0===e&&(e=document);var t=e.activeElement;return t?t instanceof HTMLElement&&(t.nodeName===qe.PAPER_ICON_ITEM||t.nodeName===qe.A&&"option"===t.getAttribute("role"))?t:t.shadowRoot&&Tt.includes(t.nodeName)?this._getActivePaperIconElement(t.shadowRoot):null:null},o.prototype._processDefaultPath=function(){var e,t=this._config.default_path;if(t)if(t.startsWith("/")){var n=[null,"",t];(e=window.history).replaceState.apply(e,n),window.dispatchEvent(new CustomEvent(Xe.LOCATION_CHANGED,{detail:{replace:t}}))}else console.warn("".concat(we,': ignoring default_path property as it doesn\'t start with "/".'))},o.prototype._processSidebar=function(){var e=this;Promise.all([this._main.element,this._partialPanelResolver.element]).then((function(o){var r=o[0],i=o[1],a=e._config.sidebar_mode,c=matchMedia("(max-width: 870px)");if(a){r.hass.dockedSidebar=vt[a];var s=function(o){return t(e,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return a===he.HIDDEN?[3,5]:[4,Lt()];case 1:return e.sent(),r.narrow=!1,[4,Lt()];case 2:return e.sent(),i.narrow=o,[4,Lt()];case 3:return e.sent(),o?[4,this._partialPanelResolver.selector.query(He.HA_MENU_BUTTON).element]:[3,5];case 4:e.sent().narrow=!1,e.label=5;case 5:return[2]}}))}))};c.addEventListener("change",(function(e){s(e.matches)})),s(c.matches)}})),Promise.all([this._haDrawer.selector.$.query(He.MC_DRAWER).element,this._sidebar.element,this._sidebar.selector.$.element,this._sidebar.selector.$.query(Pe.PAPER_LISTBOX).element]).then((function(t){var n=t[0],o=t[1],r=t[2],i=t[3];e._subscribeTemplateColorChanges(e._config,o,Je),e._subscribeTemplateColorChanges(e._config,n,[["sidebar_border_color",ke.BORDER_COLOR]]),i.addEventListener(Xe.KEYDOWN,(function(t){t.key!==We.ARROW_DOWN&&t.key!==We.ARROW_UP||(t.preventDefault(),t.stopImmediatePropagation(),e._focusItemByKeyboard(i,t.key===We.ARROW_DOWN))}),!0),window.addEventListener(Xe.KEYDOWN,(function(t){if(t.key===We.TAB){var n=e._getActivePaperIconElement();if(n)if(n.nodeName===qe.PAPER_ICON_ITEM){var o=n.parentElement;o.getAttribute(Ve.HREF)!==bt&&(t.preventDefault(),t.stopImmediatePropagation(),e._focusItemByTab(r,o,!t.shiftKey))}else n.getAttribute(Ve.HREF)!==bt&&(t.preventDefault(),t.stopImmediatePropagation(),e._focusItemByTab(r,n,!t.shiftKey))}}),!0),e._styleManager.addStyle(Wt,n),e._styleManager.addStyle([Bt,kt,jt,Gt,Ut,Vt,Xt,qt,Kt,Yt,$t,Jt,zt,Qt,Zt,en,tn,nn,on,rn,an,cn,sn,e._config.styles||""],r)}))},o.prototype._rearrange=function(){var t=this;this._getElements().then((function(n){var o=t._config,r=o.order,i=o.hide_all,a=n[0],c=n[1],s=n[2],l=0,u=!1;t._items=Array.from(c);var d=new Set;i&&t._items.forEach((function(e){t._hideAnchor(e,!0)}));var f=r.reduce((function(n,o){var r=o.item,i=o.match,a=o.exact,c=o.new_item,s=r.toLocaleLowerCase(),l=c?void 0:t._items.find((function(e){var t=i===Ae.DATA_PANEL?e.getAttribute(Ve.PANEL):i===Ae.HREF?e.getAttribute(Ve.HREF):e.querySelector(He.ITEM_TEXT).innerText.trim();return!((!a||r!==t)&&(a||!(null==t?void 0:t.toLowerCase().includes(s))))&&(!d.has(e)&&(d.add(e),!0))}));return l&&l.setAttribute(Ve.PROCESSED,"true"),(c||l)&&n.push(e(e({},o),{element:l})),c||l||console.warn("".concat(we,": you have an order item in your configuration that didn't match any sidebar item: \"").concat(r,'"')),n}),[]),_=function(){u||(t._items.forEach((function(e){e.hasAttribute(Ve.PROCESSED)||(e.style.order="".concat(l))})),l++,s.style.order="".concat(l),l++,u=!0)};f.forEach((function(e){if(e.bottom&&_(),e.new_item){var n=t._buildNewItem(e);a.append(n),e.element=n,e.element.setAttribute(Ve.PROCESSED,"true"),t._items.push(e.element)}else if(e.element){var o=e.element;e.href&&(o.href=e.href),e.target&&(o.target=e.target)}e.element.style.order="".concat(l),e.name&&t._subscribeName(e.element,e.name),e.icon&&t._subscribeIcon(e.element,e.icon),e.info&&t._subscribeInfo(e.element,e.info),e.notification&&t._subscribeNotification(e.element,e.notification),void 0!==e.hide&&t._subscribeHide(e.element,e.hide),t._subscribeTemplateColorChanges(e,e.element,$e),e.new_item&&(e.element.addEventListener(Xe.MOUSEENTER,t._mouseEnterBinded),e.element.addEventListener(Xe.MOUSELEAVE,t._mouseLeaveBinded)),e.element.addEventListener(Xe.MOUSEDOWN,t._itemTouchedBinded),e.element.addEventListener(Xe.KEYDOWN,(function(e){e.key===We.ENTER&&t._itemTouchedBinded()})),e.on_click&&e.element.addEventListener(Xe.CLICK,t._mouseClick.bind(t,e.on_click),!0),l++})),f.length&&_(),t._items.sort((function(e,t){return+e.style.order-+t.style.order})),t._panelLoaded()}))},o.prototype._itemTouched=function(){return t(this,void 0,void 0,(function(){var e=this;return n(this,(function(t){return this._sidebar.selector.$.query(Pe.PAPER_LISTBOX).element.then((function(t){e._sidebarScroll=t.scrollTop})),[2]}))}))},o.prototype._mouseEnter=function(e){this._sidebar.element.then((function(t){t.alwaysExpand||(t._mouseLeaveTimeout&&(clearTimeout(t._mouseLeaveTimeout),t._mouseLeaveTimeout=void 0),t._showTooltip(e.currentTarget))}))},o.prototype._mouseLeave=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return this._sidebar.element.then((function(e){e._mouseLeaveTimeout&&clearTimeout(e._mouseLeaveTimeout),e._mouseLeaveTimeout=window.setTimeout((function(){e._hideTooltip()}),500)})),[2]}))}))},o.prototype._mouseClick=function(e,o){return t(this,void 0,void 0,(function(){var t,r,i,a,c,s,l,u,d;return n(this,(function(n){switch(t=o.currentTarget,r="#"===t.getAttribute(Ve.HREF),i=t.getAttribute(Ve.PANEL),r&&(o.preventDefault(),o.stopImmediatePropagation()),e.action){case me.CALL_SERVICE:a=e.service,c=e.data,s=void 0===c?{}:c,3===(null==(l=a.match(Rt))?void 0:l.length)?this._ha.hass.callService(l[1],l[2],s):console.warn("".concat(we,' ignoring "').concat(me.CALL_SERVICE,'" action in "').concat(i,'" item. The service parameter is malfomed.'));break;case me.JAVASCRIPT:u=e.code,d=u.includes("return")?u:"".concat(u,"\n;return;"),this._renderer.renderTemplate(d)}return[2]}))}))},o.prototype._checkProfileEditableButton=function(){return t(this,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:return[4,this._partialPanelResolver.element];case 1:return e=n.sent(),"/profile/general"!==e.__route.path?[3,3]:[4,this._partialPanelResolver.selector.query(He.EDIT_SIDEBAR_BUTTON).element];case 2:(t=n.sent())&&(!1===this._isSidebarEditable?t.setAttribute(Ve.DISABLED,""):t.removeAttribute(Ve.DISABLED)),n.label=3;case 3:return[2]}}))}))},o.prototype._panelLoaded=function(){return t(this,void 0,void 0,(function(){var e,t,o,r,i;return n(this,(function(n){switch(n.label){case 0:return[4,this._partialPanelResolver.element];case 1:return e=n.sent(),t=e.__route.path,[4,this._sidebar.selector.$.query(Pe.PAPER_LISTBOX).element];case 2:return o=n.sent(),r=o.querySelector("\n ".concat(He.SCOPE," > ").concat(He.ITEM,'[href="').concat(t,'"],\n ').concat(He.SCOPE," > ").concat(He.ITEM,'[href="').concat(t,'/dashboard"]\n ')),i=r?null:this._items.reduce((function(e,n){var o=n.getAttribute(Ve.HREF);return t.startsWith(o)&&(!e||o.length>e.getAttribute(Ve.HREF).length)&&(e=n),e}),null),this._items.forEach((function(e){var t=r&&r===e||!r&&i===e;e.classList.toggle(Ue.IRON_SELECTED,t),e.setAttribute(Ve.ARIA_SELECTED,"".concat(t))})),o.scrollTop!==this._sidebarScroll&&(o.scrollTop=this._sidebarScroll),this._checkProfileEditableButton(),[2]}}))}))},o.prototype._process=function(){var e=this;this._homeAssistant.element.then((function(t){e._ha=t,new ve(e._ha).getRenderer().then((function(t){e._renderer=t,e._getConfig().then((function(){e._renderer.variables=e._parseJavaScriptVariables(),e._processDefaultPath(),e._processSidebar(),e._subscribeTitle(),e._subscribeSideBarEdition(),e._rearrange()}))}))}))},o}();window.CustomSidebar||(console.info("%c≡ ".concat(we.toUpperCase()," (YAML)%cv").concat("8.4.1"),"font-weight: bold; background: #EEEEEE; color: #666666; padding: 2px 5px;","font-weight: normal; background: #E87A24; color: #FFFFFF; padding: 2px 5px"),window.CustomSidebar=new _i)}(); +!function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<])(".concat(Object.values(se).join("|"),")($|[ \\?)+:\\}\\]><.])"),"gm"),this._scopped=pe(e,o,i),this._watchForPanelUrlChange(),this._watchForEntitiesChange()}return e.prototype._executeRenderingFunctions=function(e){var t=this;this._subscriptions.get(e).forEach((function(e,n){e.forEach((function(e){t.trackTemplate(n,e)}))}))},e.prototype._watchForPanelUrlChange=function(){var e=this;window.addEventListener(le.LOCATION_CHANGED,(function(t){e._panelUrlWatchCallback()})),window.addEventListener(le.POPSTATE,(function(){e._panelUrlWatchCallback()}))},e.prototype._panelUrlWatchCallback=function(){this._subscriptions.has(se.PANEL_URL)&&this._executeRenderingFunctions(se.PANEL_URL)},e.prototype._watchForEntitiesChange=function(){var e=this;window.hassConnection.then((function(t){t.conn.subscribeMessage((function(t){return e._entityWatchCallback(t)}),{type:le.SUBSCRIBE_EVENTS,event_type:le.STATE_CHANGE_EVENT})}))},e.prototype._entityWatchCallback=function(e){if(this._subscriptions.size){var t=e.data.entity_id;this._subscriptions.has(t)&&this._executeRenderingFunctions(t)}},e.prototype._storeTracked=function(e,t){var n=this;this._scopped.tracked.forEach((function(o){if(n._subscriptions.has(o)){var r=n._subscriptions.get(o);if(r.has(e)){var i=r.get(e);i.has(t)||i.add(t)}else r.set(e,new Set([t]))}else n._subscriptions.set(o,new Map([[e,new Set([t])]]))}))},e.prototype._untrackTemplate=function(e,t){var n=this;this._subscriptions.forEach((function(o,r){if(o.has(e)){var i=o.get(e);i.has(t)&&i.delete(t),0===i.size&&(o.delete(e),0===o.size&&n._subscriptions.delete(r))}}))},e.prototype.renderTemplate=function(e){try{var t=new Map(Object.entries(this._variables)),n=e.trim().replace(this._clientSideEntitiesRegExp,"$1clientSide.$2$3"),o=n.includes("return")||!this._autoReturn?n:"return ".concat(n);return(new(Function.bind.apply(Function,ie(ie([void 0,"hass","states","is_state","state_attr","is_state_attr","has_value","entities","entity_prop","is_entity_prop","devices","device_attr","is_device_attr","device_id","areas","area_id","area_name","area_entities","area_devices","user_name","user_is_admin","user_is_owner","user_agent","clientSide","ref","unref"],Array.from(t.keys()),!1),["".concat('"use strict";'," ").concat(o)],!1)))).apply(void 0,ie([this._scopped.hass,this._scopped.states,this._scopped.is_state.bind(this._scopped),this._scopped.state_attr.bind(this._scopped),this._scopped.is_state_attr.bind(this._scopped),this._scopped.has_value.bind(this._scopped),this._scopped.entities,this._scopped.entity_prop,this._scopped.is_entity_prop.bind(this._scopped),this._scopped.devices,this._scopped.device_attr.bind(this._scopped),this._scopped.is_device_attr.bind(this._scopped),this._scopped.device_id.bind(this._scopped),this._scopped.areas.bind(this._scopped),this._scopped.area_id.bind(this._scopped),this._scopped.area_name.bind(this._scopped),this._scopped.area_entities.bind(this._scopped),this._scopped.area_devices.bind(this._scopped),this._scopped.user_name,this._scopped.user_is_admin,this._scopped.user_is_owner,this._scopped.user_agent,this._scopped.clientSideProxy,this._scopped.ref.bind(this._scopped,this._entityWatchCallback.bind(this)),this._scopped.unref.bind(this._scopped,this.cleanTracked.bind(this))],Array.from(t.values()),!1))}catch(e){if(this._throwErrors)throw e;return void(this._throwWarnings&&console.warn(e))}},e.prototype.trackTemplate=function(e,t){var n=this;this._scopped.cleanTracked();var o=this.renderTemplate(e);return this._storeTracked(e,t),t(o),function(){return n._untrackTemplate(e,t)}},e.prototype.cleanTracked=function(e){e?this._subscriptions.has(e)&&this._subscriptions.delete(e):this._subscriptions.clear()},Object.defineProperty(e.prototype,"variables",{get:function(){return this._variables},set:function(e){this._variables=e},enumerable:!1,configurable:!0}),e}(),Te=function(){function e(e,t){void 0===t&&(t={}),this._renderer=r((function(){return e.hass}),(function(e){return!!(e&&e.areas&&e.devices&&e.entities&&e.states&&e.user)}),{retries:100,delay:50,rejectMessage:"The provided element doesn't contain a proper or initialised hass object"}).then((function(){return new Ie(e,t)}))}return e.prototype.getRenderer=function(){return this._renderer},e}(),ve=/([A-Z])([a-z0-9_-]+)/g,be=function(e){return Object.entries(e).map((function(e){var t=e[0],n=e[1];return"".concat(function(e){return e.replace(ve,(function(e,t,n,o){var r=t.toLocaleLowerCase();return o?"-".concat(r).concat(n):"--".concat(r).concat(n)}))}(t),":").concat(n)})).join(";")+";"},ge=function(e){return(Array.isArray(e)?e:[e]).map((function(e){return"string"==typeof e?e:Object.entries(e).map((function(e){var t=e[0],n=e[1];return!1===n?"".concat(t,"{display: none !important}"):"".concat(t,"{").concat(be(n),"}")})).join("")})).join("")},ye=function(e,t){return"".concat(t,"_").concat(e)},Ne=function(e){return e instanceof ShadowRoot?e.host.localName:e.localName},Re=function(e,t){var n=ye(Ne(e),t);return e.querySelector("#".concat(n))},Ce=function(){function e(e){var t,n,o;void 0===e&&(e={}),this._prefix=null!==(t=e.prefix)&&void 0!==t?t:"ha-styles-manager",this._namespace=null!==(n=e.namespace)&&void 0!==n?n:"home-assistant-styles-manager",this._throwWarnings=null===(o=e.throwWarnings)||void 0===o||o}return e.prototype.getStyleElement=function(e){return Re(e,this._prefix)},e.prototype.addStyle=function(e,t){!function(e,t,n,o,r){if(t){var i=Re(t,n);if(!i){var a=ye(Ne(t),n);(i=document.createElement("style")).setAttribute("id",a),t.appendChild(i)}i.innerHTML="string"==typeof e?e:ge(e)}else r&&console.warn("".concat(o,': no element has been provided calling "addStyle"'))}(e,t,this._prefix,this._namespace,this._throwWarnings)},e.prototype.removeStyle=function(e){!function(e,t,n,o){if(e){var r=Re(e,t);r?r.remove():o&&console.warn("".concat(n,': no style to remove calling "removeStyle"'))}else o&&console.warn("".concat(n,': no element has been provided calling "removeStyle"'))}(e,this._prefix,this._namespace,this._throwWarnings)},e}();!function(e){e.HIDDEN="hidden",e.NARROW="narrow",e.EXTENDED="extended"}(he||(he={})),function(e){e.DOCKED="docked",e.AUTO="auto",e.ALWAYS_HIDDEN="always_hidden"}(Ee||(Ee={})),function(e){e.AND="AND",e.OR="OR"}(Oe||(Oe={})),function(e){e.TEXT="text",e.DATA_PANEL="data-panel",e.HREF="href"}(Ae||(Ae={})),function(e){e.CALL_SERVICE="call-service",e.JAVASCRIPT="javascript"}(me||(me={}));var Se,Le,we="custom-sidebar",De="sidebar-config",xe="".concat("/local/").concat(De),Me="base";!function(e){e.BOOLEAN="boolean",e.STRING="string",e.UNDEFINED="undefined",e.NUMBER="number"}(Le||(Le={}));var Pe,He,Fe,Be,ke,je="[object Object]",Ge="data-blocked";!function(e){e.SIDEBAR="ha-sidebar",e.PAPER_LISTBOX="paper-listbox",e.PAPER_ICON_ITEM="paper-icon-item",e.HA_SVG_ICON="ha-svg-icon",e.HA_ICON="ha-icon",e.HA_ICON_BUTTON="ha-icon-button"}(Pe||(Pe={})),function(e){e.HOST=":host",e.HOST_EXPANDED=":host([expanded])",e.SCOPE=":scope",e.TITLE=".title",e.ITEM='a[role="option"]',e.ITEM_SELECTED=".iron-selected",e.ITEM_HOVER='a[role="option"]:hover',e.SPACER=".spacer",e.ITEM_TEXT=".item-text",e.NOTIFICATION_BADGE=".notification-badge",e.NOTIFICATIONS_BADGE_COLLAPSED=".notification-badge-collapsed",e.CONFIGURATION_BADGE=".configuration-badge",e.HA_MENU_BUTTON="ha-panel-lovelace$ hui-root$ .toolbar > ha-menu-button",e.EDIT_SIDEBAR_BUTTON="ha-panel-profile ha-profile-section-general$ ha-settings-row mwc-button",e.SIDEBAR_NOTIFICATIONS_CONTAINER=".notifications-container",e.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER=".notifications-container:hover",e.SIDEBAR_NOTIFICATIONS=".notifications",e.PROFILE=".profile",e.MENU=".menu",e.DIVIDER=".divider",e.MC_DRAWER=".mdc-drawer",e.HA_SCROLLBAR=".ha-scrollbar",e.DATA_INFO="[data-info]"}(He||(He={})),function(e){e.AFTER="::after",e.BEFORE="::before",e.WEBKIT_SCROLLBAR_THUMB="::-webkit-scrollbar-thumb"}(Fe||(Fe={})),function(e){e.PRIMARY_BACKGROUND_COLOR="--primary-background-color",e.SIDEBAR_BACKGROUND_COLOR="--sidebar-background-color",e.SIDEBAR_TITLE_COLOR="--sidebar-menu-button-text-color",e.SIDEBAR_BUTTON_COLOR="--sidebar-icon-color",e.SIDEBAR_MENU_BUTTON_BACKGROUND_COLOR="--sidebar-menu-button-background-color",e.SIDEBAR_ICON_COLOR="--sidebar-icon-color",e.SIDEBAR_SELECTED_ICON_COLOR="--sidebar-selected-icon-color",e.SIDEBAR_TEXT_COLOR="--sidebar-text-color",e.SIDEBAR_SELECTED_TEXT_COLOR="--sidebar-selected-text-color",e.ACCENT_COLOR="--accent-color",e.TEXT_ACCENT_COLOR="--text-accent-color",e.TEXT_PRIMARY_COLOR="--text-primary-color",e.PRIMARY_TEXT_COLOR="--primary-text-color",e.DIVIDER_COLOR="--divider-color",e.SCROLLBAR_THUMB_COLOR="--scrollbar-thumb-color"}(Be||(Be={})),function(e){e.BACKGROUND="--custom-sidebar-background",e.BORDER_COLOR="--custom-sidebar-border-color",e.MENU_BACKGROUND="--custom-sidebar-menu-background",e.TITLE_COLOR="--custom-sidebar-title-color",e.SUBTITLE_COLOR="--custom-sidebar-subtitle-color",e.BUTTON_COLOR="--custom-sidebar-button-color",e.DIVIDER_COLOR="--custom-sidebar-divider-color",e.DIVIDER_TOP_COLOR="--custom-sidebar-divider-top-color",e.DIVIDER_BOTTOM_COLOR="--custom-sidebar-divider-bottom-color",e.SCROLLBAR_THUMB_COLOR="--custom-sidebar-scrollbar-thumb-color",e.ITEM_BACKGROUND="--custom-sidebar-item-background",e.ITEM_BACKGROUND_HOVER="--custom-sidebar-item-background-hover",e.ICON_COLOR="--custom-sidebar-icon-color",e.ICON_COLOR_SELECTED="--custom-sidebar-icon-color-selected",e.ICON_COLOR_HOVER="--custom-sidebar-icon-color-hover",e.TEXT_COLOR="--custom-sidebar-text-color",e.TEXT_COLOR_SELECTED="--custom-sidebar-text-color-selected",e.TEXT_COLOR_HOVER="--custom-sidebar-text-color-hover",e.SELECTION_BACKGROUND="--custom-sidebar-selection-background",e.SELECTION_OPACITY="--custom-sidebar-selection-opacity",e.INFO_COLOR="--custom-sidebar-info-color",e.INFO_COLOR_SELECTED="--custom-sidebar-info-color-selected",e.INFO_COLOR_HOVER="--custom-sidebar-info-color-hover",e.NOTIFICATION_COLOR="--custom-sidebar-notification-color",e.NOTIFICATION_COLOR_SELECTED="--custom-sidebar-notification-color-selected",e.NOTIFICATION_COLOR_HOVER="--custom-sidebar-notification-color-hover",e.NOTIFICATION_TEXT_COLOR="--custom-sidebar-notification-text-color",e.NOTIFICATION_TEXT_COLOR_SELECTED="--custom-sidebar-notification-text-color-selected",e.NOTIFICATION_TEXT_COLOR_HOVER="--custom-sidebar-notification-text-color-hover"}(ke||(ke={}));var Ue,Ve,Xe,We,qe,Ke=["item_background","item_background_hover","icon_color","icon_color_selected","icon_color_hover","text_color","text_color_selected","text_color_hover","selection_background","info_color","info_color_selected","info_color_hover","notification_color","notification_color_selected","notification_color_hover","notification_text_color","notification_text_color_selected","notification_text_color_hover","divider_color"],Ye=["selection_opacity"],$e=[["item_background",ke.ITEM_BACKGROUND],["item_background_hover",ke.ITEM_BACKGROUND_HOVER],["icon_color",ke.ICON_COLOR],["icon_color_selected",ke.ICON_COLOR_SELECTED],["icon_color_hover",ke.ICON_COLOR_HOVER],["text_color",ke.TEXT_COLOR],["text_color_selected",ke.TEXT_COLOR_SELECTED],["text_color_hover",ke.TEXT_COLOR_HOVER],["selection_background",ke.SELECTION_BACKGROUND],["selection_opacity",ke.SELECTION_OPACITY],["info_color",ke.INFO_COLOR],["info_color_selected",ke.INFO_COLOR_SELECTED],["info_color_hover",ke.INFO_COLOR_HOVER],["notification_color",ke.NOTIFICATION_COLOR],["notification_color_selected",ke.NOTIFICATION_COLOR_SELECTED],["notification_color_hover",ke.NOTIFICATION_COLOR_HOVER],["notification_text_color",ke.NOTIFICATION_TEXT_COLOR],["notification_text_color_selected",ke.NOTIFICATION_TEXT_COLOR_SELECTED],["notification_text_color_hover",ke.NOTIFICATION_TEXT_COLOR_HOVER],["divider_color",ke.DIVIDER_COLOR]],Je=o([["title_color",ke.TITLE_COLOR],["subtitle_color",ke.SUBTITLE_COLOR],["sidebar_button_color",ke.BUTTON_COLOR],["sidebar_background",ke.BACKGROUND],["menu_background",ke.MENU_BACKGROUND],["scrollbar_thumb_color",ke.SCROLLBAR_THUMB_COLOR],["divider_top_color",ke.DIVIDER_TOP_COLOR],["divider_bottom_color",ke.DIVIDER_BOTTOM_COLOR]],$e,!0);!function(e){e.NOTIFICATIONS_BADGE="notification-badge",e.NOTIFICATIONS_BADGE_COLLAPSED="notification-badge-collapsed",e.IRON_SELECTED="iron-selected"}(Ue||(Ue={})),function(e){e.PANEL="data-panel",e.ROLE="role",e.PROCESSED="data-processed",e.WITH_NOTIFICATION="data-notification",e.WITH_DIVIDER="data-divider",e.ARIA_SELECTED="aria-selected",e.ARIA_DISABLED="aria-disabled",e.DISABLED="disabled",e.HREF="href",e.STYLE="style"}(Ve||(Ve={})),function(e){e.CLICK="click",e.MOUSEDOWN="mousedown",e.MOUSEENTER="mouseenter",e.MOUSELEAVE="mouseleave",e.KEYDOWN="keydown",e.HASS_EDIT_SIDEBAR="hass-edit-sidebar",e.RENDER_TEMPLATE="render_template",e.LOCATION_CHANGED="location-changed"}(Xe||(Xe={})),function(e){e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.TAB="Tab"}(We||(We={})),function(e){e.PAPER_ICON_ITEM="PAPER-ICON-ITEM",e.A="A"}(qe||(qe={}));var ze,Qe,Ze,et,tt,nt,ot,rt,it,at,ct,st,lt,ut,dt,ft,_t,pt,ht,Et,Ot,At,mt,It,Tt,vt=["HOME-ASSISTANT","HOME-ASSISTANT-MAIN","HA-SIDEBAR"],bt=((Se={})[he.HIDDEN]=Ee.ALWAYS_HIDDEN,Se[he.NARROW]=Ee.AUTO,Se[he.EXTENDED]=Ee.DOCKED,Se),gt="/profile",yt=/^\s*\[\[\[([\s\S]+)\]\]\]\s*$/,Nt=/\{\{[\s\S]*\}\}|\{%[\s\S]*%\}/,Rt=/@partial\s+([\w-]+)/g,Ct=/^\s*([a-z_]+)\.([\w-]+)\s*$/,St=/^\s*ref\(([\s\S]*)\)\s*$/,Lt=function(e){return Array.isArray(e)?e.map((function(e){return e.toLowerCase()})):e.toLowerCase().split(/\s*,\s*/)},wt=function(){return new Promise((function(e){setTimeout(e,1)}))},Dt=o(o([],Ke,!0),Ye,!0),xt=["id","exceptions","extendable_configs","extend_from","user","not_user","device","not_device","is_admin"],Mt=["js_variables","jinja_variables","partials"],Pt=function(){function t(e,t,n){var o;this._config=e,this._extendable=new Map(Object.entries(null!==(o=this._config.extendable_configs)&&void 0!==o?o:[])),this._user=t,this._userAgent=n,this._exceptions=this._getExceptions(),this._buildFlattenConfig()}return t.prototype._getExceptions=function(){var e=this;if(this._config.exceptions){var t=this._user.name.toLocaleLowerCase();return this._config.exceptions.filter((function(n){var o,r=null!==(o=n.matchers_conditions)&&void 0!==o?o:Oe.OR,i=void 0!==n.user&&Lt(n.user).includes(t),a=void 0!==n.not_user&&!Lt(n.not_user).includes(t),c=void 0!==n.device&&Lt(n.device).some((function(t){return e._userAgent.includes(t)})),s=void 0!==n.not_device&&!Lt(n.not_device).some((function(t){return e._userAgent.includes(t)})),l=void 0!==n.is_admin&&n.is_admin===e._user.is_admin,u=void 0!==n.is_owner&&n.is_owner===e._user.is_owner;return r===Oe.OR?i||a||c||s||l||u:(void 0===n.user||i)&&(void 0===n.not_user||a)&&(void 0===n.device||c)&&(void 0===n.not_device||s)&&(void 0===n.is_admin||l)&&(void 0===n.is_owner||u)}))}return[]},t.prototype._mergeConfigs=function(){for(var t=[],n=0;n ")," > ").concat(r));return Ht(t[r].trim(),t,o(o([],n,!0),[r],!1))}return console.warn("".concat(we,": partial ").concat(r," doesn't exist")),""}))},Ft=function(){for(var e=[],t=0;t ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={maxWidth:"calc(100% - 100px)"},ze["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={display:"flex",flexDirection:"column",gap:"5px",lineHeight:"1"},ze["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT).concat(Fe.AFTER)]={content:"attr(data-info)",display:"none",fontSize:"11px",lineHeight:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ze["{ SELECTOR.HOST_EXPANDED } ".concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.NOTIFICATIONS_BADGE_COLLAPSED)]={opacity:"0"},ze["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM).concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={zIndex:"1"},ze["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.NOTIFICATION_BADGE,":not(").concat(He.NOTIFICATIONS_BADGE_COLLAPSED,")")]=e({left:"calc(var(--app-drawer-width, 248px) - 22px)",maxWidth:"80px",transform:"translateX(-100%)"},Bt),ze["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.NOTIFICATIONS_BADGE_COLLAPSED)]=e({bottom:"14px",left:"26px",maxWidth:"20px"},Bt),ze["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.CONFIGURATION_BADGE)]=e({},Bt),ze),jt=((Qe={})["".concat(He.HOST," ").concat(He.MENU," > ").concat(He.TITLE)]={color:Ft(ke.TITLE_COLOR,Be.SIDEBAR_TITLE_COLOR,Be.PRIMARY_TEXT_COLOR)},Qe),Gt=((Ze={})["".concat(He.HOST," ").concat(He.MENU," > ").concat(He.TITLE).concat(Fe.AFTER)]={content:"attr(data-subtitle)",color:Ft(ke.SUBTITLE_COLOR,ke.TITLE_COLOR,Be.SIDEBAR_TITLE_COLOR,Be.PRIMARY_TEXT_COLOR),display:"block",fontSize:"12px",lineHeight:"1.5"},Ze),Ut=((et={})["".concat(He.HOST," ").concat(He.MENU," > ").concat(Pe.HA_ICON_BUTTON)]={color:Ft(ke.BUTTON_COLOR,Be.SIDEBAR_ICON_COLOR)},et),Vt=((tt={})[He.HOST]={background:Ft(ke.BACKGROUND,Be.SIDEBAR_BACKGROUND_COLOR)+" !important"},tt),Xt=((nt={})["".concat(He.HOST," ").concat(He.MENU)]={background:Ft(ke.MENU_BACKGROUND,ke.BACKGROUND,Be.SIDEBAR_MENU_BUTTON_BACKGROUND_COLOR,Be.PRIMARY_BACKGROUND_COLOR),borderBottomColor:Ft(ke.DIVIDER_TOP_COLOR,ke.DIVIDER_COLOR,Be.DIVIDER_COLOR),borderBottomStyle:"solid",borderBottomWidth:"1px"},nt),Wt=((ot={})["".concat(He.HOST," ").concat(He.DIVIDER).concat(Fe.BEFORE)]={backgroundColor:Ft(ke.DIVIDER_BOTTOM_COLOR,ke.DIVIDER_COLOR,Be.DIVIDER_COLOR)},ot),qt=((rt={})["".concat(He.HOST," > ").concat(He.MC_DRAWER)]={borderColor:Ft(ke.BORDER_COLOR,Be.DIVIDER_COLOR,"rgba(0,0,0,.12)")},rt),Kt=((it={})["".concat(He.HOST," ").concat(Pe.PAPER_LISTBOX).concat(He.HA_SCROLLBAR)]={scrollbarColor:Ft(ke.SCROLLBAR_THUMB_COLOR,Be.SCROLLBAR_THUMB_COLOR)+" transparent"},it["".concat(He.HOST," ").concat(Pe.PAPER_LISTBOX).concat(He.HA_SCROLLBAR).concat(Fe.WEBKIT_SCROLLBAR_THUMB)]={background:Ft(ke.SCROLLBAR_THUMB_COLOR,Be.SCROLLBAR_THUMB_COLOR)},it),Yt=((at={})["".concat(He.MENU,"[").concat(Ge,"]")]={pointerEvents:"none"},at["".concat(He.MENU,"[").concat(Ge,"] > ").concat(Pe.HA_ICON_BUTTON)]={pointerEvents:"all"},at),$t=((ct={})["".concat(He.HOST," ").concat(He.ITEM,":not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM)]={background:Ft(ke.ITEM_BACKGROUND,"none")},ct),Jt=((st={})["".concat(He.HOST," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM)]={background:Ft(ke.ITEM_BACKGROUND_HOVER,ke.ITEM_BACKGROUND,"none")},st),zt=((lt={})["".concat(He.HOST," ").concat(He.ITEM,"[").concat(Ve.WITH_DIVIDER,"]")]={borderBottom:"1px solid",borderBottomColor:Ft(ke.DIVIDER_COLOR,Be.DIVIDER_COLOR),marginBottom:"10px",paddingBottom:"10px"},lt),Qt=((ut={})["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(Pe.HA_SVG_ICON,", ").concat(Pe.HA_ICON,")")]={color:Ft(ke.ICON_COLOR,Be.SIDEBAR_ICON_COLOR)},ut),Zt=((dt={})["".concat(He.HOST," ").concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(Pe.HA_SVG_ICON,", ").concat(Pe.HA_ICON,")")]={color:Ft(ke.ICON_COLOR_SELECTED,Be.SIDEBAR_SELECTED_ICON_COLOR)},dt),en=((ft={})["".concat(He.HOST," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(Pe.HA_SVG_ICON,", ").concat(Pe.HA_ICON,")")]={color:Ft(ke.ICON_COLOR_HOVER,ke.ICON_COLOR,Be.SIDEBAR_ICON_COLOR)},ft),tn=((_t={})["".concat(He.HOST," ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={color:Ft(ke.TEXT_COLOR,Be.SIDEBAR_TEXT_COLOR)},_t),nn=((pt={})["".concat(He.HOST," ").concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={color:Ft(ke.TEXT_COLOR_SELECTED,Be.SIDEBAR_SELECTED_TEXT_COLOR)},pt),on=((ht={})["".concat(He.HOST," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT)]={color:Ft(ke.TEXT_COLOR_HOVER,ke.TEXT_COLOR,Be.SIDEBAR_TEXT_COLOR)},ht),rn=((Et={})["".concat(He.HOST," :is(").concat(He.ITEM,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER,") > ").concat(Pe.PAPER_ICON_ITEM).concat(Fe.BEFORE)]={background:Ft(ke.SELECTION_BACKGROUND,ke.ICON_COLOR_SELECTED,Be.SIDEBAR_SELECTED_ICON_COLOR),opacity:Ft(ke.SELECTION_OPACITY,"0.12")},Et),an=((Ot={})["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT).concat(He.DATA_INFO).concat(Fe.AFTER)]={color:Ft(ke.INFO_COLOR,Be.SIDEBAR_TEXT_COLOR),display:"block"},Ot),cn=((At={})["".concat(He.HOST_EXPANDED," ").concat(Pe.PAPER_LISTBOX," > ").concat(He.ITEM).concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT).concat(He.DATA_INFO).concat(Fe.AFTER)]={color:Ft(ke.INFO_COLOR_SELECTED,Be.SIDEBAR_SELECTED_TEXT_COLOR)},At),sn=((mt={})["".concat(He.HOST_EXPANDED," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM," > ").concat(He.ITEM_TEXT).concat(He.DATA_INFO).concat(Fe.AFTER)]={color:Ft(ke.INFO_COLOR_HOVER,ke.INFO_COLOR,Be.SIDEBAR_TEXT_COLOR)},mt),ln=((It={})["".concat(He.HOST," ").concat(He.ITEM_SELECTED," > ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(He.NOTIFICATION_BADGE,", ").concat(He.CONFIGURATION_BADGE,")")]={backgroundColor:Ft(ke.NOTIFICATION_COLOR_SELECTED,ke.NOTIFICATION_COLOR,Be.ACCENT_COLOR),color:Ft(ke.NOTIFICATION_TEXT_COLOR_SELECTED,ke.NOTIFICATION_TEXT_COLOR,Be.TEXT_ACCENT_COLOR,Be.TEXT_PRIMARY_COLOR)},It),un=((Tt={})["".concat(He.HOST," :is(").concat(He.ITEM_HOVER,", ").concat(He.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER,"):not(").concat(He.ITEM_SELECTED,") > ").concat(Pe.PAPER_ICON_ITEM," > :is(").concat(He.NOTIFICATION_BADGE,", ").concat(He.CONFIGURATION_BADGE,")")]={backgroundColor:Ft(ke.NOTIFICATION_COLOR_HOVER,ke.NOTIFICATION_COLOR,Be.ACCENT_COLOR),color:Ft(ke.NOTIFICATION_TEXT_COLOR_HOVER,ke.NOTIFICATION_TEXT_COLOR,Be.TEXT_ACCENT_COLOR,Be.TEXT_PRIMARY_COLOR)},Tt);function dn(e){return null==e}var fn={isNothing:dn,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:dn(e)?[]:[e]},repeat:function(e,t){var n,o="";for(n=0;nc&&(t=o-c+(i=" ... ").length),n-o>c&&(n=o+c-(a=" ...").length),{str:i+e.slice(t,n).replace(/\t/g,"→")+a,pos:o-t+i.length}}function On(e,t){return fn.repeat(" ",t-e.length)+e}var An=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,o=/\r?\n|\r|\0/g,r=[0],i=[],a=-1;n=o.exec(e.buffer);)i.push(n.index),r.push(n.index+n[0].length),e.position<=n.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var c,s,l="",u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)s=En(e.buffer,r[a-c],i[a-c],e.position-(r[a]-r[a-c]),d),l=fn.repeat(" ",t.indent)+On((e.line-c+1).toString(),u)+" | "+s.str+"\n"+l;for(s=En(e.buffer,r[a],i[a],e.position,d),l+=fn.repeat(" ",t.indent)+On((e.line+1).toString(),u)+" | "+s.str+"\n",l+=fn.repeat("-",t.indent+u+3+s.pos)+"^\n",c=1;c<=t.linesAfter&&!(a+c>=i.length);c++)s=En(e.buffer,r[a+c],i[a+c],e.position-(r[a]-r[a+c]),d),l+=fn.repeat(" ",t.indent)+On((e.line+c+1).toString(),u)+" | "+s.str+"\n";return l.replace(/\n$/,"")},mn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],In=["scalar","sequence","mapping"];var Tn=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===mn.indexOf(t))throw new hn('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===In.indexOf(this.kind))throw new hn('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function vn(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,o){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=o)})),n[t]=e})),n}function bn(e){return this.extend(e)}bn.prototype.extend=function(e){var t=[],n=[];if(e instanceof Tn)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new hn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof Tn))throw new hn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new hn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new hn("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof Tn))throw new hn("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var o=Object.create(bn.prototype);return o.implicit=(this.implicit||[]).concat(t),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=vn(o,"implicit"),o.compiledExplicit=vn(o,"explicit"),o.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function o(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Pn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Hn=/^[-+]?[0-9]+e/;var Fn=new Tn("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Pn.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||fn.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(fn.isNegativeZero(e))return"-0.0";return n=e.toString(10),Hn.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),Bn=Cn.extend({implicit:[Sn,Ln,Mn,Fn]}),kn=Bn,jn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Gn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var Un=new Tn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==jn.exec(e)||null!==Gn.exec(e))},construct:function(e){var t,n,o,r,i,a,c,s,l=0,u=null;if(null===(t=jn.exec(e))&&(t=Gn.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],o=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,o,r));if(i=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),s=new Date(Date.UTC(n,o,r,i,a,c,l)),u&&s.setTime(s.getTime()-u),s},instanceOf:Date,represent:function(e){return e.toISOString()}});var Vn=new Tn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),Xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var Wn=new Tn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,o=0,r=e.length,i=Xn;for(n=0;n64)){if(t<0)return!1;o+=6}return o%8==0},construct:function(e){var t,n,o=e.replace(/[\r\n=]/g,""),r=o.length,i=Xn,a=0,c=[];for(t=0;t>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|i.indexOf(o.charAt(t));return 0===(n=r%4*6)?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===n?(c.push(a>>10&255),c.push(a>>2&255)):12===n&&c.push(a>>4&255),new Uint8Array(c)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,o="",r=0,i=e.length,a=Xn;for(t=0;t>18&63],o+=a[r>>12&63],o+=a[r>>6&63],o+=a[63&r]),r=(r<<8)+e[t];return 0===(n=i%3)?(o+=a[r>>18&63],o+=a[r>>12&63],o+=a[r>>6&63],o+=a[63&r]):2===n?(o+=a[r>>10&63],o+=a[r>>4&63],o+=a[r<<2&63],o+=a[64]):1===n&&(o+=a[r>>2&63],o+=a[r<<4&63],o+=a[64],o+=a[64]),o}}),qn=Object.prototype.hasOwnProperty,Kn=Object.prototype.toString;var Yn=new Tn("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,o,r,i,a=[],c=e;for(t=0,n=c.length;t>10),56320+(e-65536&1023))}for(var go=new Array(256),yo=new Array(256),No=0;No<256;No++)go[No]=vo(No)?1:0,yo[No]=vo(No);function Ro(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Zn,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Co(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=An(n),new hn(t,n)}function So(e,t){throw Co(e,t)}function Lo(e,t){e.onWarning&&e.onWarning.call(null,Co(e,t))}var wo={YAML:function(e,t,n){var o,r,i;null!==e.version&&So(e,"duplication of %YAML directive"),1!==n.length&&So(e,"YAML directive accepts exactly one argument"),null===(o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&So(e,"ill-formed argument of the YAML directive"),r=parseInt(o[1],10),i=parseInt(o[2],10),1!==r&&So(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&Lo(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var o,r;2!==n.length&&So(e,"TAG directive accepts exactly two arguments"),o=n[0],r=n[1],fo.test(o)||So(e,"ill-formed tag handle (first argument) of the TAG directive"),eo.call(e.tagMap,o)&&So(e,'there is a previously declared suffix for "'+o+'" tag handle'),_o.test(r)||So(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){So(e,"tag prefix is malformed: "+r)}e.tagMap[o]=r}};function Do(e,t,n,o){var r,i,a,c;if(t1&&(e.result+=fn.repeat("\n",t-1))}function ko(e,t){var n,o,r=e.tag,i=e.anchor,a=[],c=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),o=e.input.charCodeAt(e.position);0!==o&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,So(e,"tab characters must not be used in indentation")),45===o)&&Oo(e.input.charCodeAt(e.position+1));)if(c=!0,e.position++,Ho(e,!0,-1)&&e.lineIndent<=t)a.push(null),o=e.input.charCodeAt(e.position);else if(n=e.line,Uo(e,t,oo,!1,!0),a.push(e.result),Ho(e,!0,-1),o=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==o)So(e,"bad indentation of a sequence entry");else if(e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt)&&(O&&(a=e.line,c=e.lineStart,s=e.position),Uo(e,t,ro,!0,r)&&(O?h=e.result:E=e.result),O||(Mo(e,f,_,p,h,E,a,c,s),p=h=E=null),Ho(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&0!==l)So(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?So(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?So(e,"repeat of an indentation width identifier"):(l=t+r-1,s=!0)}if(Eo(i)){do{i=e.input.charCodeAt(++e.position)}while(Eo(i));if(35===i)do{i=e.input.charCodeAt(++e.position)}while(!ho(i)&&0!==i)}for(;0!==i;){for(Po(e),e.lineIndent=0,i=e.input.charCodeAt(e.position);(!s||e.lineIndentl&&(l=e.lineIndent),ho(i))u++;else{if(e.lineIndent0){for(r=a,i=0;r>0;r--)(a=mo(c=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+a:So(e,"expected hexadecimal character");e.result+=bo(i),e.position++}else So(e,"unknown escape sequence");n=o=e.position}else ho(c)?(Do(e,n,o,!0),Bo(e,Ho(e,!1,t)),n=o=e.position):e.position===e.lineStart&&Fo(e)?So(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}So(e,"unexpected end of the stream within a double quoted scalar")}(e,f)?E=!0:!function(e){var t,n,o;if(42!==(o=e.input.charCodeAt(e.position)))return!1;for(o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!Oo(o)&&!Ao(o);)o=e.input.charCodeAt(++e.position);return e.position===t&&So(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),eo.call(e.anchorMap,n)||So(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],Ho(e,!0,-1),!0}(e)?function(e,t,n){var o,r,i,a,c,s,l,u,d=e.kind,f=e.result;if(Oo(u=e.input.charCodeAt(e.position))||Ao(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(Oo(o=e.input.charCodeAt(e.position+1))||n&&Ao(o)))return!1;for(e.kind="scalar",e.result="",r=i=e.position,a=!1;0!==u;){if(58===u){if(Oo(o=e.input.charCodeAt(e.position+1))||n&&Ao(o))break}else if(35===u){if(Oo(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Fo(e)||n&&Ao(u))break;if(ho(u)){if(c=e.line,s=e.lineStart,l=e.lineIndent,Ho(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=i,e.line=c,e.lineStart=s,e.lineIndent=l;break}}a&&(Do(e,r,i,!1),Bo(e,e.line-c),r=i=e.position,a=!1),Eo(u)||(i=e.position+1),u=e.input.charCodeAt(++e.position)}return Do(e,r,i,!1),!!e.result||(e.kind=d,e.result=f,!1)}(e,f,to===n)&&(E=!0,null===e.tag&&(e.tag="?")):(E=!0,null===e.tag&&null===e.anchor||So(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===p&&(E=c&&ko(e,_))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&So(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),s=0,l=e.implicitTypes.length;s"),null!==e.result&&d.kind!==e.kind&&So(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):So(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||E}function Vo(e){var t,n,o,r,i=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(Ho(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!Oo(r);)r=e.input.charCodeAt(++e.position);for(o=[],(n=e.input.slice(t,e.position)).length<1&&So(e,"directive name must not be less than one character in length");0!==r;){for(;Eo(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!ho(r));break}if(ho(r))break;for(t=e.position;0!==r&&!Oo(r);)r=e.input.charCodeAt(++e.position);o.push(e.input.slice(t,e.position))}0!==r&&Po(e),eo.call(wo,n)?wo[n](e,n,o):Lo(e,'unknown document directive "'+n+'"')}Ho(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,Ho(e,!0,-1)):a&&So(e,"directives end mark is expected"),Uo(e,e.lineIndent-1,ro,!1,!0),Ho(e,!0,-1),e.checkLineBreaks&&lo.test(e.input.slice(i,e.position))&&Lo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Fo(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Ho(e,!0,-1)):e.position=55296&&o<=56319&&t+1=56320&&n<=57343?1024*(o-55296)+n-56320+65536:o}function xr(e){return/^\n* /.test(e)}var Mr=1,Pr=2,Hr=3,Fr=4,Br=5;function kr(e,t,n,o,r,i,a,c){var s,l=0,u=null,d=!1,f=!1,_=-1!==o,p=-1,h=function(e){return Sr(e)&&e!==Yo&&!Cr(e)&&e!==cr&&e!==dr&&e!==sr&&e!==ar&&e!==_r&&e!==pr&&e!==Er&&e!==Ar&&e!==tr&&e!==or&&e!==ir&&e!==Zo&&e!==Or&&e!==lr&&e!==ur&&e!==rr&&e!==er&&e!==nr&&e!==fr&&e!==hr}(Dr(e,0))&&function(e){return!Cr(e)&&e!==sr}(Dr(e,e.length-1));if(t||a)for(s=0;s=65536?s+=2:s++){if(!Sr(l=Dr(e,s)))return Br;h=h&&wr(l,u,c),u=l}else{for(s=0;s=65536?s+=2:s++){if((l=Dr(e,s))===Jo)d=!0,_&&(f=f||s-p-1>o&&" "!==e[p+1],p=s);else if(!Sr(l))return Br;h=h&&wr(l,u,c),u=l}f=f||_&&s-p-1>o&&" "!==e[p+1]}return d||f?n>9&&xr(e)?Br:a?i===gr?Br:Pr:f?Fr:Hr:!h||a||r(e)?i===gr?Br:Pr:Mr}function jr(e,t,n,o,r){e.dump=function(){if(0===t.length)return e.quotingType===gr?'""':"''";if(!e.noCompatMode&&(-1!==Ir.indexOf(t)||Tr.test(t)))return e.quotingType===gr?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),c=o||e.flowLevel>-1&&n>=e.flowLevel;switch(kr(t,c,e.indent,a,(function(t){return function(e,t){var n,o;for(n=0,o=e.implicitTypes.length;n"+Gr(t,e.indent)+Ur(Nr(function(e,t){var n,o,r=/(\n+)([^\n]*)/g,i=(c=e.indexOf("\n"),c=-1!==c?c:e.length,r.lastIndex=c,Vr(e.slice(0,c),t)),a="\n"===e[0]||" "===e[0];var c;for(;o=r.exec(e);){var s=o[1],l=o[2];n=" "===l[0],i+=s+(a||n||""===l?"":"\n")+Vr(l,t),a=n}return i}(t,a),i));case Br:return'"'+function(e){for(var t,n="",o=0,r=0;r=65536?r+=2:r++)o=Dr(e,r),!(t=mr[o])&&Sr(o)?(n+=e[r],o>=65536&&(n+=e[r+1])):n+=t||vr(o);return n}(t)+'"';default:throw new hn("impossible error: invalid scalar style")}}()}function Gr(e,t){var n=xr(e)?String(t):"",o="\n"===e[e.length-1];return n+(o&&("\n"===e[e.length-2]||"\n"===e)?"+":o?"":"-")+"\n"}function Ur(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Vr(e,t){if(""===e||" "===e[0])return e;for(var n,o,r=/ [^ ]/g,i=0,a=0,c=0,s="";n=r.exec(e);)(c=n.index)-i>t&&(o=a>i?a:c,s+="\n"+e.slice(i,o),i=o+1),a=c;return s+="\n",e.length-i>t&&a>i?s+=e.slice(i,a)+"\n"+e.slice(a+1):s+=e.slice(i),s.slice(1)}function Xr(e,t,n,o){var r,i,a,c="",s=e.tag;for(r=0,i=n.length;r tag resolver accepts not "'+s+'" style');o=c.represent[s](t,s)}e.dump=o}return!0}return!1}function qr(e,t,n,o,r,i,a){e.tag=null,e.dump=n,Wr(e,n,!1)||Wr(e,n,!0);var c,s=qo.call(e.dump),l=o;o&&(o=e.flowLevel<0||e.flowLevel>t);var u,d,f="[object Object]"===s||"[object Array]"===s;if(f&&(d=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||d||2!==e.indent&&t>0)&&(r=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===s)o&&0!==Object.keys(e.dump).length?(!function(e,t,n,o){var r,i,a,c,s,l,u="",d=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new hn("sortKeys must be a boolean or a function");for(r=0,i=f.length;r1024)&&(e.dump&&Jo===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,s&&(l+=Rr(e,t)),qr(e,t+1,c,!0,s)&&(e.dump&&Jo===e.dump.charCodeAt(0)?l+=":":l+=": ",u+=l+=e.dump));e.tag=d,e.dump=u||"{}"}(e,t,e.dump,r),d&&(e.dump="&ref_"+u+e.dump)):(!function(e,t,n){var o,r,i,a,c,s="",l=e.tag,u=Object.keys(n);for(o=0,r=u.length;o1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),qr(e,t,a,!1,!1)&&(s+=c+=e.dump));e.tag=l,e.dump="{"+s+"}"}(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===s)o&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?Xr(e,t-1,e.dump,r):Xr(e,t,e.dump,r),d&&(e.dump="&ref_"+u+e.dump)):(!function(e,t,n){var o,r,i,a="",c=e.tag;for(o=0,r=n.length;o",e.dump=c+" "+e.dump)}return!0}function Kr(e,t){var n,o,r=[],i=[];for(Yr(e,r,i),n=0,o=i.length;n ")," > ").concat(e,'"'));if(e===Me)throw new SyntaxError("".concat(zr,', error in extendable config "').concat(n[0],'": "entend_from" can only be "base" in exceptions'));if(!(e in t.extendable_configs))throw new SyntaxError("".concat(zr,', error in "').concat(n[n.length-1],'": "').concat(e,'" doesn\'t exist in "extendable_configs"'));ci(t.extendable_configs[e].extend_from,t,o(o([],n,!0),[e],!1))}))},si=function(e,t){Zr.forEach((function(n){if(n in e)throw new SyntaxError("".concat(t,' "').concat(n,'" option can only be placed in the main config'))}))},li=function(e,t,n){if("string"==typeof t&&(yt.test(t)||Nt.test(t)))console.warn('"'.concat(e,'" property should not have templates. "').concat(n.join(" > "),'" seems to be a template'));else if(typeof t!==Le.STRING&&typeof t!==Le.NUMBER&&typeof t!==Le.BOOLEAN)if(Array.isArray(t))t.forEach((function(t,r){li(e,t,o(o([],n,!0),["[".concat(r,"]")],!1))}));else{if(Object.prototype.toString.call(t)!==je)throw new SyntaxError("".concat(zr,', "').concat(e,": ").concat(n.join(" > "),'" has a wrong type ').concat(Object.prototype.toString.call(t)));var r=t;Object.entries(r).forEach((function(t){var r=t[0],i=t[1];li(e,i,o(o([],n,!0),[r],!1))}))}},ui=function(e,t){if(typeof t!==Le.UNDEFINED){if(Object.prototype.toString.call(t)!==je)throw new SyntaxError("".concat(zr,', "').concat(e,'" property should be an object'));Object.entries(t).forEach((function(t){var n=t[0],o=t[1];li(e,o,[n])}))}},di=function(e,t){if(typeof e!==Le.UNDEFINED){if(!Array.isArray(e))throw new SyntaxError("".concat(zr,", exceptions should be an array"));e.forEach((function(e){!function(e,t){var n;if(si(e,"".concat(zr,", exceptions")),ei(e,o([],Qr,!0),"".concat(zr,", exceptions")),ti(e,o([],Ye,!0),"".concat(zr,", exceptions")),ri([["user",e.user],["not_user",e.not_user],["device",e.device],["not_device",e.not_device],["extend_from",e.extend_from]],"".concat(zr,", exceptions")),ai(e.extend_from,t,"".concat(zr,", error in exception:"),!0),typeof e.matchers_conditions!==Le.UNDEFINED&&e.matchers_conditions!==Oe.AND&&e.matchers_conditions!==Oe.OR)throw new SyntaxError("".concat(zr,', exceptions "matchers_conditions" property should be "').concat(Oe.AND,'" or "').concat(Oe.OR,'"'));if(typeof e.order!==Le.UNDEFINED&&!Array.isArray(e.order))throw new SyntaxError("".concat(zr,', exceptions "order" property should be an array'));if(oi(e,["sidebar_editable"],"".concat(zr,", exceptions")),ni(e,["hide_all","is_admin","is_owner"],"".concat(zr,", exceptions")),typeof e.sidebar_mode!==Le.UNDEFINED&&!(e.sidebar_mode in bt))throw new SyntaxError("".concat(zr,', exceptions "sidebar_mode" property should be ').concat(he.HIDDEN,", ").concat(he.NARROW," or ").concat(he.EXTENDED));if(e.user&&e.not_user)throw new SyntaxError("".concat(zr,', exceptions "user" and "not_user" properties cannot be used together'));if(e.device&&e.not_device)throw new SyntaxError("".concat(zr,', exceptions "device" and "not_device" properties cannot be used together'));null===(n=e.order)||void 0===n||n.forEach(fi)}(e,t)}))}},fi=function(e){if(si(e,"".concat(zr," in ").concat(e.item,",")),!e.item)throw new SyntaxError("".concat(zr,', every item in an "order" array should have an "item" property'));if(ei(e,o(["item","info"],Ke,!0),"".concat(zr," in ").concat(e.item,",")),ti(e,o([],Ye,!0),"".concat(zr," in ").concat(e.item,",")),oi(e,["hide"],"".concat(zr," in ").concat(e.item,",")),ni(e,["divider"],"".concat(zr," in ").concat(e.item,",")),function(e,t){if(typeof e.on_click!==Le.UNDEFINED){if(Object.prototype.toString.call(e.on_click)!==je)throw new SyntaxError("".concat(t,' "on_click" property should be an object'));if(typeof e.on_click.action!==Le.STRING)throw new SyntaxError("".concat(t,' the "action" parameter should be a string'));if(!Object.values(me).includes(e.on_click.action))throw new SyntaxError("".concat(t,' the "action" parameter should be one of these values: ').concat(Object.values(me).join(", ")));if(e.on_click.action===me.CALL_SERVICE){if(typeof e.on_click.service!==Le.STRING)throw new SyntaxError("".concat(t,' the "service" parameter should be a string'));if(typeof e.on_click.data!==Le.UNDEFINED&&Object.prototype.toString.call(e.on_click.data)!==je)throw new SyntaxError("".concat(t,' the "data" parameter needs to be an object'))}if(e.on_click.action===me.JAVASCRIPT&&typeof e.on_click.code!==Le.STRING)throw new SyntaxError("".concat(t,' the "code" parameter should be a string'))}}(e,"".concat(zr," in ").concat(e.item,",")),e.new_item){if(ei(e,["href","icon"],"".concat(zr," in ").concat(e.item,",")),!e.href&&!e.on_click)throw new SyntaxError("".concat(zr," in ").concat(e.item,', if you set "new_item" as "true", it is necessary an "href" or an "on_click "property'));if(!e.icon)throw new SyntaxError("".concat(zr," in ").concat(e.item,', if you set "new_item" as "true", "icon" property is necessary'))}},_i=function(e){var t;if(ei(e,o([],Qr,!0),"".concat(zr,",")),ri([["extend_from",e.extend_from]],"".concat(zr,",")),ai(e.extend_from,e,"".concat(zr,", error in main config:")),function(e){e.extendable_configs&&Object.entries(e.extendable_configs).forEach((function(t){var n=t[0],o=t[1];ci(o.extend_from,e,[n])}))}(e),ti(e,o([],Ye,!0),"".concat(zr,",")),oi(e,["sidebar_editable"],"".concat(zr,",")),ni(e,["hide_all"],"".concat(zr,",")),typeof e.sidebar_mode!==Le.UNDEFINED&&!(e.sidebar_mode in bt))throw new SyntaxError("".concat(zr,', "sidebar_mode" property should be ').concat(he.HIDDEN,", ").concat(he.NARROW," or ").concat(he.EXTENDED));if(typeof e.order!==Le.UNDEFINED&&!Array.isArray(e.order))throw new SyntaxError("".concat(zr,', "order" property should be an array'));if(typeof e.partials!==Le.UNDEFINED){if(Object.prototype.toString.call(e.partials)!==je)throw new SyntaxError("".concat(zr,', "partials" property should be an object'));Object.entries(e.partials).forEach((function(e){var t=e[0];if(typeof e[1]!==Le.STRING)throw new SyntaxError("".concat(zr,', "partials" should be an object with strings. The partial ').concat(t," is not a string"))}))}ui("js_variables",e.js_variables),ui("jinja_variables",e.jinja_variables),null===(t=e.order)||void 0===t||t.forEach(fi),di(e.exceptions,e)},pi=function(){return t(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(n){return e="".concat(we,": YAML config file not found."),t="Make sure you have valid config in /config/www/".concat(De,".yaml file."),[2,new Promise((function(n){fetch("".concat(xe,".yaml?hash=").concat(Math.random().toString(16).slice(2))).then((function(o){if(!o.ok)throw Error("".concat(e,"\n").concat(t));o.text().then((function(e){return Jr.load(e)})).then((function(e){var o;(null===(o=e.id)||void 0===o?void 0:o.startsWith("example_yaml"))&&console.warn("".concat(we,": You seem to be using the example configuration.\n").concat(t)),_i(e),n(e)})).catch((function(e){throw Error("".concat(we,": ").concat((null==e?void 0:e.message)||e))}))})).catch((function(){throw Error("".concat(e,"\n").concat(t))}))}))]}))}))},hi=function(){function o(){var e=this;this._parseJavaScriptVariables=function(){var t,n=null!==(t=e._config.js_variables)&&void 0!==t?t:{},o=Object.entries(n).filter((function(t){var n=t[0],o=t[1];if("string"==typeof o&&St.test(o)){var r=o.replace(St,"$1");return e._renderer.renderTemplate("\n const myRef = ref('".concat(n,"');\n myRef.value = ").concat(r,";\n return;\n ")),!1}return!0}));return Object.fromEntries(o)};var t=new re;t.addEventListener(H.ON_LISTEN,(function(t){e._homeAssistant=t.detail.HOME_ASSISTANT,e._main=t.detail.HOME_ASSISTANT_MAIN,e._haDrawer=t.detail.HA_DRAWER,e._sidebar=t.detail.HA_SIDEBAR,e._partialPanelResolver=t.detail.PARTIAL_PANEL_RESOLVER}),{once:!0}),t.addEventListener(H.ON_PANEL_LOAD,this._panelLoaded.bind(this)),t.listen(),this._styleManager=new Ce({prefix:we,namespace:we,throwWarnings:!1}),this._items=[],this._sidebarScroll=0,this._isSidebarEditable=void 0,this._itemTouchedBinded=this._itemTouched.bind(this),this._mouseEnterBinded=this._mouseEnter.bind(this),this._mouseLeaveBinded=this._mouseLeave.bind(this),this._configPromise=pi(),this._process()}return o.prototype._getConfig=function(){return t(this,void 0,void 0,(function(){var e,t=this;return n(this,(function(n){switch(n.label){case 0:return e=this,[4,this._configPromise.then((function(e){return function(e,t,n){return new Pt(n,e,t).config}(t._ha.hass.user,navigator.userAgent.toLowerCase(),e)}))];case 1:return e._config=n.sent(),[2]}}))}))},o.prototype._getElements=function(){return t(this,void 0,void 0,(function(){var e,t,o,i;return n(this,(function(n){switch(n.label){case 0:return e={retries:100,delay:50,shouldReject:!1},[4,this._sidebar.selector.$.query(Pe.PAPER_LISTBOX).element];case 1:return t=n.sent(),[4,r((function(){return t.querySelector(":scope > ".concat(He.SPACER))}),(function(e){return!!e}),e)];case 2:return o=n.sent(),[4,r((function(){return t.querySelectorAll(":scope > ".concat(He.ITEM))}),(function(e){return Array.from(e).every((function(e){return e.querySelector(He.ITEM_TEXT).innerText.trim().length>0}))}),e)];case 3:return i=n.sent(),[2,[t,i,o]]}}))}))},o.prototype._hideAnchor=function(e,t){t?e.style.display="none":e.style.removeProperty("display")},o.prototype._buildNewItem=function(e){var t=document.createElement("a");return t.href=e.href?e.href:"#",t.target=e.target||"",t.tabIndex=-1,t.setAttribute(Ve.ROLE,"option"),t.setAttribute(Ve.PANEL,e.item.toLowerCase().replace(/\s+/,"-")),t.setAttribute(Ve.ARIA_SELECTED,"false"),t.innerHTML='\n \n \n \n ').concat(e.item,'\n \n \n \n ').trim(),t},o.prototype._getTemplateString=function(e){return t(this,void 0,void 0,(function(){var t,o;return n(this,(function(n){switch(n.label){case 0:return t="",e instanceof Promise||"string"==typeof e||"number"==typeof e&&!Number.isNaN(e)||"boolean"==typeof e||"object"==typeof e?"string"!=typeof e?[3,1]:(t=e.trim(),[3,6]):[3,6];case 1:return"number"!=typeof e&&"boolean"!=typeof e?[3,2]:(t=e.toString(),[3,6]);case 2:return e instanceof Promise?[4,e]:[3,5];case 3:return o=n.sent(),[4,this._getTemplateString(o)];case 4:return t=n.sent(),[3,6];case 5:t=JSON.stringify(e),n.label=6;case 6:return[2,t]}}))}))},o.prototype._subscribeTitle=function(){var e=this;this._sidebar.selector.$.query(He.TITLE).element.then((function(t){e._config.title&&e._subscribeTemplate(e._config.title,(function(e){t.innerHTML=e})),e._config.subtitle&&e._subscribeTemplate(e._config.subtitle,(function(e){t.dataset.subtitle=e}))}))},o.prototype._subscribeSideBarEdition=function(){var e=this,t=function(e){e.preventDefault(),e.stopImmediatePropagation()},n=function(e,n){e.removeEventListener(Xe.HASS_EDIT_SIDEBAR,t,!0),n.removeAttribute(Ge)},o=function(e,n){e.removeEventListener(Xe.HASS_EDIT_SIDEBAR,t,!0),e.addEventListener(Xe.HASS_EDIT_SIDEBAR,t,!0),n.setAttribute(Ge,"")};Promise.all([this._main.element,this._sidebar.selector.$.query(He.MENU).element]).then((function(t){var r=t[0],i=t[1];"boolean"==typeof e._config.sidebar_editable&&(e._isSidebarEditable=e._config.sidebar_editable,e._isSidebarEditable||o(r,i)),"string"==typeof e._config.sidebar_editable&&e._subscribeTemplate(e._config.sidebar_editable,(function(t){"true"===t||"false"===t?(e._isSidebarEditable=!("false"===t),e._isSidebarEditable?n(r,i):o(r,i)):(e._isSidebarEditable=void 0,n(r,i)),e._checkProfileEditableButton()}))}))},o.prototype._subscribeName=function(e,t){var n=e.querySelector(He.ITEM_TEXT);this._subscribeTemplate(t,(function(e){n.innerHTML=e}))},o.prototype._subscribeIcon=function(e,t){this._subscribeTemplate(t,(function(t){var n=e.querySelector(Pe.HA_ICON);if(!n){(n=document.createElement(Pe.HA_ICON)).setAttribute("slot","item-icon");var o=e.querySelector(Pe.HA_SVG_ICON);o?o.replaceWith(n):e.querySelector(Pe.PAPER_ICON_ITEM).prepend(n)}n.setAttribute("icon",t)}))},o.prototype._subscribeInfo=function(e,t){var n=e.querySelector(He.ITEM_TEXT);this._subscribeTemplate(t,(function(e){n.dataset.info=e}))},o.prototype._subscribeNotification=function(e,t){var n=e.querySelector("".concat(He.NOTIFICATION_BADGE,":not(").concat(He.NOTIFICATIONS_BADGE_COLLAPSED,")")),o=e.querySelector(He.NOTIFICATIONS_BADGE_COLLAPSED);n||((n=document.createElement("span")).classList.add(Ue.NOTIFICATIONS_BADGE),e.querySelector(Pe.PAPER_ICON_ITEM).append(n)),o||((o=document.createElement("span")).classList.add(Ue.NOTIFICATIONS_BADGE,Ue.NOTIFICATIONS_BADGE_COLLAPSED),e.querySelector("".concat(Pe.HA_SVG_ICON,", ").concat(Pe.HA_ICON)).after(o));this._subscribeTemplate(t,(function(t){t.length?(n.innerHTML=t,o.innerHTML=t,e.setAttribute(Ve.WITH_NOTIFICATION,"true")):(n.innerHTML="",o.innerHTML="",e.removeAttribute(Ve.WITH_NOTIFICATION))}))},o.prototype._subscribeHide=function(e,t){var n=this;"boolean"==typeof t?this._hideAnchor(e,t):this._subscribeTemplate(t,(function(t){n._hideAnchor(e,"true"===t)}))},o.prototype._subscribeTemplateColorChanges=function(e,t,n){var o=this;n.forEach((function(n){var r=n[0],i=n[1];e[r]&&o._subscribeTemplate(e[r],(function(e){t.style.setProperty(i,e)}))}))},o.prototype._subscribeTemplate=function(e,t){yt.test(e)?this._createJsTemplateSubscription(e.replace(yt,"$1"),t):Nt.test(e)?this._createJinjaTemplateSubscription(e,t):this._getTemplateString(e).then((function(e){t(e)}))},o.prototype._createJsTemplateSubscription=function(e,t){var n=this;this._renderer.trackTemplate(Ht(e,this._config.partials),(function(e){n._getTemplateString(e).then((function(e){t(e)}))}))},o.prototype._createJinjaTemplateSubscription=function(t,n){var o=this;window.hassConnection.then((function(r){r.conn.subscribeMessage((function(e){n("".concat(e.result))}),{type:Xe.RENDER_TEMPLATE,template:Ht(t,o._config.partials),variables:e({user_name:o._ha.hass.user.name,user_is_admin:o._ha.hass.user.is_admin,user_is_owner:o._ha.hass.user.is_owner,user_agent:window.navigator.userAgent},o._config.jinja_variables)})}))},o.prototype._focusItem=function(e,t,n){var o=this._items.length,r="none",i=0;if(t)for(var a=(l=e+1)+o,c=l;co-1?c-o:c;if(this._items[s].style.display!==r){i=s;break}}else{var l;for(a=(l=e-1)-o,c=l;c>a;c--){s=c<0?o+c:c;if(this._items[s].style.display!==r){i=s;break}}}n?this._items[i].querySelector(Pe.PAPER_ICON_ITEM).focus():(this._items[i].focus(),this._items[i].tabIndex=0)},o.prototype._focusItemByKeyboard=function(e,t){var n=e.querySelector("\n ".concat(He.SCOPE," > ").concat(He.ITEM,":not(.").concat(Ue.IRON_SELECTED,"):focus,\n ").concat(He.SCOPE," > ").concat(He.ITEM,":focus,\n ").concat(He.SCOPE," > ").concat(He.ITEM,":has(> ").concat(Pe.PAPER_ICON_ITEM,":focus)\n ")),o=0;this._items.forEach((function(e,t){e===n&&(o=t),e.tabIndex=-1})),this._focusItem(o,t,!1)},o.prototype._focusItemByTab=function(e,t,n){if(t.nodeName===qe.A){var o=t,r=this._items.indexOf(o),i=this._items.length-1;if(n&&r0)this._focusItem(r,n,!0);else(n?e.querySelector(He.SIDEBAR_NOTIFICATIONS):e.querySelector(Pe.HA_ICON_BUTTON)).focus()}else{if(n)e.querySelector("".concat(He.PROFILE," > ").concat(Pe.PAPER_ICON_ITEM)).focus();else this._focusItem(0,n,!0)}},o.prototype._getActivePaperIconElement=function(e){void 0===e&&(e=document);var t=e.activeElement;return t?t instanceof HTMLElement&&(t.nodeName===qe.PAPER_ICON_ITEM||t.nodeName===qe.A&&"option"===t.getAttribute("role"))?t:t.shadowRoot&&vt.includes(t.nodeName)?this._getActivePaperIconElement(t.shadowRoot):null:null},o.prototype._processDefaultPath=function(){var e,t=this._config.default_path;if(t)if(t.startsWith("/")){var n=[null,"",t];(e=window.history).replaceState.apply(e,n),window.dispatchEvent(new CustomEvent(Xe.LOCATION_CHANGED,{detail:{replace:t}}))}else console.warn("".concat(we,': ignoring default_path property as it doesn\'t start with "/".'))},o.prototype._processSidebar=function(){var e=this;Promise.all([this._main.element,this._partialPanelResolver.element]).then((function(o){var r=o[0],i=o[1],a=e._config.sidebar_mode,c=matchMedia("(max-width: 870px)");if(a){r.hass.dockedSidebar=bt[a];var s=function(o){return t(e,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return a===he.HIDDEN?[3,5]:[4,wt()];case 1:return e.sent(),r.narrow=!1,[4,wt()];case 2:return e.sent(),i.narrow=o,[4,wt()];case 3:return e.sent(),o?[4,this._partialPanelResolver.selector.query(He.HA_MENU_BUTTON).element]:[3,5];case 4:e.sent().narrow=!1,e.label=5;case 5:return[2]}}))}))};c.addEventListener("change",(function(e){s(e.matches)})),s(c.matches)}})),Promise.all([this._haDrawer.selector.$.query(He.MC_DRAWER).element,this._sidebar.element,this._sidebar.selector.$.element,this._sidebar.selector.$.query(Pe.PAPER_LISTBOX).element]).then((function(t){var n=t[0],o=t[1],r=t[2],i=t[3];e._subscribeTemplateColorChanges(e._config,o,Je),e._subscribeTemplateColorChanges(e._config,n,[["sidebar_border_color",ke.BORDER_COLOR]]),i.addEventListener(Xe.KEYDOWN,(function(t){t.key!==We.ARROW_DOWN&&t.key!==We.ARROW_UP||(t.preventDefault(),t.stopImmediatePropagation(),e._focusItemByKeyboard(i,t.key===We.ARROW_DOWN))}),!0),window.addEventListener(Xe.KEYDOWN,(function(t){if(t.key===We.TAB){var n=e._getActivePaperIconElement();if(n)if(n.nodeName===qe.PAPER_ICON_ITEM){var o=n.parentElement;o.getAttribute(Ve.HREF)!==gt&&(t.preventDefault(),t.stopImmediatePropagation(),e._focusItemByTab(r,o,!t.shiftKey))}else n.getAttribute(Ve.HREF)!==gt&&(t.preventDefault(),t.stopImmediatePropagation(),e._focusItemByTab(r,n,!t.shiftKey))}}),!0),e._styleManager.addStyle(qt,n),e._styleManager.addStyle([kt,jt,Gt,Ut,Vt,Xt,Wt,Kt,Yt,$t,Jt,zt,Qt,Zt,en,tn,nn,on,rn,an,cn,sn,ln,un,e._config.styles||""],r)}))},o.prototype._rearrange=function(){var t=this;this._getElements().then((function(n){var o=t._config,r=o.order,i=o.hide_all,a=n[0],c=n[1],s=n[2],l=0,u=!1;t._items=Array.from(c);var d=new Set;i&&t._items.forEach((function(e){t._hideAnchor(e,!0)}));var f=r.reduce((function(n,o){var r=o.item,i=o.match,a=o.exact,c=o.new_item,s=r.toLocaleLowerCase(),l=c?void 0:t._items.find((function(e){var t=i===Ae.DATA_PANEL?e.getAttribute(Ve.PANEL):i===Ae.HREF?e.getAttribute(Ve.HREF):e.querySelector(He.ITEM_TEXT).innerText.trim();return!((!a||r!==t)&&(a||!(null==t?void 0:t.toLowerCase().includes(s))))&&(!d.has(e)&&(d.add(e),!0))}));return l&&l.setAttribute(Ve.PROCESSED,"true"),(c||l)&&n.push(e(e({},o),{element:l})),c||l||console.warn("".concat(we,": you have an order item in your configuration that didn't match any sidebar item: \"").concat(r,'"')),n}),[]),_=function(){u||(t._items.forEach((function(e){e.hasAttribute(Ve.PROCESSED)||(e.style.order="".concat(l))})),l++,s.style.order="".concat(l),l++,u=!0)};f.forEach((function(e){if(e.bottom&&_(),e.new_item){var n=t._buildNewItem(e);a.append(n),e.element=n,e.element.setAttribute(Ve.PROCESSED,"true"),t._items.push(e.element)}else if(e.element){var o=e.element;e.href&&(o.href=e.href),e.target&&(o.target=e.target)}e.element.style.order="".concat(l),e.divider&&e.element.setAttribute(Ve.WITH_DIVIDER,"true"),e.name&&t._subscribeName(e.element,e.name),e.icon&&t._subscribeIcon(e.element,e.icon),e.info&&t._subscribeInfo(e.element,e.info),e.notification&&t._subscribeNotification(e.element,e.notification),void 0!==e.hide&&t._subscribeHide(e.element,e.hide),t._subscribeTemplateColorChanges(e,e.element,$e),e.new_item&&(e.element.addEventListener(Xe.MOUSEENTER,t._mouseEnterBinded),e.element.addEventListener(Xe.MOUSELEAVE,t._mouseLeaveBinded)),e.element.addEventListener(Xe.MOUSEDOWN,t._itemTouchedBinded),e.element.addEventListener(Xe.KEYDOWN,(function(e){e.key===We.ENTER&&t._itemTouchedBinded()})),e.on_click&&e.element.addEventListener(Xe.CLICK,t._mouseClick.bind(t,e.on_click),!0),l++})),f.length&&_(),t._items.sort((function(e,t){return+e.style.order-+t.style.order})),t._panelLoaded()}))},o.prototype._itemTouched=function(){return t(this,void 0,void 0,(function(){var e=this;return n(this,(function(t){return this._sidebar.selector.$.query(Pe.PAPER_LISTBOX).element.then((function(t){e._sidebarScroll=t.scrollTop})),[2]}))}))},o.prototype._mouseEnter=function(e){this._sidebar.element.then((function(t){t.alwaysExpand||(t._mouseLeaveTimeout&&(clearTimeout(t._mouseLeaveTimeout),t._mouseLeaveTimeout=void 0),t._showTooltip(e.currentTarget))}))},o.prototype._mouseLeave=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return this._sidebar.element.then((function(e){e._mouseLeaveTimeout&&clearTimeout(e._mouseLeaveTimeout),e._mouseLeaveTimeout=window.setTimeout((function(){e._hideTooltip()}),500)})),[2]}))}))},o.prototype._mouseClick=function(e,o){return t(this,void 0,void 0,(function(){var t,r,i,a,c,s,l,u,d;return n(this,(function(n){switch(t=o.currentTarget,r="#"===t.getAttribute(Ve.HREF),i=t.getAttribute(Ve.PANEL),r&&(o.preventDefault(),o.stopImmediatePropagation()),e.action){case me.CALL_SERVICE:a=e.service,c=e.data,s=void 0===c?{}:c,3===(null==(l=a.match(Ct))?void 0:l.length)?this._ha.hass.callService(l[1],l[2],s):console.warn("".concat(we,' ignoring "').concat(me.CALL_SERVICE,'" action in "').concat(i,'" item. The service parameter is malfomed.'));break;case me.JAVASCRIPT:u=e.code,d=u.includes("return")?u:"".concat(u,"\n;return;"),this._renderer.renderTemplate(d)}return[2]}))}))},o.prototype._checkProfileEditableButton=function(){return t(this,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:return[4,this._partialPanelResolver.element];case 1:return e=n.sent(),"/profile/general"!==e.__route.path?[3,3]:[4,this._partialPanelResolver.selector.query(He.EDIT_SIDEBAR_BUTTON).element];case 2:(t=n.sent())&&(!1===this._isSidebarEditable?t.setAttribute(Ve.DISABLED,""):t.removeAttribute(Ve.DISABLED)),n.label=3;case 3:return[2]}}))}))},o.prototype._panelLoaded=function(){return t(this,void 0,void 0,(function(){var e,t,o,r,i;return n(this,(function(n){switch(n.label){case 0:return[4,this._partialPanelResolver.element];case 1:return e=n.sent(),t=e.__route.path,[4,this._sidebar.selector.$.query(Pe.PAPER_LISTBOX).element];case 2:return o=n.sent(),r=o.querySelector("\n ".concat(He.SCOPE," > ").concat(He.ITEM,'[href="').concat(t,'"],\n ').concat(He.SCOPE," > ").concat(He.ITEM,'[href="').concat(t,'/dashboard"]\n ')),i=r?null:this._items.reduce((function(e,n){var o=n.getAttribute(Ve.HREF);return t.startsWith(o)&&(!e||o.length>e.getAttribute(Ve.HREF).length)&&(e=n),e}),null),this._items.forEach((function(e){var t=r&&r===e||!r&&i===e;e.classList.toggle(Ue.IRON_SELECTED,t),e.setAttribute(Ve.ARIA_SELECTED,"".concat(t))})),o.scrollTop!==this._sidebarScroll&&(o.scrollTop=this._sidebarScroll),this._checkProfileEditableButton(),[2]}}))}))},o.prototype._process=function(){var e=this;this._homeAssistant.element.then((function(t){e._ha=t,new Te(e._ha).getRenderer().then((function(t){e._renderer=t,e._getConfig().then((function(){e._renderer.variables=e._parseJavaScriptVariables(),e._processDefaultPath(),e._processSidebar(),e._subscribeTitle(),e._subscribeSideBarEdition(),e._rearrange()}))}))}))},o}();window.CustomSidebar||(console.info("%c≡ ".concat(we.toUpperCase()," (YAML)%cv").concat("8.4.1"),"font-weight: bold; background: #EEEEEE; color: #666666; padding: 2px 5px;","font-weight: normal; background: #E87A24; color: #FFFFFF; padding: 2px 5px"),window.CustomSidebar=new hi)}(); diff --git a/dist/custom-sidebar.js b/dist/custom-sidebar.js index 4c68573..eaeaac9 100644 --- a/dist/custom-sidebar.js +++ b/dist/custom-sidebar.js @@ -1 +1 @@ -!function(){"use strict";var o,e,t,O,r,i;"function"==typeof SuppressedError&&SuppressedError,function(o){o.HIDDEN="hidden",o.NARROW="narrow",o.EXTENDED="extended"}(o||(o={})),function(o){o.DOCKED="docked",o.AUTO="auto",o.ALWAYS_HIDDEN="always_hidden"}(e||(e={})),function(o){o.AND="AND",o.OR="OR"}(t||(t={})),function(o){o.TEXT="text",o.DATA_PANEL="data-panel",o.HREF="href"}(O||(O={})),function(o){o.CALL_SERVICE="call-service",o.JAVASCRIPT="javascript"}(r||(r={}));var c,_,E,n,a,T;!function(o){o.BOOLEAN="boolean",o.STRING="string",o.UNDEFINED="undefined",o.NUMBER="number"}(c||(c={})),function(o){o.SIDEBAR="ha-sidebar",o.PAPER_LISTBOX="paper-listbox",o.PAPER_ICON_ITEM="paper-icon-item",o.HA_SVG_ICON="ha-svg-icon",o.HA_ICON="ha-icon",o.HA_ICON_BUTTON="ha-icon-button"}(_||(_={})),function(o){o.HOST=":host",o.HOST_EXPANDED=":host([expanded])",o.SCOPE=":scope",o.TITLE=".title",o.ITEM='a[role="option"]',o.ITEM_SELECTED=".iron-selected",o.ITEM_HOVER='a[role="option"]:hover',o.SPACER=".spacer",o.ITEM_TEXT=".item-text",o.NOTIFICATION_BADGE=".notification-badge",o.NOTIFICATIONS_BADGE_COLLAPSED=".notification-badge-collapsed",o.CONFIGURATION_BADGE=".configuration-badge",o.HA_MENU_BUTTON="ha-panel-lovelace$ hui-root$ .toolbar > ha-menu-button",o.EDIT_SIDEBAR_BUTTON="ha-panel-profile ha-profile-section-general$ ha-settings-row mwc-button",o.SIDEBAR_NOTIFICATIONS_CONTAINER=".notifications-container",o.SIDEBAR_NOTIFICATIONS_CONTAINER_HOVER=".notifications-container:hover",o.SIDEBAR_NOTIFICATIONS=".notifications",o.PROFILE=".profile",o.MENU=".menu",o.DIVIDER=".divider",o.MC_DRAWER=".mdc-drawer",o.HA_SCROLLBAR=".ha-scrollbar",o.DATA_INFO="[data-info]"}(E||(E={})),function(o){o.AFTER="::after",o.BEFORE="::before",o.WEBKIT_SCROLLBAR_THUMB="::-webkit-scrollbar-thumb"}(n||(n={})),function(o){o.PRIMARY_BACKGROUND_COLOR="--primary-background-color",o.SIDEBAR_BACKGROUND_COLOR="--sidebar-background-color",o.SIDEBAR_TITLE_COLOR="--sidebar-menu-button-text-color",o.SIDEBAR_BUTTON_COLOR="--sidebar-icon-color",o.SIDEBAR_MENU_BUTTON_BACKGROUND_COLOR="--sidebar-menu-button-background-color",o.SIDEBAR_ICON_COLOR="--sidebar-icon-color",o.SIDEBAR_SELECTED_ICON_COLOR="--sidebar-selected-icon-color",o.SIDEBAR_TEXT_COLOR="--sidebar-text-color",o.SIDEBAR_SELECTED_TEXT_COLOR="--sidebar-selected-text-color",o.ACCENT_COLOR="--accent-color",o.TEXT_ACCENT_COLOR="--text-accent-color",o.TEXT_PRIMARY_COLOR="--text-primary-color",o.PRIMARY_TEXT_COLOR="--primary-text-color",o.DIVIDER_COLOR="--divider-color",o.SCROLLBAR_THUMB_COLOR="--scrollbar-thumb-color"}(a||(a={})),function(o){o.BACKGROUND="--custom-sidebar-background",o.BORDER_COLOR="--custom-sidebar-border-color",o.MENU_BACKGROUND="--custom-sidebar-menu-background",o.TITLE_COLOR="--custom-sidebar-title-color",o.SUBTITLE_COLOR="--custom-sidebar-subtitle-color",o.BUTTON_COLOR="--custom-sidebar-button-color",o.DIVIDER_COLOR="--custom-sidebar-divider-color",o.DIVIDER_TOP_COLOR="--custom-sidebar-divider-top-color",o.DIVIDER_BOTTOM_COLOR="--custom-sidebar-divider-bottom-color",o.SCROLLBAR_THUMB_COLOR="--custom-sidebar-scrollbar-thumb-color",o.ITEM_BACKGROUND="--custom-sidebar-item-background",o.ITEM_BACKGROUND_HOVER="--custom-sidebar-item-background-hover",o.ICON_COLOR="--custom-sidebar-icon-color",o.ICON_COLOR_SELECTED="--custom-sidebar-icon-color-selected",o.ICON_COLOR_HOVER="--custom-sidebar-icon-color-hover",o.TEXT_COLOR="--custom-sidebar-text-color",o.TEXT_COLOR_SELECTED="--custom-sidebar-text-color-selected",o.TEXT_COLOR_HOVER="--custom-sidebar-text-color-hover",o.SELECTION_BACKGROUND="--custom-sidebar-selection-background",o.SELECTION_OPACITY="--custom-sidebar-selection-opacity",o.INFO_COLOR="--custom-sidebar-info-color",o.INFO_COLOR_SELECTED="--custom-sidebar-info-color-selected",o.INFO_COLOR_HOVER="--custom-sidebar-info-color-hover",o.NOTIFICATION_COLOR="--custom-sidebar-notification-color",o.NOTIFICATION_COLOR_SELECTED="--custom-sidebar-notification-color-selected",o.NOTIFICATION_COLOR_HOVER="--custom-sidebar-notification-color-hover",o.NOTIFICATION_TEXT_COLOR="--custom-sidebar-notification-text-color",o.NOTIFICATION_TEXT_COLOR_SELECTED="--custom-sidebar-notification-text-color-selected",o.NOTIFICATION_TEXT_COLOR_HOVER="--custom-sidebar-notification-text-color-hover"}(T||(T={}));var R,I,C,s,l,d=[["item_background",T.ITEM_BACKGROUND],["item_background_hover",T.ITEM_BACKGROUND_HOVER],["icon_color",T.ICON_COLOR],["icon_color_selected",T.ICON_COLOR_SELECTED],["icon_color_hover",T.ICON_COLOR_HOVER],["text_color",T.TEXT_COLOR],["text_color_selected",T.TEXT_COLOR_SELECTED],["text_color_hover",T.TEXT_COLOR_HOVER],["selection_background",T.SELECTION_BACKGROUND],["selection_opacity",T.SELECTION_OPACITY],["info_color",T.INFO_COLOR],["info_color_selected",T.INFO_COLOR_SELECTED],["info_color_hover",T.INFO_COLOR_HOVER],["notification_color",T.NOTIFICATION_COLOR],["notification_color_selected",T.NOTIFICATION_COLOR_SELECTED],["notification_color_hover",T.NOTIFICATION_COLOR_HOVER],["notification_text_color",T.NOTIFICATION_TEXT_COLOR],["notification_text_color_selected",T.NOTIFICATION_TEXT_COLOR_SELECTED],["notification_text_color_hover",T.NOTIFICATION_TEXT_COLOR_HOVER]];!function(o,e,t){if(t||2===arguments.length)for(var O,r=0,i=e.length;r extra_module_url module.\nCheck the documentation: https://github.com/elchininet/custom-sidebar#installation"))}))}(); +!function(){"use strict";(function(e,t,r){var n;void 0===r&&(r={});var o=r.retries,i=void 0===o?10:o,u=r.delay,s=void 0===u?10:u,c=r.shouldReject,a=void 0===c||c,d=null!==(n=r.rejectMessage)&&void 0!==n?n:"Could not get the result after {{ retries }} retries";return new Promise((function(r,n){var o=0,u=function(){var c=e();t(c)?r(c):++o extra_module_url module.\nCheck the documentation: https://github.com/elchininet/custom-sidebar#installation"))}))}(); diff --git a/docs/docs/03-configuration/02-main-configuration-options.mdx b/docs/docs/03-configuration/02-main-configuration-options.mdx index 20067b7..ad5f074 100644 --- a/docs/docs/03-configuration/02-main-configuration-options.mdx +++ b/docs/docs/03-configuration/02-main-configuration-options.mdx @@ -64,7 +64,7 @@ These options are intended to change the functionality of the sidebar and to cha | ------------------------- | ------- | --------- | ----------- | | item | String | yes | This is a string that will be used to match each sidebar item by its text, its `data-panel` attribute or its `href`. If the `exact` property is not set, it is case insensitive and it can be a substring such as `developer` instead of `Developer Tools` or `KITCHEN` instead of `kitchen-lights` | | match | String | no | This property will define which string will be used to match the `item` property. It has three possible values "text" (default) to match the text content of the element, "data-panel" to match the `data-panel` attribute of the element, or "href", to match the `href` attribute of the element | -| exact | Boolean | no | Specifies whether the `item` string match should be an exact match (`true`) or not (`false`). | +| exact | Boolean | no | Specifies whether the `item` string match should be an exact match (`true`) or not (`false`) | | order | Number | no | Sets the order of the sidebar item | | hide\* | Boolean or String | no | Setting this property to `true` will hide the sidebar item and if the property `hide_all` from the main configuration is `true`, setting this property as `false` will avoid hiding the item | | name\* | String | no | Changes the name of the sidebar item | @@ -74,7 +74,8 @@ These options are intended to change the functionality of the sidebar and to cha | bottom | Boolean | no | Setting this property to `true` will group the item with the bottom items (Configuration, Developer Tools, etc) | | href | String | no | Specifies the `href` of the sidebar item | | target | String | no | Specifies the [target property] of the sidebar item | -| on_click | See below | no | Specifies the `onClick` property of the sidebar item. It allows two types of actions, service call actions or javascript actions. Take into account that setting this property will not prevent redirecting to an internal dashboard or an external URL if the `href` property is set. If you want to avoid navigating to a page, you should set the `href` option as `#` (in new items you can just omit it). Check the [Short Configuration Example](#short-configuration-example-1) below for an example of its usage. | +| on_click | See below | no | Specifies the `onClick` property of the sidebar item. It allows two types of actions, service call actions or javascript actions. Take into account that setting this property will not prevent redirecting to an internal dashboard or an external URL if the `href` property is set. If you want to avoid navigating to a page, you should set the `href` option as `#` (in new items you can just omit it). Check the [Short Configuration Example](#short-configuration-example-1) below for an example of its usage | +| divider | Boolean | no | Adds a divider line below the item | | new_item | Boolean | no | Set this property to `true` to create a new item in the sidebar. If you use this property you need to provide an `icon` property and either a `href` or an `on_click` property | :::tip diff --git a/docs/docs/03-configuration/03-themeable-configuration-options.mdx b/docs/docs/03-configuration/03-themeable-configuration-options.mdx index f4860dc..b92f60c 100644 --- a/docs/docs/03-configuration/03-themeable-configuration-options.mdx +++ b/docs/docs/03-configuration/03-themeable-configuration-options.mdx @@ -42,7 +42,7 @@ These options are only useful if you plan to change the appareance of the sideba | notification_text_color\* | String | no | Sets the color of the sidebar notifications texts | | notification_text_color_selected\* | String | no | Sets the color of the sidebar notification texts of the selected sidebar item | | notification_text_color_hover\* | String | no | Sets the color of the sidebar notifications texts when the item is in hover state | -| divider_color\* | String | no | Sets the color of both sidebar dividers | +| divider_color\* | String | no | Sets the color of the sidebar dividers | | divider_top_color\* | String | no | Sets the color of the top sidebar divider. It overrides `divider_color` for this divider if it is set | | divider_bottom_color\* | String | no | Sets the color of the bottom sidebar divider. It overrides `divider_color` for this divider if it is set | | scrollbar_thumb_color\*| String | no | Sets the color of the sidebar scrollbar (This option uses non-baseline CSS styles and it could not work in some browsers) | @@ -100,6 +100,7 @@ These options are only useful if you plan to change the appareance of the sideba | notification_text_color\* | String | no | Sets the color of the notification text (it overrides the root `notification_text_color` option) | | notification_text_color_selected\* | String | no | Sets the color of the notification text when it is selected (it overrides the root `notification_text_color_selected` option) | | notification_text_color_hover\* | String | no | Sets the color of the notifications text in hover state (it overrides the root `notification_text_color_hover` option) | +| divider_color\* | String | no | Sets the color of the divider line below the item (it overrides the root `divider_color` option) | :::tip diff --git a/src/checker.ts b/src/checker.ts index 6a006de..63fa9e3 100644 --- a/src/checker.ts +++ b/src/checker.ts @@ -3,7 +3,7 @@ import { NAMESPACE, MAX_ATTEMPTS, RETRY_DELAY -} from '@constants'; +} from './constants/global'; getPromisableResult( () => window.CustomSidebar, diff --git a/src/constants/global.ts b/src/constants/global.ts new file mode 100644 index 0000000..50fdbe1 --- /dev/null +++ b/src/constants/global.ts @@ -0,0 +1,3 @@ +export const NAMESPACE = 'custom-sidebar'; +export const MAX_ATTEMPTS = 100; +export const RETRY_DELAY = 50; \ No newline at end of file diff --git a/src/constants/index.ts b/src/constants/index.ts index 8116fad..85751ad 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -6,12 +6,10 @@ import{ DockedSidebar } from '@types'; -export const NAMESPACE = 'custom-sidebar'; +export * from './global'; export const LOCAL_PATH = '/local/'; export const CONFIG_NAME = 'sidebar-config'; export const CONFIG_PATH = `${LOCAL_PATH}${CONFIG_NAME}`; -export const MAX_ATTEMPTS = 100; -export const RETRY_DELAY = 50; export const FLUSH_PROMISE_DELAY = 1; export const BASE_NAME = 'base'; @@ -137,14 +135,15 @@ export const ITEM_TEMPLATE_COLOR_CONFIG_OPTIONS: ItemColorConfigKeys[] = [ 'notification_color_hover', 'notification_text_color', 'notification_text_color_selected', - 'notification_text_color_hover' + 'notification_text_color_hover', + 'divider_color' ]; export const ITEM_TEMPLATE_NUMBER_CONFIG_OPTIONS: ItemColorConfigKeys[] = [ 'selection_opacity' ]; -export const ITEM_TEMPLATE_STRING_CONFIG_OPTIONS: SidebarStringConfigKeys[] = [ +export const ITEM_STRING_CONFIG_OPTIONS: SidebarStringConfigKeys[] = [ 'default_path' ]; @@ -167,7 +166,8 @@ export const ITEM_OPTIONS_VARIABLES_MAP: [ItemColorConfigKeys, string][] = [ ['notification_color_hover', CUSTOM_SIDEBAR_CSS_VARIABLES.NOTIFICATION_COLOR_HOVER], ['notification_text_color', CUSTOM_SIDEBAR_CSS_VARIABLES.NOTIFICATION_TEXT_COLOR], ['notification_text_color_selected', CUSTOM_SIDEBAR_CSS_VARIABLES.NOTIFICATION_TEXT_COLOR_SELECTED], - ['notification_text_color_hover', CUSTOM_SIDEBAR_CSS_VARIABLES.NOTIFICATION_TEXT_COLOR_HOVER] + ['notification_text_color_hover', CUSTOM_SIDEBAR_CSS_VARIABLES.NOTIFICATION_TEXT_COLOR_HOVER], + ['divider_color', CUSTOM_SIDEBAR_CSS_VARIABLES.DIVIDER_COLOR] ]; export const SIDEBAR_OPTIONS_VARIABLES_MAP: [SidebarColorConfigKeys, string][] = [ @@ -177,7 +177,6 @@ export const SIDEBAR_OPTIONS_VARIABLES_MAP: [SidebarColorConfigKeys, string][] = ['sidebar_background', CUSTOM_SIDEBAR_CSS_VARIABLES.BACKGROUND], ['menu_background', CUSTOM_SIDEBAR_CSS_VARIABLES.MENU_BACKGROUND], ['scrollbar_thumb_color', CUSTOM_SIDEBAR_CSS_VARIABLES.SCROLLBAR_THUMB_COLOR], - ['divider_color', CUSTOM_SIDEBAR_CSS_VARIABLES.DIVIDER_COLOR], ['divider_top_color', CUSTOM_SIDEBAR_CSS_VARIABLES.DIVIDER_TOP_COLOR], ['divider_bottom_color', CUSTOM_SIDEBAR_CSS_VARIABLES.DIVIDER_BOTTOM_COLOR], ...ITEM_OPTIONS_VARIABLES_MAP @@ -194,6 +193,7 @@ export enum ATTRIBUTE { ROLE = 'role', PROCESSED = 'data-processed', WITH_NOTIFICATION = 'data-notification', + WITH_DIVIDER = 'data-divider', ARIA_SELECTED = 'aria-selected', ARIA_DISABLED = 'aria-disabled', DISABLED = 'disabled', diff --git a/src/custom-sidebar.ts b/src/custom-sidebar.ts index c793d2b..cbbaefe 100644 --- a/src/custom-sidebar.ts +++ b/src/custom-sidebar.ts @@ -772,6 +772,7 @@ class CustomSidebar { STYLES.SIDEBAR_EDITABLE, STYLES.ITEM_BACKGROUND, STYLES.ITEM_BACKGROUND_HOVER, + STYLES.ITEM_DIVIDER_ITEM_DIVIDER_COLOR, STYLES.ICON_COLOR, STYLES.ICON_COLOR_SELECTED, STYLES.ICON_COLOR_HOVER, @@ -911,6 +912,10 @@ class CustomSidebar { orderItem.element.style.order = `${orderIndex}`; + if (orderItem.divider) { + orderItem.element.setAttribute(ATTRIBUTE.WITH_DIVIDER, 'true'); + } + if (orderItem.name) { this._subscribeName( orderItem.element, diff --git a/src/styles/index.ts b/src/styles/index.ts index ec5f486..0a22055 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -193,6 +193,18 @@ export const ITEM_BACKGROUND_HOVER = { } }; +export const ITEM_DIVIDER_ITEM_DIVIDER_COLOR = { + [`${ SELECTOR.HOST } ${ SELECTOR.ITEM }[${ ATTRIBUTE.WITH_DIVIDER }]`]: { + borderBottom: '1px solid', + borderBottomColor: getCSSVariables( + CUSTOM_SIDEBAR_CSS_VARIABLES.DIVIDER_COLOR, + HA_CSS_VARIABLES.DIVIDER_COLOR + ), + marginBottom: '10px', + paddingBottom: '10px' + } +}; + export const ICON_COLOR = { [`${ SELECTOR.HOST } ${ ELEMENT.PAPER_ICON_ITEM } > :is(${ ELEMENT.HA_SVG_ICON }, ${ ELEMENT.HA_ICON })`]: { color: getCSSVariables( diff --git a/src/types/index.ts b/src/types/index.ts index ca77e94..dab6b0b 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -100,6 +100,7 @@ export interface ItemColorConfig { notification_text_color?: string; notification_text_color_selected?: string; notification_text_color_hover?: string; + divider_color?: string; } export interface SidebarColorConfig extends ItemColorConfig { @@ -120,6 +121,7 @@ export interface ConfigItem extends ItemColorConfig { match?: `${Match}`; exact?: boolean; name?: string; + icon?: string; info?: string; notification?: string; order?: number; @@ -128,14 +130,13 @@ export interface ConfigItem extends ItemColorConfig { href?: string; target?: '_self' | '_blank'; on_click?: OnClickAction; - icon?: string; + divider?: boolean; new_item?: never; } export interface ConfigNewItem extends Omit { new_item: boolean; item: string; - href: string; icon: string; } diff --git a/src/validators/index.ts b/src/validators/index.ts index 8283ef9..f9f0dd6 100644 --- a/src/validators/index.ts +++ b/src/validators/index.ts @@ -16,7 +16,7 @@ import { SIDEBAR_MODE_TO_DOCKED_SIDEBAR, ITEM_TEMPLATE_COLOR_CONFIG_OPTIONS, ITEM_TEMPLATE_NUMBER_CONFIG_OPTIONS, - ITEM_TEMPLATE_STRING_CONFIG_OPTIONS, + ITEM_STRING_CONFIG_OPTIONS, JS_TEMPLATE_REG, JINJA_TEMPLATE_REG } from '@constants'; @@ -38,7 +38,7 @@ const BASE_CONFIG_OPTIONS = [ 'scrollbar_thumb_color', 'styles', ...ITEM_TEMPLATE_COLOR_CONFIG_OPTIONS, - ...ITEM_TEMPLATE_STRING_CONFIG_OPTIONS + ...ITEM_STRING_CONFIG_OPTIONS ] as const; const ONLY_BASE_CONFIG_OPTIONS = [ @@ -427,6 +427,12 @@ const validateConfigItem = (configItem: ConfigItem): void => { `${ERROR_PREFIX} in ${configItem.item},` ); + validateBooleanOptions( + configItem, + ['divider'], + `${ERROR_PREFIX} in ${configItem.item},` + ); + validateOnClickOption( configItem, `${ERROR_PREFIX} in ${configItem.item},` diff --git a/test-snapshots/04 - item-color-options-overriding.spec.ts/chromium/color-overriding-divider-color.png b/test-snapshots/04 - item-color-options-overriding.spec.ts/chromium/color-overriding-divider-color.png new file mode 100644 index 0000000000000000000000000000000000000000..d353552629bfdb86424337909f853237b9378e49 GIT binary patch literal 19088 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 kue%uj7c|D7b&8h{xbD = {}) => ({ +const getOrderItemWithColorOption = (option: string, extraOptions: Record = {}) => ({ [option]: 'blue', order: [ { @@ -98,6 +98,14 @@ const pageVisit = async (page: Page): Promise => { { notification: '2' } ), screenshot: 'color-overriding-notification-text-color.png' + }, + { + title: 'should override the global divider_color option', + json: getOrderItemWithColorOption( + 'divider_color', + { divider: true } + ), + screenshot: 'color-overriding-divider-color.png' } ].forEach(({ title, json, screenshot }) => { diff --git a/tests/15 - validator-errors.spec.ts b/tests/15 - validator-errors.spec.ts index 44dd82b..982a105 100644 --- a/tests/15 - validator-errors.spec.ts +++ b/tests/15 - validator-errors.spec.ts @@ -578,6 +578,30 @@ test.describe('order item property', () => { }, error: `${ERROR_PREFIX} in dev, "item" property should be a string` }, + { + title: 'should throw an error if the "divider" property is not a boolean', + json: { + order: [ + { + item: 'config', + divider: 'true' + } + ] + }, + error: `${ERROR_PREFIX} in config, "divider" property should be a boolean` + }, + { + title: 'should throw an error if the "divider_color" property is not a string', + json: { + order: [ + { + item: 'config', + divider_color: false + } + ] + }, + error: `${ERROR_PREFIX} in config, "divider_color" property should be a string` + }, { title: 'should throw an error if a new item doesn\'t have an "href" or an "on_click" property', json: {