iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
66 lines • 57.6 kB
JavaScript
export const __rspack_esm_id=79578;export const __rspack_esm_ids=[79578];export const __webpack_modules__={63708(t,e,a){a.d(e,{fW:()=>r});a(18111),a(13579);var i=a(44537),o=a(36312);const r=(t,e)=>(c(e)||s(t,e))&&n(t,e),s=(t,e)=>!e.component||(0,i.e)(e.component).some(e=>(0,o.x)(t.config,e)),n=(t,e)=>!e.not_component||!(0,i.e)(e.not_component).some(e=>(0,o.x)(t.config,e)),c=t=>t.core},26218(t,e,a){a.d(e,{a:()=>o});const i=(0,a(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function o(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=e.connectedCallback;e.connectedCallback=function(){o.call(this);const e=this[a];e&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(t);a&&setTimeout(()=>{a.scrollTop=e},0)})};const r=Object.getOwnPropertyDescriptor(e,a);let s;if(void 0===r)s={get(){return this[`__${String(a)}`]||history.state?.scrollPosition},set(t){i(t),this[`__${String(a)}`]=t},configurable:!0,enumerable:!0};else{const t=r.set;s={...r,set(e){i(e),this[`__${String(a)}`]=e,t?.call(this,e)}}}Object.defineProperty(e,a,s)}}},76830(t,e,a){a.d(e,{d:()=>i});a(18111),a(20116);const i=(t,e=!0)=>{if(t.defaultPrevented||0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)return;const a=t.composedPath().find(t=>"A"===t.tagName);if(!a||a.target||a.hasAttribute("download")||"external"===a.getAttribute("rel"))return;let i=a.href;if(!i||-1!==i.indexOf("mailto:"))return;const o=window.location,r=o.origin||o.protocol+"//"+o.host;return i.startsWith(r)&&(i=i.slice(r.length),"#"!==i)?(e&&t.preventDefault(),i):void 0}},69093(t,e,a){a.d(e,{t:()=>o});var i=a(71727);const o=t=>(0,i.m)(t.entity_id)},82286(t,e,a){a.d(e,{$:()=>i});const i=(t,e)=>o(t.attributes,e),o=(t,e)=>0!==(t.supported_features&e)},77090(t,e,a){a.d(e,{s:()=>i});const i=t=>!(!t.detail.selected||"property"!==t.detail.source)&&(t.currentTarget.selected=!1,!0)},80880(t,e,a){a.d(e,{Y:()=>i});const i=(t,e="_")=>{const a="àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧхîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·",i=`aaaaaaaaaaabcccdddeeeeeeeeeeefggghhiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${e}`,o=new RegExp(a.split("").join("|"),"g"),r={ж:"zh",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ю:"iu",я:"ia"};let s;return""===t?s="":(s=t.toString().toLowerCase().replace(o,t=>i.charAt(a.indexOf(t))).replace(/[а-я]/g,t=>r[t]||"").replace(/(\d),(?=\d)/g,"$1").replace(/[^a-z0-9]+/g,e).replace(new RegExp(`(${e})\\1+`,"g"),"$1").replace(new RegExp(`^${e}+`),"").replace(new RegExp(`${e}+$`),""),""===s&&(s="unknown")),s}},77796(t,e,a){a.d(e,{n:()=>i});const i=(t,e,a=!0,i=!0)=>{let o,r=0;const s=(...s)=>{const n=()=>{r=!1===a?0:Date.now(),o=void 0,t(...s)},c=Date.now();r||!1!==a||(r=c);const d=e-(c-r);d<=0||d>e?(o&&(clearTimeout(o),o=void 0),r=c,t(...s)):o||!1===i||(o=window.setTimeout(n,d))};return s.cancel=()=>{clearTimeout(o),o=void 0,r=0},s}},76776(t,e,a){var i=a(62826),o=a(5124),r=a(22441);class s extends o.WF{render(){return o.qy` ${this.header?o.qy`<h1 class="card-header">${this.header}</h1>`:o.s6} <slot></slot> `}constructor(...t){super(...t),this.raised=!1}}s.styles=o.AH`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
:host
::slotted(
.card-content:not(:nth-child(1 of .card-content, .card-header))
),
slot:not(:first-child)::slotted(.card-content) {
padding-top: 0;
margin-top: calc(var(--ha-space-2) * -1);
}
:host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`,(0,i.Cg)([(0,r.MZ)()],s.prototype,"header",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"raised",void 0),s=(0,i.Cg)([(0,r.EM)("ha-card")],s)},90248(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButtonArrowPrev:()=>p});var o=a(62826),r=a(5124),s=a(22441),n=a(63091),c=a(26300),d=t([c]);c=(d.then?(await d)():d)[0];const l="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",h="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class p extends r.WF{render(){return r.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===n.G.document.dir?h:l}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)()],p.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)()],p.prototype,"href",void 0),(0,o.Cg)([(0,s.MZ)()],p.prototype,"target",void 0),(0,o.Cg)([(0,s.MZ)()],p.prototype,"rel",void 0),(0,o.Cg)([(0,s.MZ)()],p.prototype,"download",void 0),(0,o.Cg)([(0,s.wk)()],p.prototype,"_icon",void 0),p=(0,o.Cg)([(0,s.EM)("ha-icon-button-arrow-prev")],p),i()}catch(t){i(t)}})},26300(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButton:()=>l});var o=a(62826),r=a(5124),s=a(22441),n=a(63672),c=a(18350),d=(a(67094),t([c]));c=(d.then?(await d)():d)[0];class l extends r.WF{render(){return r.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,n.J)(this.label)}" title="${(0,n.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,n.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?r.qy`<ha-svg-icon aria-hidden="true" .path="${this.path}"></ha-svg-icon>`:r.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}l.shadowRootOptions={mode:"open",delegatesFocus:!0},l.styles=r.AH`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
--ha-icon-button-padding-inline,
--ha-space-2
);--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`,(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],l.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)({type:String})],l.prototype,"path",void 0),(0,o.Cg)([(0,s.MZ)({type:String})],l.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)({type:String,attribute:"aria-haspopup"})],l.prototype,"ariaHasPopup",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"hide-title",type:Boolean})],l.prototype,"hideTitle",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],l.prototype,"selected",void 0),(0,o.Cg)([(0,s.MZ)()],l.prototype,"href",void 0),(0,o.Cg)([(0,s.MZ)()],l.prototype,"target",void 0),(0,o.Cg)([(0,s.MZ)()],l.prototype,"rel",void 0),(0,o.Cg)([(0,s.MZ)()],l.prototype,"download",void 0),l=(0,o.Cg)([(0,s.EM)("ha-icon-button")],l),i()}catch(t){i(t)}})},47680(t,e,a){a.r(e),a.d(e,{HaIcon:()=>_});a(74423);var i=a(62826),o=a(5124),r=a(22441),s=a(1087),n=a(9899),c=a(700),d=(a(44114),a(18111),a(7588),a(95192)),l=a(7553);const h=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}');let p;const g=()=>(p||(p=f().catch(t=>{throw p=void 0,t})),p),f=async()=>{const t=(0,d.y$)("hass-icon-db","mdi-icon-store"),e=await(0,d.Jt)("_version",t);return e?e!==h.version&&(await(0,d.IU)(t),(0,d.hZ)("_version",h.version,t)):(0,d.hZ)("_version",h.version,t),t},b=["mdi","hass","hassio","hademo"];let v=[];a(67094);const u={},m={},y=(0,n.s)(()=>(async t=>{const e=Object.keys(t),a=await Promise.allSettled(Object.values(t));(await g())("readwrite",i=>{a.forEach((a,o)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([t,e])=>{i.put(e,t)}),delete t[e[o]]})})})(m),2e3),w={},x={"home-assistant":()=>a.e(58781).then(a.bind(a,53580)).then(t=>t.mdiHomeAssistant),"music-assistant":()=>a.e(56009).then(a.bind(a,10576)).then(t=>t.mdiMusicAssistant),esphome:()=>a.e(88800).then(a.bind(a,45091)).then(t=>t.mdiEsphomeLogo)};class _ extends o.WF{willUpdate(t){super.willUpdate(t),t.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?o.qy` <iron-icon .icon="${this.icon}"></iron-icon>`:o.qy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:o.s6}async _loadIcon(){if(!this.icon)return;const t=this.icon,[e,a]=this.icon.split(":",2);let i,o=a;if(!e||!o)return;if(!b.includes(e)){const a=c.y[e];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(o),t)):void(this._legacy=!0)}if(this._legacy=!1,o in u){const t=u[o];let a;t.newName?(a=`Icon ${e}:${o} was renamed to ${e}:${t.newName}, please change your config, it will be removed in version ${t.removeIn}.`,o=t.newName):a=`Icon ${e}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${t.removeIn}.`,console.warn(a),(0,s.r)(this,"write_log",{level:"warning",message:a})}if(o in w)return void(this._path=w[o]);if(o in x){const e=await x[o]();return this.icon===t&&(this._path=e),void(w[o]=e)}try{i=await(t=>new Promise((e,a)=>{if(v.push([t,e,a]),v.length>1)return;const i=g();(0,l.h)(1e3,(async()=>{(await i)("readonly",t=>{for(const[e,a,i]of v)(0,d.Yd)(t.get(e)).then(t=>a(t)).catch(t=>i(t));v=[]})})()).catch(t=>{for(const[,,e]of v)e(t);v=[]})}))(o)}catch(t){i=void 0}if(i)return this.icon===t&&(this._path=i),void(w[o]=i);const r=(t=>{let e;for(const a of h.parts){if(void 0!==a.start&&t<a.start)break;e=a}return e.file})(o);if(r in m)return void this._setPath(m[r],o,t);const n=fetch(`/static/mdi/${r}.json`).then(t=>t.json());m[r]=n,this._setPath(n,o,t),n.catch(()=>{delete m[r]}),y()}async _setCustomPath(t,e){const a=await t;this.icon===e&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}async _setPath(t,e,a){try{const i=await t;this.icon===a&&(this._path=i[e]),w[e]=i[e]}catch(t){}}constructor(...t){super(...t),this._legacy=!1}}_.styles=o.AH`:host{fill:currentcolor}`,(0,i.Cg)([(0,r.MZ)()],_.prototype,"icon",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_path",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_secondaryPath",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_viewBox",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_legacy",void 0),_=(0,i.Cg)([(0,r.EM)("ha-icon")],_)},3449(t,e,a){var i=a(62826),o=a(5124),r=a(22441);class s extends o.WF{render(){return o.qy`<slot></slot>`}constructor(...t){super(...t),this.disabled=!1}}s.styles=o.AH`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var(
--mdc-typography-caption-letter-spacing,
.0333333333em
);line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`,(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0),s=(0,i.Cg)([(0,r.EM)("ha-input-helper-text")],s)},28732(t,e,a){var i=a(62826),o=a(27686),r=a(7731),s=a(5124),n=a(22441);class c extends o.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[r.R,s.AH`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?s.AH`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:s.AH``]}}c=(0,i.Cg)([(0,n.EM)("ha-list-item")],c)},8630(t,e,a){var i=a(62826),o=a(68618),r=a(11081),s=a(22441);class n extends o.iY{}n.styles=r.R,n=(0,i.Cg)([(0,s.EM)("ha-list")],n)},2054(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),o=a(5124),r=a(22441),s=a(1087),n=a(44249),c=a(26300),d=t([c]);c=(d.then?(await d)():d)[0];const l="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class h extends o.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return o.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return o.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${l}" @click="${this._toggleMenu}"></ha-icon-button> ${t?o.qy`<div class="dot"></div>`:""} `}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,a=t.has("narrow")?t.get("narrow"):this.narrow,i=!1===e?.kioskMode&&(a||"always_hidden"===e?.dockedSidebar),o=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&i===o||(this._show=o||this._alwaysVisible,o?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,n.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,s.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}h.styles=o.AH`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`,(0,i.Cg)([(0,r.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,i.Cg)([(0,r.wk)()],h.prototype,"_hasNotifications",void 0),(0,i.Cg)([(0,r.wk)()],h.prototype,"_show",void 0),h=(0,i.Cg)([(0,r.EM)("ha-menu-button")],h),e()}catch(t){e(t)}})},54276(t,e,a){var i=a(62826),o=a(76482),r=a(91382),s=a(96245),n=a(5124),c=a(22441);class d extends r.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){t?.removeEventListener("touchend",this._handleTouchEnd),e?.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new o.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}d.styles=[s.R,n.AH`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
--ha-ripple-hover-color,
var(--ha-ripple-color, var(--secondary-text-color))
);--md-ripple-pressed-color:var(
--ha-ripple-pressed-color,
var(--ha-ripple-color, var(--secondary-text-color))
)}`],d=(0,i.Cg)([(0,c.EM)("ha-ripple")],d)},65829(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaSpinner:()=>d});var o=a(62826),r=a(55262),s=a(5124),n=a(22441),c=t([r]);r=(c.then?(await c)():c)[0];class d extends r.A{updated(t){if(super.updated(t),t.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[r.A.styles,s.AH`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`]}}(0,o.Cg)([(0,n.MZ)()],d.prototype,"size",void 0),d=(0,o.Cg)([(0,n.EM)("ha-spinner")],d),i()}catch(t){i(t)}})},67094(t,e,a){a.r(e),a.d(e,{HaSvgIcon:()=>s});var i=a(62826),o=a(5124),r=a(22441);class s extends o.WF{render(){return o.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?o.JW`<path class="primary-path" d="${this.path}"></path>`:o.s6} ${this.secondaryPath?o.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:o.s6} </g> </svg>`}}s.styles=o.AH`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`,(0,i.Cg)([(0,r.MZ)()],s.prototype,"path",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],s.prototype,"secondaryPath",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],s.prototype,"viewBox",void 0),s=(0,i.Cg)([(0,r.EM)("ha-svg-icon")],s)},43831(t,e,a){var i=a(62826),o=a(5124),r=a(22441),s=a(63672);a(54276);class n extends o.WF{render(){return o.qy` <div tabindex="0" role="tab" aria-selected="${this.active}" aria-label="${(0,s.J)(this.name)}" @keydown="${this._handleKeyDown}"> <slot name="icon"></slot> <span class="name">${this.name}</span> <ha-ripple></ha-ripple> </div> `}_handleKeyDown(t){"Enter"===t.key&&t.target.click()}constructor(...t){super(...t),this.active=!1,this.narrow=!1}}n.styles=o.AH`div{padding:0 32px;display:flex;flex-direction:column;text-align:center;box-sizing:border-box;align-items:center;justify-content:center;width:100%;height:var(--header-height);cursor:pointer;position:relative;outline:0}:host(:not([narrow])) div{flex-direction:row;gap:var(--ha-space-2)}.name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}:host([active]){color:var(--primary-color)}:host(:not([narrow])[active]) div{border-bottom:2px solid var(--primary-color)}:host([narrow]){min-width:0;display:flex;justify-content:center;overflow:hidden}:host([narrow]) div{padding:0 4px}::slotted([slot=icon]){margin-bottom:var(--ha-space-1)}:host(:not([narrow])) ::slotted([slot=icon]){margin-bottom:0}div:focus-visible:before{position:absolute;display:block;content:"";inset:0;background-color:var(--secondary-text-color);opacity:.08}`,(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"active",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"narrow",void 0),(0,i.Cg)([(0,r.MZ)()],n.prototype,"name",void 0),n=(0,i.Cg)([(0,r.EM)("ha-tab")],n)},34127(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),o=a(52630),r=a(5124),s=a(22441),n=t([o]);o=(n.then?(await n)():n)[0];class c extends o.A{static get styles(){return[o.A.styles,r.AH`:host{--wa-tooltip-background-color:var(
--ha-tooltip-background-color,
var(--ha-color-surface-default)
);--wa-tooltip-content-color:var(
--ha-tooltip-text-color,
var(--primary-text-color)
);--wa-tooltip-font-family:var(
--ha-tooltip-font-family,
var(--ha-font-family-body)
);--wa-tooltip-font-size:var(
--ha-tooltip-font-size,
var(--ha-font-size-m)
);--wa-tooltip-font-weight:var(
--ha-tooltip-font-weight,
var(--ha-font-weight-medium)
);--wa-tooltip-line-height:var(
--ha-tooltip-line-height,
var(--ha-line-height-condensed)
);--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
--ha-tooltip-border-radius,
var(--ha-border-radius-md)
);--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,i.Cg)([(0,s.MZ)({attribute:"show-delay",type:Number})],c.prototype,"showDelay",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"hide-delay",type:Number})],c.prototype,"hideDelay",void 0),c=(0,i.Cg)([(0,s.EM)("ha-tooltip")],c),e()}catch(t){e(t)}})},18885(t,e,a){a.d(e,{Td:()=>i,iP:()=>r,pz:()=>o});const i=(t,e)=>t.callWS({type:"config/core/update",...e}),o=t=>t.callWS({type:"config/core/detect"}),r=t=>t.callApi("POST","config/core/check_config")},700(t,e,a){a.d(e,{y:()=>s});const i=window;"customIconsets"in i||(i.customIconsets={});const o=i.customIconsets,r=window;"customIcons"in r||(r.customIcons={});const s=new Proxy(r.customIcons,{get:(t,e)=>t[e]??(o[e]?{getIcon:o[e]}:void 0)})},44249(t,e,a){a.d(e,{V:()=>i});const i=(t,e)=>{const a=new o,i=t.subscribeMessage(t=>e(a.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{i.then(t=>t?.())}};class o{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},53812(t,e,a){a.d(e,{G5:()=>s,Rz:()=>d,TW:()=>r,YC:()=>o,Yx:()=>n,kg:()=>l});var i=a(91926);const o=t=>t.callWS({type:"zone/list"}),r=(t,e)=>t.callWS({type:"zone/create",...e}),s=(t,e,a)=>t.callWS({type:"zone/update",zone_id:e,...a}),n=(t,e)=>t.callWS({type:"zone/delete",zone_id:e});let c;const d=t=>{c=t,(0,i.oo)("/config/zone/new")},l=()=>{const t=c;return c=void 0,t}},23296(t,e,a){a.a(t,async function(t,i){try{a.r(e);var o=a(62826),r=a(5124),s=a(22441),n=a(91926),c=a(65829),d=a(90248),l=a(2054),h=a(14503),p=t([c,d,l]);[c,d,l]=p.then?(await p)():p;class g extends r.WF{render(){return r.qy` ${this.noToolbar?"":r.qy`<div class="toolbar"> ${this.rootnav||history.state?.root?r.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:r.qy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._handleBack}"></ha-icon-button-arrow-prev> `} </div>`} <div class="content"> <ha-spinner></ha-spinner> ${this.message?r.qy`<div id="loading-text">${this.message}</div>`:r.s6} </div> `}_handleBack(){(0,n.OE)()}static get styles(){return[h.RF,r.AH`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto}.content{height:calc(100% - var(--header-height));display:flex;flex-direction:column;align-items:center;justify-content:center}#loading-text{max-width:350px;margin-top:16px}`]}constructor(...t){super(...t),this.noToolbar=!1,this.rootnav=!1,this.narrow=!1}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"no-toolbar"})],g.prototype,"noToolbar",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"rootnav",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)()],g.prototype,"message",void 0),g=(0,o.Cg)([(0,s.EM)("hass-loading-screen")],g),i()}catch(t){i(t)}})},40511(t,e,a){a.a(t,async function(t,e){try{a(18111),a(22489),a(20116),a(61701),a(14603),a(47566),a(98721);var i=a(62826),o=a(5124),r=a(22441),s=a(6412),n=a(22786),c=a(63708),d=a(26218),l=a(76830),h=a(91926),p=a(90248),g=a(2054),f=(a(67094),a(43831),a(14503)),b=t([p,g]);[p,g]=b.then?(await b)():b;const v=t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t;class u extends o.WF{willUpdate(t){if(t.has("route")){const t=`${this.route.prefix}${this.route.path}`;this._activeTab=this.tabs.find(e=>this._isActiveTabPath(e.path,t))}super.willUpdate(t)}render(){const t=this._getTabs(this.tabs,this._activeTab,this.hass.config.components,this.hass.language,this.hass.userData,this.narrow,this.localizeFunc||this.hass.localize);return o.qy` <div class="toolbar ${(0,s.H)({narrow:this.narrow})}"> <slot name="toolbar"> <div class="toolbar-content"> ${this.mainPage||!this.backPath&&history.state?.root?o.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:this.backPath?o.qy` <ha-icon-button-arrow-prev .href="${this.backPath}" .hass="${this.hass}"></ha-icon-button-arrow-prev> `:o.qy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._backTapped}"></ha-icon-button-arrow-prev> `} ${this.narrow||!this.showTabs?o.qy`<div class="main-title"> <slot name="header">${this.showTabs?"":t[0]}</slot> </div>`:""} ${this.showTabs&&!this.narrow?o.qy`<div id="tabbar">${t}</div>`:""} <div id="toolbar-icon"> <slot name="toolbar-icon"></slot> </div> </div> </slot> ${this.showTabs&&this.narrow?o.qy`<div id="tabbar" class="bottom-bar">${t}</div>`:""} </div> <div class="container"> ${this.pane?o.qy`<div class="pane"> <div class="shadow-container"></div> <div class="ha-scrollbar"> <slot name="pane"></slot> </div> </div>`:o.s6} <div class="content ha-scrollbar" @scroll="${this._saveScrollPos}"> <slot></slot> ${this.hasFab?o.qy`<div class="fab-bottom-space"></div>`:o.s6} </div> </div> <div id="fab"> <slot name="fab"></slot> </div> `}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}focusContentScroller(){this._content&&(this._content.style.outline="none",this._content.focus({preventScroll:!0}))}_backTapped(){this.backCallback?this.backCallback():(0,h.OE)()}_isActiveTabPath(t,e){try{const a=new URL(t,window.location.origin),i=new URL(e,window.location.origin),o=v(a.pathname),r=v(i.pathname);return!(r!==o&&!r.startsWith(`${o}/`))}catch(a){return e===t||e.startsWith(`${t}/`)}}async _tabClicked(t){const e=(0,l.d)(t);e&&await(0,h.oo)(e,{replace:!0})}static get styles(){return[f.dp,o.AH`:host{display:block;height:100%;background-color:var(--primary-background-color)}:host([narrow]){width:100%;position:fixed}.container{display:flex;height:calc(100% - var(--header-height,0px) - var(--safe-area-inset-top,0px))}ha-menu-button{margin-right:24px;margin-inline-end:24px;margin-inline-start:initial}.toolbar{font-size:var(--ha-font-size-xl);height:calc(var(--header-height,0px) + var(--safe-area-inset-top,0px));padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right);background-color:var(--sidebar-background-color);font-weight:var(--ha-font-weight-normal);border-bottom:1px solid var(--divider-color);box-sizing:border-box}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{padding:8px 12px;display:flex;align-items:center;height:100%;box-sizing:border-box}:host([narrow]) .toolbar-content{padding:4px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}.bottom-bar a{width:25%}#tabbar{display:flex;font-size:var(--ha-font-size-m);overflow:hidden}#tabbar>a{overflow:hidden;max-width:45%}#tabbar.bottom-bar{position:absolute;bottom:0;left:0;padding:0 16px;box-sizing:border-box;background-color:var(--sidebar-background-color);border-top:1px solid var(--divider-color);justify-content:space-around;z-index:2;font-size:var(--ha-font-size-s);width:100%;padding-bottom:var(--safe-area-inset-bottom)}#tabbar:not(.bottom-bar){flex:1;justify-content:center}:host(:not([narrow])) #toolbar-icon{min-width:40px}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;flex-shrink:0;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{min-width:0;flex:1;max-height:var(--header-height);line-height:var(--ha-line-height-normal);color:var(--sidebar-text-color);margin-inline-start:var(--main-title-margin,var(--ha-space-6))}.narrow .main-title{margin-inline-start:var(--main-title-margin,var(--ha-space-2))}.content{position:relative;width:100%;margin-right:var(--safe-area-inset-right);margin-inline-end:var(--safe-area-inset-right);overflow:auto;-webkit-overflow-scrolling:touch}:host([narrow]) .content{margin-left:var(--safe-area-inset-left);margin-inline-start:var(--safe-area-inset-left)}:host([narrow][show-tabs]) .content{margin-bottom:calc(var(--header-height,0px) + var(--safe-area-inset-bottom,0px))}.content .fab-bottom-space{height:calc(64px + var(--safe-area-inset-bottom,0px))}:host([narrow][show-tabs]) .content .fab-bottom-space{height:calc(80px + var(--safe-area-inset-bottom,0px))}#fab{position:fixed;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow][show-tabs]) #fab{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}.pane{border-right:1px solid var(--divider-color);border-inline-end:1px solid var(--divider-color);border-inline-start:initial;box-sizing:border-box;display:flex;flex:0 0 var(--sidepane-width,250px);width:var(--sidepane-width,250px);flex-direction:column;position:relative}.pane .ha-scrollbar{flex:1}`]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.isWide=!1,this.pane=!1,this.hasFab=!1,this.showTabs=!1,this._getTabs=(0,n.A)((t,e,a,i,r,s,n)=>{const d=t.filter(t=>(0,c.fW)(this.hass,t));if(d.length<2){if(this.showTabs=!1,1===d.length){const t=d[0];return[t.translationKey?n(t.translationKey):t.name]}return[""]}return this.showTabs=!0,d.map(t=>o.qy` <a href="${t.path}" @click="${this._tabClicked}"> <ha-tab .active="${t.path===e?.path}" .narrow="${this.narrow}" .name="${t.translationKey?n(t.translationKey):t.name}"> ${t.iconPath?o.qy`<ha-svg-icon slot="icon" .path="${t.iconPath}"></ha-svg-icon>`:""} </ha-tab> </a> `)})}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"localizeFunc",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"back-path"})],u.prototype,"backPath",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"backCallback",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"main-page"})],u.prototype,"mainPage",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"route",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"tabs",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],u.prototype,"narrow",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"is-wide"})],u.prototype,"isWide",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"pane",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"has-fab"})],u.prototype,"hasFab",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"show-tabs",reflect:!0})],u.prototype,"showTabs",void 0),(0,i.Cg)([(0,r.wk)()],u.prototype,"_activeTab",void 0),(0,i.Cg)([(0,r.P)(".content")],u.prototype,"_content",void 0),(0,i.Cg)([(0,d.a)(".content")],u.prototype,"_savedScrollPos",void 0),(0,i.Cg)([(0,r.Ls)({passive:!0})],u.prototype,"_saveScrollPos",null),u=(0,i.Cg)([(0,r.EM)("hass-tabs-subpage")],u),e()}catch(t){e(t)}})},54706(t,e,a){a.d(e,{E:()=>r});a(74423),a(18111),a(13579);var i=a(62826),o=a(22441);const r=t=>{class e extends t{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const t=this.__unsubs.pop();t instanceof Promise?t.then(t=>t()):t()}this.__unsubs=void 0}}updated(t){if(super.updated(t),t.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const e of t.keys())if(this.hassSubscribeRequiredHostProps.includes(e))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){void 0===this.__unsubs&&this.isConnected&&void 0!==this.hass&&!this.hassSubscribeRequiredHostProps?.some(t=>void 0===this[t])&&(this.__unsubs=this.hassSubscribe())}}return(0,i.Cg)([(0,o.MZ)({attribute:!1})],e.prototype,"hass",void 0),e}},20820(t,e,a){var i=a(62826),o=a(5124),r=a(22441),s=a(6412);class n extends o.WF{render(){return o.qy` <div class="content ${(0,s.H)({narrow:!this.isWide,"full-width":this.fullWidth})}"> <div class="header"><slot name="header"></slot></div> <div class="together layout ${(0,s.H)({narrow:!this.isWide,vertical:this.vertical||!this.isWide,horizontal:!this.vertical&&this.isWide})}"> <div class="intro"><slot name="introduction"></slot></div> <div class="panel flex-auto"><slot></slot></div> </div> </div> `}constructor(...t){super(...t),this.isWide=!1,this.vertical=!1,this.fullWidth=!1}}n.styles=o.AH`:host{display:block}.content{padding:28px 20px 0;max-width:1040px;margin:0 auto}.layout{display:flex}.horizontal{flex-direction:row}.vertical{flex-direction:column}.flex-auto{flex:1 1 auto}.header{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);opacity:var(--dark-primary-opacity)}.together{margin-top:var(--config-section-content-together-margin-top,32px)}.intro{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);width:100%;opacity:var(--dark-primary-opacity);font-size:var(--ha-font-size-m);padding-bottom:20px}.horizontal .intro{max-width:400px;margin-right:40px;margin-inline-end:40px;margin-inline-start:initial}.panel{margin-top:-24px}.panel ::slotted(*){margin-top:24px;display:block}.narrow.content{max-width:640px}.narrow .together{margin-top:var(--config-section-narrow-content-together-margin-top,var(--config-section-content-together-margin-top,20px))}.narrow .intro{padding-bottom:20px;margin-right:0;margin-inline-end:0;margin-inline-start:initial;max-width:500px}.full-width{padding:0}.full-width .layout{flex-direction:column}`,(0,i.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],n.prototype,"isWide",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],n.prototype,"vertical",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"full-width"})],n.prototype,"fullWidth",void 0),n=(0,i.Cg)([(0,r.EM)("ha-config-section")],n)},49492(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaConfigZone:()=>H});a(74423),a(18111),a(22489),a(20116),a(61701),a(14603),a(47566),a(98721);var o=a(62826),r=a(5124),s=a(22441),n=a(22786),c=a(69093),d=a(77090),l=a(91926),h=a(52220),p=a(80880),g=a(18350),f=(a(76776),a(26300)),b=(a(8630),a(28732),a(67094),a(34127)),v=a(99257),u=a(18885),m=a(59241),y=a(53812),w=a(65063),x=a(23296),_=a(40511),k=a(54706),C=(a(20820),a(25635)),$=a(59644),z=a(42952),M=t([g,f,b,v,x,_]);[g,f,b,v,x,_]=M.then?(await M)():M;const E="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",Z="M18.66,2C18.4,2 18.16,2.09 17.97,2.28L16.13,4.13L19.88,7.88L21.72,6.03C22.11,5.64 22.11,5 21.72,4.63L19.38,2.28C19.18,2.09 18.91,2 18.66,2M3.28,4L2,5.28L8.5,11.75L4,16.25V20H7.75L12.25,15.5L18.72,22L20,20.72L13.5,14.25L9.75,10.5L3.28,4M15.06,5.19L11.03,9.22L14.78,12.97L18.81,8.94L15.06,5.19Z",P="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class H extends((0,k.E)(r.WF)){hassSubscribe(){return[(0,m.Bz)(this.hass.connection,t=>{this._regEntities=t.map(t=>t.entity_id),this._filterStates()})]}render(){if(!this.hass||void 0===this._storageItems||void 0===this._stateItems)return r.qy`<hass-loading-screen></hass-loading-screen>`;const t=this.hass,e=0===this._storageItems.length&&0===this._stateItems.length?r.qy` <div class="empty"> ${t.localize("ui.panel.config.zone.no_zones_created_yet")} <br> <ha-button size="small" @click="${this._createZone}"> ${t.localize("ui.panel.config.zone.create_zone")}</ha-button> </div> `:r.qy` <ha-list> ${this._storageItems.map(e=>r.qy` <ha-list-item .entry="${e}" .id="${this.narrow?e.id:""}" graphic="icon" .hasMeta="${!this.narrow}" @request-selected="${this._itemClicked}" .value="${e.id}" ?selected="${this._activeEntry===e.id}"> <ha-icon .icon="${e.icon}" slot="graphic"></ha-icon> ${e.name} ${this.narrow?"":r.qy` <div slot="meta"> <ha-icon-button .id="${e.id}" .entry="${e}" @click="${this._openEditEntry}" .path="${E}" .label="${t.localize("ui.common.edit_item",{name:e.name})}"></ha-icon-button> </div> `} </ha-list-item> `)} ${this._stateItems.map(e=>r.qy` <ha-list-item graphic="icon" .id="${this.narrow?e.entity_id:""}" .hasMeta="${!this.narrow||"zone.home"!==e.entity_id}" .value="${e.entity_id}" @request-selected="${this._stateItemClicked}" ?selected="${this._activeEntry===e.entity_id}" .noEdit="${"zone.home"!==e.entity_id||!this._canEditCore}"> <ha-icon .icon="${e.attributes.icon}" slot="graphic"> </ha-icon> ${e.attributes.friendly_name||e.entity_id} ${this.narrow&&"zone.home"===e.entity_id&&!this._canEditCore?r.s6:r.qy`<ha-icon-button .id="zone-${(0,p.Y)(e.entity_id)}" .entityId="${e.entity_id}" .noEdit="${"zone.home"!==e.entity_id||!this._canEditCore}" .path="${"zone.home"===e.entity_id&&this._canEditCore?E:Z}" .label="${t.localize("ui.common.edit_item",{name:t.config.location_name})}" @click="${this._editHomeZone}" slot="meta"></ha-icon-button> <ha-tooltip .for="zone-${(0,p.Y)(e.entity_id)}" placement="left" .disabled="${"zone.home"===e.entity_id}" hoist> ${t.localize("ui.panel.config.zone.configured_in_yaml")} </ha-tooltip>`} </ha-list-item> `)} </ha-list> `;return r.qy` <hass-tabs-subpage .hass="${this.hass}" .narrow="${this.narrow}" .route="${this.route}" .backPath="${this._searchParms.has("historyBack")?void 0:"/config"}" .tabs="${C.configSections.areas}" has-fab> ${this.narrow?r.qy` <ha-config-section .isWide="${this.isWide}"> <span slot="introduction"> ${t.localize("ui.panel.config.zone.introduction")} </span> <ha-card outlined>${e}</ha-card> </ha-config-section> `:""} ${this.narrow?"":r.qy` <div class="flex"> <ha-locations-editor .hass="${this.hass}" .locations="${this._getZones(this._storageItems,this._stateItems)}" @location-updated="${this._locationUpdated}" @radius-updated="${this._radiusUpdated}" @marker-clicked="${this._markerClicked}"></ha-locations-editor> <div class="overflow">${e}</div> </div> `} <ha-button slot="fab" size="large" @click="${this._createZone}"> <ha-svg-icon slot="start" .path="${P}"></ha-svg-icon> ${t.localize("ui.panel.config.zone.create_zone")} </ha-button> </hass-tabs-subpage> `}firstUpdated(t){super.firstUpdated(t),this._canEditCore=Boolean(this.hass.user?.is_admin)&&["storage","default"].includes(this.hass.config.config_source),this._fetchData(),"/new"===this.route.path&&((0,l.oo)("/config/zone",{replace:!0}),this._createZone())}updated(){if(!this.route.path.startsWith("/edit/")||!this._stateItems||!this._storageItems)return;const t=this.route.path.slice(6);this._editZone(t),(0,l.oo)("/config/zone",{replace:!0}),this.narrow||this._zoomZone(t)}willUpdate(t){super.updated(t);const e=t.get("hass");e&&this._stateItems&&this._getStates(e)}async _fetchData(){this._storageItems=(await(0,y.YC)(this.hass)).sort((t,e)=>(0,h.xL)(t.name,e.name,this.hass.locale.language)),this._getStates()}_getStates(t){let e=!1;const a=Object.values(this.hass.states).filter(a=>"zone"===(0,c.t)(a)&&(t?.states[a.entity_id]!==a&&(e=!0),!this._regEntities.includes(a.entity_id)));e&&(this._stateItems=a)}_filterStates(){if(!this._stateItems)return;const t=this._stateItems.filter(t=>!this._regEntities.includes(t.entity_id));t.length!==this._stateItems.length&&(this._stateItems=t)}async _locationUpdated(t){if(this._activeEntry=t.detail.id,"zone.home"===t.detail.id&&this._canEditCore)return void await(0,u.Td)(this.hass,{latitude:t.detail.location[0],longitude:t.detail.location[1]});const e=this._storageItems.find(e=>e.id===t.detail.id);e&&this._updateEntry(e,{latitude:t.detail.location[0],longitude:t.detail.location[1]})}async _radiusUpdated(t){if(this._activeEntry=t.detail.id,"zone.home"===t.detail.id&&this._canEditCore)return void await(0,u.Td)(this.hass,{radius:Math.round(t.detail.radius)});const e=this._storageItems.find(e=>e.id===t.detail.id);e&&this._updateEntry(e,{radius:t.detail.radius})}_markerClicked(t){this._activeEntry=t.detail.id}_createZone(){this._openDialog()}_itemClicked(t){if(!(0,d.s)(t))return;if(this.narrow)return void this._openEditEntry(t);const e=t.currentTarget.value;this._zoomZone(e),this._activeEntry=e}_stateItemClicked(t){if(!(0,d.s)(t))return;const e=t.currentTarget.value;this.narrow&&"zone.home"===e?this._editHomeZone(t):(this._zoomZone(e),this._activeEntry=e)}async _zoomZone(t){this._map?.fitMarker(t)}async _editZone(t){await this.updateComplete,this.shadowRoot?.querySelector(`[id="${t}"]`)?.click()}_openEditEntry(t){const e=t.currentTarget.entry;this._openDialog(e),t.stopPropagation()}async _editHomeZone(t){t.currentTarget.noEdit?(0,w.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.zone.can_not_edit"),text:this.hass.localize("ui.panel.config.zone.configured_in_yaml")}):(0,$.k)(this,{updateEntry:t=>this._updateHomeZoneEntry(t)})}async _createEntry(t){const e=await(0,y.TW)(this.hass,t);this._storageItems=this._storageItems.concat(e).sort((t,e)=>(0,h.xL)(t.name,e.name,this.hass.locale.language)),this.narrow||(this._activeEntry=e.id,await this.updateComplete,await(this._map?.updateComplete),this._map?.fitMarker(e.id))}async _updateHomeZoneEntry(t){await(0,u.Td)(this.hass,{latitude:t.latitude,longitude:t.longitude,radius:t.radius}),this._zoomZone("zone.home")}async _updateEntry(t,e,a=!1){const i=await(0,y.G5)(this.hass,t.id,e);this._storageItems=this._storageItems.map(e=>e===t?i:e),!this.narrow&&a&&(this._activeEntry=t.id,await this.updateComplete,await(this._map?.updateComplete),this._map?.fitMarker(t.id))}async _removeEntry(t){if(!await(0,w.dk)(this,{title:this.hass.localize("ui.panel.config.zone.confirm_delete"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0}))return!1;try{return await(0,y.Yx)(this.hass,t.id),this._storageItems=this._storageItems.filter(e=>e!==t),this.narrow||this._map?.fitMap(),!0}catch(t){return!1}}async _openDialog(t){(0,z.b)(this,{entry:t,createEntry:t=>this._createEntry(t),updateEntry:t?e=>this._updateEntry(t,e,!0):void 0,removeEntry:t?()=>this._removeEntry(t):void 0})}constructor(...t){super(...t),this.isWide=!1,this.narrow=!1,this._searchParms=new URLSearchParams(window.location.search),this._activeEntry="",this._canEditCore=!1,this._regEntities=[],this._getZones=(0,n.A)((t,e)=>{const a=getComputedStyle(this),i=a.getPropertyValue("--accent-color"),o=a.getPropertyValue("--secondary-text-color"),r=a.getPropertyValue("--primary-color"),s=e.map(t=>({id:t.entity_id,icon:t.attributes.icon,name:t.attributes.friendly_name||t.entity_id,latitude:t.attributes.latitude,longitude:t.attributes.longitude,radius:t.attributes.radius,radius_color:"zone.home"===t.entity_id?r:t.attributes.passive?o:i,location_editable:"zone.home"===t.entity_id&&this._canEditCore,radius_editable:"zone.home"===t.entity_id&&this._canEditCore}));return t.map(t=>({...t,radius_color:t.passive?o:i,location_editable:!0,radius_editable:!0})).concat(s)})}}H.styles=r.AH`hass-loading-screen{--app-header-background-color:var(--sidebar-background-color);--app-header-text-color:var(--sidebar-text-color)}ha-list-item{--mdc-list-item-meta-size:48px}a{color:var(--primary-color)}ha-card{margin:16px auto;overflow:hidden}ha-icon,ha-icon-button:not([disabled]){color:var(--secondary-text-color)}ha-icon-button{--mdc-theme-text-disabled-on-light:var(--disabled-text-color)}.empty{text-align:center;padding:8px}.flex{display:flex;height:100%}.overflow{height:100%;overflow:auto}ha-locations-editor{flex-grow:1;height:100%}.flex ha-list{padding-bottom:64px}.flex .empty,.flex ha-list{border-left:1px solid var(--divider-color);width:250px;min-height:100%;box-sizing:border-box}ha-tooltip{display:block}`,(0,o.Cg)([(0,s.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"is-wide",type:Boolean})],H.prototype,"isWide",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],H.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],H.prototype,"route",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_searchParms",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_storageItems",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_stateItems",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_activeEntry",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_canEditCore",void 0),(0,o.Cg)([(0,s.P)("ha-locations-editor")],H.prototype,"_map",void 0),H=(0,o.Cg)([(0,s.EM)("ha-config-zone")],H),i()}catch(t){i(t)}})},59644(t,e,a){a.d(e,{k:()=>r});var i=a(1087);const o=()=>Promise.all([a.e(81810),a.e(53480),a.e(96700)]).then(a.bind(a,21296)),r=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-home-zone-detail",dialogImport:o,dialogParams:e})}},42952(t,e,a){a.d(e,{b:()=>r});var i=a(1087);const o=()=>Promise.all([a.e(59429),a.e(53480),a.e(29602)]).then(a.bind(a,29508)),r=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-zone-detail",dialogImport:o,dialogParams:e})}},14503(t,e,a){a.d(e,{RF:()=>r,dp:()=>c,kO:()=>n,nA:()=>s,og:()=>o});var i=a(5124);const o=i.AH`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,r=i.AH`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${o} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`,s=i.AH`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`,n=i.AH`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--mdc-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`,c=i.AH`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`;i.AH`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},88438(t,e,a){a.d(e,{C:()=>i});const i="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},89429(t){t.exports=function(){}}};