UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

4 lines 36.5 kB
(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[86818],{63130:function(e,t,a){"use strict";a.d(t,{l:function(){return o}});a(3362);var i=a(50248);const o=async(e,t)=>{var a;if(navigator.clipboard)try{return void(await navigator.clipboard.writeText(e))}catch(n){}const o=t||(null===(a=(0,i.n)())||void 0===a?void 0:a.getRootNode())||document.body,r=document.createElement("textarea");r.value=e,r.setAttribute("readonly",""),r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.opacity="0",o.appendChild(r),r.select(),document.execCommand("copy"),o.removeChild(r)}},38962:function(e,t,a){"use strict";a.a(e,async function(e,i){try{a.r(t);a(62953);var o=a(40445),r=a(5124),n=a(67576),s=a(6412),l=a(93421),c=a(1087),d=a(26300),h=(a(67094),e([d]));d=(h.then?(await h)():h)[0];let p,u,f,b,g=e=>e;const v="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",m={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class y extends r.WF{render(){var e;return(0,r.qy)(p||(p=g` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,s.H)({[this.alertType]:!0}),this.title?"":"no-title",m[this.alertType],(0,s.H)({content:!0,narrow:this.narrow}),this.title?(0,r.qy)(u||(u=g`<div class="title">${0}</div>`),this.title):r.s6,this.dismissable?(0,r.qy)(f||(f=g`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(e=this._localize)||void 0===e?void 0:e.call(this,"ui.common.dismiss_alert"),v):r.s6)}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}y.styles=(0,r.AH)(b||(b=g`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`)),(0,o.Cg)([(0,n.MZ)()],y.prototype,"title",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"alert-type"})],y.prototype,"alertType",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],y.prototype,"dismissable",void 0),(0,o.Cg)([(0,n.wk)(),(0,l.IW)()],y.prototype,"_localize",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],y.prototype,"narrow",void 0),y=(0,o.Cg)([(0,n.EM)("ha-alert")],y),i()}catch(p){i(p)}})},11382:function(e,t,a){"use strict";a(3362),a(62953);var i=a(40445),o=a(5124),r=a(67576),n=a(6412),s=a(1087),l=a(12587);a(67094);let c,d,h,p,u=e=>e;class f extends o.WF{render(){const e=this.noCollapse?o.s6:(0,o.qy)(c||(c=u` <ha-svg-icon .path="${0}" class="summary-icon ${0}"></ha-svg-icon> `),"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",(0,n.H)({expanded:this.expanded}));return(0,o.qy)(d||(d=u` <div class="top ${0}"> <div id="summary" class="${0}" @click="${0}" @keydown="${0}" @focus="${0}" @blur="${0}" role="button" tabindex="${0}" aria-expanded="${0}" aria-controls="sect1" part="summary"> ${0} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${0} <slot class="secondary" name="secondary">${0}</slot> </div> </slot> <slot name="event"></slot> ${0} <slot name="icons"></slot> </div> </div> <div class="container ${0}" @transitionend="${0}" role="region" aria-labelledby="summary" aria-hidden="${0}" tabindex="-1"> ${0} </div> `),(0,n.H)({expanded:this.expanded}),(0,n.H)({noCollapse:this.noCollapse}),this._toggleContainer,this._toggleContainer,this._focusChanged,this._focusChanged,this.noCollapse?-1:0,this.expanded,this.leftChevron?e:o.s6,this.header,this.secondary,this.leftChevron?o.s6:e,(0,n.H)({expanded:this.expanded}),this._handleTransitionEnd,!this.expanded,this._showContent?(0,o.qy)(h||(h=u`<slot></slot>`)):"")}willUpdate(e){super.willUpdate(e),e.has("expanded")&&(this._showContent=this.expanded,setTimeout(()=>{this._container.style.overflow=this.expanded?"initial":"hidden"},300))}_handleTransitionEnd(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}async _toggleContainer(e){if(e.defaultPrevented)return;if("keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;if(e.preventDefault(),this.noCollapse)return;const t=!this.expanded;(0,s.r)(this,"expanded-will-change",{expanded:t}),this._container.style.overflow="hidden",t&&(this._showContent=!0,await(0,l.E)());const a=this._container.scrollHeight;this._container.style.height=`${a}px`,t||setTimeout(()=>{this._container.style.height="0px"},0),this.expanded=t,(0,s.r)(this,"expanded-changed",{expanded:this.expanded})}_focusChanged(e){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===e.type)}constructor(...e){super(...e),this.expanded=!1,this.outlined=!1,this.leftChevron=!1,this.noCollapse=!1,this._showContent=this.expanded}}f.styles=(0,o.AH)(p||(p=u`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;border-radius:var(--ha-border-radius-circle)}#summary:focus-visible ha-svg-icon.summary-icon{background-color:var(--ha-color-fill-neutral-normal-active)}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:var(--ha-font-weight-medium);outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1;overflow-wrap:anywhere;color:var(--primary-text-color)}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:var(--ha-font-size-s)}`)),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],f.prototype,"expanded",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],f.prototype,"outlined",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"left-chevron",type:Boolean,reflect:!0})],f.prototype,"leftChevron",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"no-collapse",type:Boolean,reflect:!0})],f.prototype,"noCollapse",void 0),(0,i.Cg)([(0,r.MZ)()],f.prototype,"header",void 0),(0,i.Cg)([(0,r.MZ)()],f.prototype,"secondary",void 0),(0,i.Cg)([(0,r.wk)()],f.prototype,"_showContent",void 0),(0,i.Cg)([(0,r.P)(".container")],f.prototype,"_container",void 0),f=(0,i.Cg)([(0,r.EM)("ha-expansion-panel")],f)},47680:function(e,t,a){"use strict";a.r(t),a.d(t,{HaIcon:function(){return M}});a(74423),a(3362),a(62953);var i=a(40445),o=a(5124),r=a(67576),n=a(1087),s=a(9899),l=a(700),c=(a(44114),a(18111),a(7588),a(96167),a(95192)),d=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 u=()=>(p||(p=f().catch(e=>{throw p=void 0,e})),p),f=async()=>{const e=(0,c.y$)("hass-icon-db","mdi-icon-store"),t=await(0,c.Jt)("_version",e);return t?t!==h.version&&(await(0,c.IU)(e),(0,c.hZ)("_version",h.version,e)):(0,c.hZ)("_version",h.version,e),e},b=["mdi","hass","hassio","hademo"];let g=[];a(67094);let v,m,y,w=e=>e;const _={},x={},k=(0,s.s)(()=>(async e=>{const t=Object.keys(e),a=await Promise.allSettled(Object.values(e));(await u())("readwrite",i=>{a.forEach((a,o)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([e,t])=>{i.put(t,e)}),delete e[t[o]]})})})(x),2e3),C={},$={"home-assistant":()=>a.e(58781).then(a.bind(a,53580)).then(e=>e.mdiHomeAssistant),"music-assistant":()=>a.e(56009).then(a.bind(a,10576)).then(e=>e.mdiMusicAssistant),esphome:()=>a.e(88800).then(a.bind(a,45091)).then(e=>e.mdiEsphomeLogo)};class M extends o.WF{willUpdate(e){super.willUpdate(e),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?(0,o.qy)(v||(v=w` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,o.qy)(m||(m=w`<ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon>`),this._path,this._secondaryPath,this._viewBox):o.s6}async _loadIcon(){if(!this.icon)return;const e=this.icon,[t,a]=this.icon.split(":",2);let i,o=a;if(!t||!o)return;if(!b.includes(t)){const a=l.y[t];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(o),e)):void(this._legacy=!0)}if(this._legacy=!1,o in _){const e=_[o];let a;e.newName?(a=`Icon ${t}:${o} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,o=e.newName):a=`Icon ${t}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(a),(0,n.r)(this,"write_log",{level:"warning",message:a})}if(o in C)return void(this._path=C[o]);if(o in $){const t=await $[o]();return this.icon===e&&(this._path=t),void(C[o]=t)}try{i=await(e=>new Promise((t,a)=>{if(g.push([e,t,a]),g.length>1)return;const i=u();(0,d.h)(1e3,(async()=>{(await i)("readonly",e=>{for(const[t,a,i]of g)(0,c.Yd)(e.get(t)).then(e=>a(e)).catch(e=>i(e));g=[]})})()).catch(e=>{for(const[,,t]of g)t(e);g=[]})}))(o)}catch(p){i=void 0}if(i)return this.icon===e&&(this._path=i),void(C[o]=i);const r=(e=>{let t;for(const a of h.parts){if(void 0!==a.start&&e<a.start)break;t=a}return t.file})(o);if(r in x)return void this._setPath(x[r],o,e);const s=fetch(`/static/mdi/${r}.json`).then(e=>e.json());x[r]=s,this._setPath(s,o,e),s.catch(()=>{delete x[r]}),k()}async _setCustomPath(e,t){const a=await e;this.icon===t&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}async _setPath(e,t,a){try{const i=await e;this.icon===a&&(this._path=i[t]),C[t]=i[t]}catch(i){}}constructor(...e){super(...e),this._legacy=!1}}M.styles=(0,o.AH)(y||(y=w`:host{fill:currentcolor}`)),(0,i.Cg)([(0,r.MZ)()],M.prototype,"icon",void 0),(0,i.Cg)([(0,r.wk)()],M.prototype,"_path",void 0),(0,i.Cg)([(0,r.wk)()],M.prototype,"_secondaryPath",void 0),(0,i.Cg)([(0,r.wk)()],M.prototype,"_viewBox",void 0),(0,i.Cg)([(0,r.wk)()],M.prototype,"_legacy",void 0),M=(0,i.Cg)([(0,r.EM)("ha-icon")],M)},38377:function(e,t,a){"use strict";var i=a(59787),o=(a(74423),a(72712),a(18111),a(22489),a(61701),a(18237),a(3362),a(27495),a(62953),a(40445)),r=a(5124),n=a(67576),s=a(20889),l=a(30015),c=a.n(l),d=a(1087),h=(a(3296),a(27208),a(48408),a(14603),a(47566),a(98721),a(2209));let p;var u=a(996);let f,b=e=>e;const g=e=>(0,r.qy)(f||(f=b`${0}`),e),v=new u.G(1e3),m={reType:(0,i.A)(/((\[!(caution|important|note|tip|warning)\])(?:\s|\\n)?)/i,{input:1,type:3}),typeToHaAlert:{caution:"error",important:"info",note:"info",tip:"success",warning:"warning"}};class y extends r.mN{disconnectedCallback(){if(super.disconnectedCallback(),this.cache){const e=this._computeCacheKey();v.set(e,this.innerHTML)}}createRenderRoot(){return this}update(e){super.update(e),void 0!==this.content&&(this._renderPromise=this._render())}async getUpdateComplete(){return await super.getUpdateComplete(),await this._renderPromise,!0}willUpdate(e){if(!this.innerHTML&&this.cache){const e=this._computeCacheKey();v.has(e)&&((0,r.XX)(g((0,s._)(v.get(e))),this.renderRoot),this._resize())}}_computeCacheKey(){return c()({content:this.content,allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl,breaks:this.breaks})}async _render(){const e=await(async(e,t,i)=>(p||(p=(0,h.LV)(new Worker(new URL(a.p+a.u(55640),a.b)))),p.renderMarkdown(e,t,i)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl});(0,r.XX)(g((0,s._)(e.join(""))),this.renderRoot),this._resize();const t=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,null);for(;t.nextNode();){const e=t.currentNode;if(e instanceof HTMLAnchorElement&&e.host!==document.location.host)e.target="_blank",e.rel="noreferrer noopener";else if(e instanceof HTMLImageElement)this.lazyImages&&(e.loading="lazy"),e.addEventListener("load",this._resize);else if(e instanceof HTMLQuoteElement){var i;const a=(null===(i=e.firstElementChild)||void 0===i||null===(i=i.firstChild)||void 0===i?void 0:i.textContent)&&m.reType.exec(e.firstElementChild.firstChild.textContent);if(a){const{type:i}=a.groups,o=document.createElement("ha-alert");o.alertType=m.typeToHaAlert[i.toLowerCase()],o.append(...Array.from(e.childNodes).map(e=>{const t=Array.from(e.childNodes);if(!this.breaks&&t.length){var i;const e=t[0];e.nodeType===Node.TEXT_NODE&&e.textContent===a.input&&null!==(i=e.textContent)&&void 0!==i&&i.includes("\n")&&(e.textContent=e.textContent.split("\n").slice(1).join("\n"))}return t}).reduce((e,t)=>e.concat(t),[]).filter(e=>e.textContent&&e.textContent!==a.input)),t.parentNode().replaceChild(o,e)}}else e instanceof HTMLElement&&["ha-alert","ha-qr-code","ha-icon","ha-svg-icon"].includes(e.localName)&&a(62003)(`./${e.localName}`)}}constructor(...e){super(...e),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1,this._renderPromise=Promise.resolve(),this._resize=()=>(0,d.r)(this,"content-resize")}}(0,o.Cg)([(0,n.MZ)()],y.prototype,"content",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"allow-svg",type:Boolean})],y.prototype,"allowSvg",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"allow-data-url",type:Boolean})],y.prototype,"allowDataUrl",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],y.prototype,"breaks",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"lazy-images"})],y.prototype,"lazyImages",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],y.prototype,"cache",void 0),y=(0,o.Cg)([(0,n.EM)("ha-markdown-element")],y)},3587:function(e,t,a){"use strict";a(3362),a(62953);var i=a(40445),o=a(5124),r=a(67576);a(38377);let n,s,l=e=>e;class c extends o.WF{async getUpdateComplete(){var e;const t=await super.getUpdateComplete();return await(null===(e=this._markdownElement)||void 0===e?void 0:e.updateComplete),t}render(){return this.content?(0,o.qy)(n||(n=l`<ha-markdown-element .content="${0}" .allowSvg="${0}" .allowDataUrl="${0}" .breaks="${0}" .lazyImages="${0}" .cache="${0}"></ha-markdown-element>`),this.content,this.allowSvg,this.allowDataUrl,this.breaks,this.lazyImages,this.cache):o.s6}constructor(...e){super(...e),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1}}c.styles=(0,o.AH)(s||(s=l`:host{display:block}ha-markdown-element{-ms-user-select:text;-webkit-user-select:text;-moz-user-select:text}ha-markdown-element>:first-child{margin-top:0}ha-markdown-element>:last-child{margin-bottom:0}ha-alert{display:block;margin:var(--ha-space-1) 0}a{color:var(--markdown-link-color,var(--primary-color))}img{background-color:var(--markdown-image-background-color);border-radius:var(--markdown-image-border-radius);max-width:100%}p:first-child>img:first-child{vertical-align:top}p:first-child>img:last-child{vertical-align:top}ha-markdown-element>:is(ol,ul){padding-inline-start:var(--markdown-list-indent,revert)}li:has(input[type=checkbox]){list-style:none}li:has(input[type=checkbox])>input[type=checkbox]{margin-left:0}svg{background-color:var(--markdown-svg-background-color,none);color:var(--markdown-svg-color,none)}code,pre{background-color:var(--markdown-code-background-color,none);border-radius:var(--ha-border-radius-sm);color:var(--markdown-code-text-color,inherit)}code{font-size:var(--ha-font-size-s);padding:.2em .4em}pre code{padding:0}pre{padding:var(--ha-space-4);overflow:auto;line-height:var(--ha-line-height-condensed);font-family:var(--ha-font-family-code)}h1,h2,h3,h4,h5,h6{line-height:initial}h2{font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-bold)}hr{border-color:var(--divider-color);border-bottom:none;margin:var(--ha-space-4) 0}table[role=presentation]{--markdown-table-border-collapse:separate;--markdown-table-border-width:0;--markdown-table-padding-inline:0;--markdown-table-padding-block:0}table[role=presentation] td,table[role=presentation] th{vertical-align:middle}table[role=presentation] td[valign=top],table[role=presentation] th[valign=top]{vertical-align:top}table[role=presentation] td[valign=middle],table[role=presentation] th[valign=middle]{vertical-align:middle}table[role=presentation] td[valign=bottom],table[role=presentation] th[valign=bottom]{vertical-align:bottom}table[role=presentation] td[valign=baseline],table[role=presentation] th[valign=baseline]{vertical-align:baseline}@supports (border-width:attr(border px,0)){table[role=presentation]{--markdown-table-border-width:attr(border px, 0)}table[role=presentation] td,table[role=presentation] th{vertical-align:attr(valign,middle)}}table[role=presentation][border="0"]{--markdown-table-border-width:0}table[role=presentation][border="1"]{--markdown-table-border-width:1px}table[role=presentation][border="2"]{--markdown-table-border-width:2px}table[role=presentation][border="3"]{--markdown-table-border-width:3px}table{border-collapse:var(--markdown-table-border-collapse,collapse)}div:has(> table){overflow:auto}th{text-align:var(--markdown-table-text-align,start)}td,th{border-width:var(--markdown-table-border-width,1px);border-style:var(--markdown-table-border-style,solid);border-color:var(--markdown-table-border-color,var(--divider-color));padding-inline:var(--markdown-table-padding-inline,0.5em);padding-block:var(--markdown-table-padding-block,0.25em)}blockquote{border-left:4px solid var(--divider-color);margin-inline:0;padding-inline:1em}`)),(0,i.Cg)([(0,r.MZ)()],c.prototype,"content",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"allow-svg",type:Boolean})],c.prototype,"allowSvg",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"allow-data-url",type:Boolean})],c.prototype,"allowDataUrl",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],c.prototype,"breaks",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"lazy-images"})],c.prototype,"lazyImages",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],c.prototype,"cache",void 0),(0,i.Cg)([(0,r.P)("ha-markdown-element")],c.prototype,"_markdownElement",void 0),c=(0,i.Cg)([(0,r.EM)("ha-markdown")],c)},65829:function(e,t,a){"use strict";a.a(e,async function(e,i){try{a.r(t),a.d(t,{HaSpinner:function(){return h}});var o=a(40445),r=a(55262),n=a(5124),s=a(67576),l=e([r]);r=(l.then?(await l)():l)[0];let c,d=e=>e;class h extends r.A{updated(e){if(super.updated(e),e.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,(0,n.AH)(c||(c=d`: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,s.MZ)()],h.prototype,"size",void 0),h=(0,o.Cg)([(0,s.EM)("ha-spinner")],h),i()}catch(c){i(c)}})},700:function(e,t,a){"use strict";a.d(t,{y:function(){return n}});const i=window;"customIconsets"in i||(i.customIconsets={});const o=i.customIconsets,r=window;"customIcons"in r||(r.customIcons={});const n=new Proxy(r.customIcons,{get:(e,t)=>{var a;return null!==(a=e[t])&&void 0!==a?a:o[t]?{getIcon:o[t]}:void 0}})},30722:function(e,t,a){"use strict";a.a(e,async function(e,i){try{a.r(t);a(89463),a(18111),a(61701),a(3362),a(62953),a(3296),a(27208),a(48408),a(14603),a(47566),a(98721);var o=a(40445),r=a(5124),n=a(67576),s=a(1087),l=a(64481),c=a(38962),d=a(18350),h=a(15717),p=a(72554),u=(a(93444),a(76538),a(11382),a(3587),a(65829)),f=a(91485),b=a(35891),g=a(14503),v=a(36918),m=e([c,d,h,p,u,f]);[c,d,h,p,u,f]=m.then?(await m)():m;let y,w,_,x,k,C,$,M,z,L,H,A,U,E=e=>e;const Z="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",T="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z";class P extends r.WF{showDialog(e){this._params=e,this._error=void 0,this._url=this._params.url,this._sourceUrlWarning=!this._isTrustedBlueprintUrl(this._url),this.large=!1,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._error=void 0,this._result=void 0,this._params=void 0,this._url=void 0,this._sourceUrlWarning=!1,(0,s.r)(this,"dialog-closed",{dialog:this.localName})}render(){var e;if(!this._params)return r.s6;const t=this.hass.localize("ui.panel.config.blueprint.add.header");return(0,r.qy)(y||(y=E` <ha-dialog .open="${0}" width="${0}" @closed="${0}"> <ha-dialog-header slot="header"> <ha-icon-button slot="navigationIcon" @click="${0}" .label="${0}" .path="${0}"></ha-icon-button> <span slot="title" class="title-enlargeable" @click="${0}"> ${0} </span> </ha-dialog-header> <div> ${0} ${0} </div> <ha-dialog-footer slot="footer"> <ha-button appearance="plain" slot="secondaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> ${0} </ha-dialog-footer> </ha-dialog> `),this._open,this.large?"full":"medium",this._dialogClosed,this.closeDialog,this.hass.localize("ui.common.close"),Z,this._enlarge,t,this._error?(0,r.qy)(w||(w=E`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):this._sourceUrlWarning?(0,r.qy)(_||(_=E` <ha-alert alert-type="warning" .title="${0}"> ${0} </ha-alert> `),this.hass.localize("ui.panel.config.blueprint.add.source_warning_title"),this.hass.localize("ui.panel.config.blueprint.add.source_warning_description")):r.s6,this._result?(0,r.qy)(x||(x=E`${0} <br> <ha-markdown breaks .content="${0}"></ha-markdown> ${0} <ha-expansion-panel .header="${0}"> <ha-code-editor mode="yaml" .value="${0}" read-only dir="ltr"></ha-code-editor> </ha-expansion-panel> ${0} `),this.hass.localize("ui.panel.config.blueprint.add.import_header",{name:(0,r.qy)(k||(k=E`<b>${0}</b>`),this._result.blueprint.metadata.name),domain:this._result.blueprint.metadata.domain}),this._result.blueprint.metadata.description,this._result.validation_errors?(0,r.qy)(C||(C=E` <p class="error"> ${0} </p> <ul class="error"> ${0} </ul> `),this.hass.localize("ui.panel.config.blueprint.add.unsupported_blueprint"),this._result.validation_errors.map(e=>(0,r.qy)($||($=E`<li>${0}</li>`),e))):(0,r.qy)(M||(M=E` <ha-input id="input" .value="${0}" .label="${0}" autofocus></ha-input> `),this._result.suggested_filename||"",this.hass.localize("ui.panel.config.blueprint.add.file_name")),this.hass.localize("ui.panel.config.blueprint.add.raw_blueprint"),this._result.raw_data,null!==(e=this._result)&&void 0!==e&&e.exists?(0,r.qy)(z||(z=E` <ha-alert alert-type="warning" .title="${0}"> ${0} </ha-alert> `),this.hass.localize("ui.panel.config.blueprint.add.override_title"),this.hass.localize("ui.panel.config.blueprint.add.override_description")):r.s6):(0,r.qy)(L||(L=E` <p> ${0} </p> <ha-button size="small" appearance="plain" href="${0}" target="_blank" rel="noreferrer noopener"> ${0} <ha-svg-icon slot="end" .path="${0}"></ha-svg-icon> </ha-button> <ha-input id="input" .label="${0}" .value="${0}" autofocus></ha-input> `),this.hass.localize("ui.panel.config.blueprint.add.import_introduction"),(0,v.o)(this.hass,"/get-blueprints"),this.hass.localize("ui.panel.config.blueprint.add.community_forums"),T,this.hass.localize("ui.panel.config.blueprint.add.url"),this._url||""),this.closeDialog,this._saving,this.hass.localize("ui.common.cancel"),this._result?(0,r.qy)(A||(A=E` <ha-button slot="primaryAction" @click="${0}" .disabled="${0}" .loading="${0}" .ariaLabel="${0}"> ${0} </ha-button> `),this._save,this._saving||!!this._result.validation_errors,this._saving,this.hass.localize("ui.panel.config.blueprint.add."+(this._saving?"saving":this._result.exists?"save_btn_override":"save_btn")),this._result.exists?this.hass.localize("ui.panel.config.blueprint.add.save_btn_override"):this.hass.localize("ui.panel.config.blueprint.add.save_btn")):(0,r.qy)(H||(H=E` <ha-button slot="primaryAction" @click="${0}" .disabled="${0}" .loading="${0}" .ariaLabel="${0}"> ${0} </ha-button> `),this._import,this._importing,this._importing,this.hass.localize("ui.panel.config.blueprint.add."+(this._importing?"importing":"import_btn")),this.hass.localize("ui.panel.config.blueprint.add.import_btn")))}_enlarge(){(0,l.J)(()=>{this.large=!this.large})}async _import(){this._url=void 0,this._importing=!0,this._error=void 0;try{var e;const t=null===(e=this._input)||void 0===e?void 0:e.value;if(!t)return void(this._error=this.hass.localize("ui.panel.config.blueprint.add.error_no_url"));this._sourceUrlWarning=!this._isTrustedBlueprintUrl(t),this._result=await(0,b.Jp)(this.hass,t),this._sourceUrlWarning=this._sourceUrlWarning||!this._isTrustedBlueprintUrl(this._result.blueprint.metadata.source_url)}catch(t){this._error=t.message}finally{this._importing=!1}}_isTrustedBlueprintUrl(e){if(!e)return!0;let t;try{t=new URL(e).hostname.toLowerCase()}catch(a){return!1}return"github.com"===t||t.endsWith(".github.com")||t.endsWith(".githubusercontent.com")||"home-assistant.io"===t||t.endsWith(".home-assistant.io")}async _save(){this._saving=!0;try{var e;const t=null===(e=this._input)||void 0===e?void 0:e.value;if(!t)return;await(0,b.Tk)(this.hass,this._result.blueprint.metadata.domain,t,this._result.raw_data,this._result.blueprint.metadata.source_url,this._result.exists),this._params.importedCallback(),this.closeDialog()}catch(t){this._error=t.message}finally{this._saving=!1}}constructor(...e){super(...e),this.large=!1,this._open=!1,this._importing=!1,this._saving=!1,this._sourceUrlWarning=!1}}P.styles=[g.nA,(0,r.AH)(U||(U=E`p{margin-top:0;margin-bottom:var(--ha-space-2)}ha-input{margin-top:var(--ha-space-6)}ha-alert{display:block;margin-bottom:var(--ha-space-2)}a{text-decoration:none}a ha-svg-icon{--mdc-icon-size:16px}ha-expansion-panel{--expansion-panel-content-padding:0px}.title-enlargeable{display:block}`))],(0,o.Cg)([(0,n.MZ)({attribute:!1})],P.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],P.prototype,"large",void 0),(0,o.Cg)([(0,n.wk)()],P.prototype,"_params",void 0),(0,o.Cg)([(0,n.wk)()],P.prototype,"_open",void 0),(0,o.Cg)([(0,n.wk)()],P.prototype,"_importing",void 0),(0,o.Cg)([(0,n.wk)()],P.prototype,"_saving",void 0),(0,o.Cg)([(0,n.wk)()],P.prototype,"_error",void 0),(0,o.Cg)([(0,n.wk)()],P.prototype,"_result",void 0),(0,o.Cg)([(0,n.wk)()],P.prototype,"_url",void 0),(0,o.Cg)([(0,n.wk)()],P.prototype,"_sourceUrlWarning",void 0),(0,o.Cg)([(0,n.P)("#input")],P.prototype,"_input",void 0),P=(0,o.Cg)([(0,n.EM)("ha-dialog-import-blueprint")],P),i()}catch(y){i(y)}})},996:function(e,t,a){"use strict";a.d(t,{G:function(){return i}});a(45367),a(92731),a(62953);class i{get(e){return this._cache.get(e)}set(e,t){this._cache.set(e,t),this._expiration&&window.setTimeout(()=>this._cache.delete(e),this._expiration)}has(e){return this._cache.has(e)}constructor(e){this._cache=new Map,this._expiration=e}}},46571:function(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=46571,e.exports=t},62003:function(e,t,a){var i={"./ha-icon-prev":["89133",[61982]],"./ha-icon-button-toolbar":["9882",[39763,41983]],"./ha-alert":["38962",[19695]],"./ha-icon-button-toggle":["62501",[77254]],"./ha-svg-icon.ts":["67094",[]],"./ha-alert.ts":["38962",[19695]],"./ha-icon":["47680",[44889]],"./ha-icon-next.ts":["43661",[63902]],"./ha-qr-code.ts":["60543",[51343,62740]],"./ha-icon-overflow-menu.ts":["75248",[39763,34995,78097]],"./ha-icon-button-toggle.ts":["62501",[77254]],"./ha-icon-button-group":["39826",[13647]],"./ha-svg-icon":["67094",[]],"./ha-icon-button-prev":["45100",[99197]],"./ha-icon-button.ts":["26300",[]],"./ha-icon-overflow-menu":["75248",[39763,34995,78097]],"./ha-icon-button-arrow-next":["99028",[54101]],"./ha-icon-button-prev.ts":["45100",[99197]],"./ha-icon-picker":["64138",[39763,32450,46095,7305,92769,3283,62574,26092,39005,32301]],"./ha-icon-button-toolbar.ts":["9882",[39763,41983]],"./ha-icon-button-arrow-prev.ts":["90248",[17041]],"./ha-icon-button-next":["3059",[81049]],"./ha-icon-next":["43661",[63902]],"./ha-icon-picker.ts":["64138",[39763,32450,46095,7305,92769,3283,62574,26092,39005,32301]],"./ha-icon-prev.ts":["89133",[61982]],"./ha-icon-button-arrow-prev":["90248",[17041]],"./ha-icon-button-next.ts":["3059",[81049]],"./ha-icon.ts":["47680",[44889]],"./ha-qr-code":["60543",[51343,62740]],"./ha-icon-button":["26300",[]],"./ha-icon-button-group.ts":["39826",[13647]],"./ha-icon-button-arrow-next.ts":["99028",[54101]]};function o(e){if(!a.o(i,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=i[e],o=t[0];return Promise.all(t[1].map(a.e)).then(function(){return a(o)})}o.keys=function(){return Object.keys(i)},o.id=62003,e.exports=o},69479:function(e,t,a){"use strict";var i=a(43724),o=a(62106),r=a(65213),n=a(67979);i&&!r.correct&&(o(RegExp.prototype,"flags",{configurable:!0,get:n}),r.correct=!0)},13611:function(e,t,a){"use strict";var i=a(46518),o=a(44576),r=a(62106),n=a(43724),s=TypeError,l=Object.defineProperty,c=o.self!==o;try{if(n){var d=Object.getOwnPropertyDescriptor(o,"self");!c&&d&&d.get&&d.enumerable||r(o,"self",{get:function(){return o},set:function(e){if(this!==o)throw new s("Illegal invocation");l(o,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:c},{self:o})}catch(h){}},95192:function(e,t,a){"use strict";a.d(t,{IU:function(){return c},Jt:function(){return s},Yd:function(){return i},hZ:function(){return l},y$:function(){return o}});a(44114),a(18111),a(7588),a(61701),a(3362),a(62953);function i(e){return new Promise((t,a)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>a(e.error)})}function o(e,t){let a;return(o,r)=>(()=>{if(a)return a;const o=indexedDB.open(e);return o.onupgradeneeded=()=>o.result.createObjectStore(t),a=i(o),a.then(e=>{e.onclose=()=>a=void 0},()=>{}),a})().then(e=>r(e.transaction(t,o).objectStore(t)))}let r;function n(){return r||(r=o("keyval-store","keyval")),r}function s(e,t=n()){return t("readonly",t=>i(t.get(e)))}function l(e,t,a=n()){return a("readwrite",a=>(a.put(t,e),i(a.transaction)))}function c(e=n()){return e("readwrite",e=>(e.clear(),i(e.transaction)))}}}]);