UNPKG

iobroker.lovelace

Version:

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

4 lines 35 kB
export const __rspack_esm_id=13128;export const __rspack_esm_ids=[13128];export const __webpack_modules__={63130(e,t,a){a.d(t,{l:()=>i});var o=a(50248);const i=async(e,t)=>{if(navigator.clipboard)try{return void await navigator.clipboard.writeText(e)}catch{}const a=t||(0,o.n)()?.getRootNode()||document.body,i=document.createElement("textarea");i.value=e,i.setAttribute("readonly",""),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.opacity="0",a.appendChild(i),i.select(),document.execCommand("copy"),a.removeChild(i)}},38962(e,t,a){a.a(e,async function(e,o){try{a.r(t);var i=a(62826),r=a(5124),n=a(22441),s=a(6412),l=a(93421),c=a(1087),d=a(26300),h=(a(67094),e([d]));d=(h.then?(await h)():h)[0];const p="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",u={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 b extends r.WF{render(){return r.qy` <div class="issue-type ${(0,s.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,s.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?r.qy`<div class="title">${this.title}</div>`:r.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?r.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:r.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}b.styles=r.AH`.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,i.Cg)([(0,n.MZ)()],b.prototype,"title",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"alert-type"})],b.prototype,"alertType",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"dismissable",void 0),(0,i.Cg)([(0,n.wk)(),(0,l.IW)()],b.prototype,"_localize",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"narrow",void 0),b=(0,i.Cg)([(0,n.EM)("ha-alert")],b),o()}catch(e){o(e)}})},11382(e,t,a){var o=a(62826),i=a(5124),r=a(22441),n=a(6412),s=a(1087),l=a(12587);a(67094);class c extends i.WF{render(){const e=this.noCollapse?i.s6:i.qy` <ha-svg-icon .path="${"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"}" class="summary-icon ${(0,n.H)({expanded:this.expanded})}"></ha-svg-icon> `;return i.qy` <div class="top ${(0,n.H)({expanded:this.expanded})}"> <div id="summary" class="${(0,n.H)({noCollapse:this.noCollapse})}" @click="${this._toggleContainer}" @keydown="${this._toggleContainer}" @focus="${this._focusChanged}" @blur="${this._focusChanged}" role="button" tabindex="${this.noCollapse?-1:0}" aria-expanded="${this.expanded}" aria-controls="sect1" part="summary"> ${this.leftChevron?e:i.s6} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${this.header} <slot class="secondary" name="secondary">${this.secondary}</slot> </div> </slot> <slot name="event"></slot> ${this.leftChevron?i.s6:e} <slot name="icons"></slot> </div> </div> <div class="container ${(0,n.H)({expanded:this.expanded})}" @transitionend="${this._handleTransitionEnd}" role="region" aria-labelledby="summary" aria-hidden="${!this.expanded}" tabindex="-1"> ${this._showContent?i.qy`<slot></slot>`:""} </div> `}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}}c.styles=i.AH`: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,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"expanded",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"outlined",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"left-chevron",type:Boolean,reflect:!0})],c.prototype,"leftChevron",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"no-collapse",type:Boolean,reflect:!0})],c.prototype,"noCollapse",void 0),(0,o.Cg)([(0,r.MZ)()],c.prototype,"header",void 0),(0,o.Cg)([(0,r.MZ)()],c.prototype,"secondary",void 0),(0,o.Cg)([(0,r.wk)()],c.prototype,"_showContent",void 0),(0,o.Cg)([(0,r.P)(".container")],c.prototype,"_container",void 0),c=(0,o.Cg)([(0,r.EM)("ha-expansion-panel")],c)},47680(e,t,a){a.r(t),a.d(t,{HaIcon:()=>x});a(74423);var o=a(62826),i=a(5124),r=a(22441),n=a(1087),s=a(9899),l=a(700),c=(a(44114),a(18111),a(7588),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=b().catch(e=>{throw p=void 0,e})),p),b=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},f=["mdi","hass","hassio","hademo"];let g=[];a(67094);const m={},v={},y=(0,s.s)(()=>(async e=>{const t=Object.keys(e),a=await Promise.allSettled(Object.values(e));(await u())("readwrite",o=>{a.forEach((a,i)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([e,t])=>{o.put(t,e)}),delete e[t[i]]})})})(v),2e3),w={},_={"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 x extends i.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?i.qy` <iron-icon .icon="${this.icon}"></iron-icon>`:i.qy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:i.s6}async _loadIcon(){if(!this.icon)return;const e=this.icon,[t,a]=this.icon.split(":",2);let o,i=a;if(!t||!i)return;if(!f.includes(t)){const a=l.y[t];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(i),e)):void(this._legacy=!0)}if(this._legacy=!1,i in m){const e=m[i];let a;e.newName?(a=`Icon ${t}:${i} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,i=e.newName):a=`Icon ${t}:${i} 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(i in w)return void(this._path=w[i]);if(i in _){const t=await _[i]();return this.icon===e&&(this._path=t),void(w[i]=t)}try{o=await(e=>new Promise((t,a)=>{if(g.push([e,t,a]),g.length>1)return;const o=u();(0,d.h)(1e3,(async()=>{(await o)("readonly",e=>{for(const[t,a,o]of g)(0,c.Yd)(e.get(t)).then(e=>a(e)).catch(e=>o(e));g=[]})})()).catch(e=>{for(const[,,t]of g)t(e);g=[]})}))(i)}catch(e){o=void 0}if(o)return this.icon===e&&(this._path=o),void(w[i]=o);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})(i);if(r in v)return void this._setPath(v[r],i,e);const s=fetch(`/static/mdi/${r}.json`).then(e=>e.json());v[r]=s,this._setPath(s,i,e),s.catch(()=>{delete v[r]}),y()}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 o=await e;this.icon===a&&(this._path=o[t]),w[t]=o[t]}catch(e){}}constructor(...e){super(...e),this._legacy=!1}}x.styles=i.AH`:host{fill:currentcolor}`,(0,o.Cg)([(0,r.MZ)()],x.prototype,"icon",void 0),(0,o.Cg)([(0,r.wk)()],x.prototype,"_path",void 0),(0,o.Cg)([(0,r.wk)()],x.prototype,"_secondaryPath",void 0),(0,o.Cg)([(0,r.wk)()],x.prototype,"_viewBox",void 0),(0,o.Cg)([(0,r.wk)()],x.prototype,"_legacy",void 0),x=(0,o.Cg)([(0,r.EM)("ha-icon")],x)},38377(e,t,a){a(74423),a(18111),a(22489),a(61701),a(18237);var o=a(62826),i=a(5124),r=a(22441),n=a(20889),s=a(30015),l=a.n(s),c=a(1087),d=(a(14603),a(47566),a(98721),a(2209));let h;var p=a(996);const u=e=>i.qy`${e}`,b=new p.G(1e3),f={reType:/(?<input>(\[!(?<type>caution|important|note|tip|warning)\])(?:\s|\\n)?)/i,typeToHaAlert:{caution:"error",important:"info",note:"info",tip:"success",warning:"warning"}};class g extends i.mN{disconnectedCallback(){if(super.disconnectedCallback(),this.cache){const e=this._computeCacheKey();b.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();b.has(e)&&((0,i.XX)(u((0,n._)(b.get(e))),this.renderRoot),this._resize())}}_computeCacheKey(){return l()({content:this.content,allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl,breaks:this.breaks})}async _render(){const e=await(async(e,t,o)=>(h||(h=(0,d.LV)(new Worker(new URL(a.p+a.u(55640),a.b)))),h.renderMarkdown(e,t,o)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl});(0,i.XX)(u((0,n._)(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){const a=e.firstElementChild?.firstChild?.textContent&&f.reType.exec(e.firstElementChild.firstChild.textContent);if(a){const{type:o}=a.groups,i=document.createElement("ha-alert");i.alertType=f.typeToHaAlert[o.toLowerCase()],i.append(...Array.from(e.childNodes).map(e=>{const t=Array.from(e.childNodes);if(!this.breaks&&t.length){const e=t[0];e.nodeType===Node.TEXT_NODE&&e.textContent===a.input&&e.textContent?.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(i,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,c.r)(this,"content-resize")}}(0,o.Cg)([(0,r.MZ)()],g.prototype,"content",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"allow-svg",type:Boolean})],g.prototype,"allowSvg",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"allow-data-url",type:Boolean})],g.prototype,"allowDataUrl",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"breaks",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"lazy-images"})],g.prototype,"lazyImages",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"cache",void 0),g=(0,o.Cg)([(0,r.EM)("ha-markdown-element")],g)},3587(e,t,a){var o=a(62826),i=a(5124),r=a(22441);a(38377);class n extends i.WF{async getUpdateComplete(){const e=await super.getUpdateComplete();return await(this._markdownElement?.updateComplete),e}render(){return this.content?i.qy`<ha-markdown-element .content="${this.content}" .allowSvg="${this.allowSvg}" .allowDataUrl="${this.allowDataUrl}" .breaks="${this.breaks}" .lazyImages="${this.lazyImages}" .cache="${this.cache}"></ha-markdown-element>`:i.s6}constructor(...e){super(...e),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1}}n.styles=i.AH`: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,o.Cg)([(0,r.MZ)()],n.prototype,"content",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"allow-svg",type:Boolean})],n.prototype,"allowSvg",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"allow-data-url",type:Boolean})],n.prototype,"allowDataUrl",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],n.prototype,"breaks",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"lazy-images"})],n.prototype,"lazyImages",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],n.prototype,"cache",void 0),(0,o.Cg)([(0,r.P)("ha-markdown-element")],n.prototype,"_markdownElement",void 0),n=(0,o.Cg)([(0,r.EM)("ha-markdown")],n)},65829(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{HaSpinner:()=>c});var i=a(62826),r=a(55262),n=a(5124),s=a(22441),l=e([r]);r=(l.then?(await l)():l)[0];class c 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,n.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,i.Cg)([(0,s.MZ)()],c.prototype,"size",void 0),c=(0,i.Cg)([(0,s.EM)("ha-spinner")],c),o()}catch(e){o(e)}})},700(e,t,a){a.d(t,{y:()=>n});const o=window;"customIconsets"in o||(o.customIconsets={});const i=o.customIconsets,r=window;"customIcons"in r||(r.customIcons={});const n=new Proxy(r.customIcons,{get:(e,t)=>e[t]??(i[t]?{getIcon:i[t]}:void 0)})},30722(e,t,a){a.a(e,async function(e,o){try{a.r(t);a(18111),a(61701),a(14603),a(47566),a(98721);var i=a(62826),r=a(5124),n=a(22441),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)),b=a(91485),f=a(35891),g=a(14503),m=a(36918),v=e([c,d,h,p,u,b]);[c,d,h,p,u,b]=v.then?(await v)():v;const y="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",w="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 _ 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(){if(!this._params)return r.s6;const e=this.hass.localize("ui.panel.config.blueprint.add.header");return r.qy` <ha-dialog .open="${this._open}" width="${this.large?"full":"medium"}" @closed="${this._dialogClosed}"> <ha-dialog-header slot="header"> <ha-icon-button slot="navigationIcon" @click="${this.closeDialog}" .label="${this.hass.localize("ui.common.close")}" .path="${y}"></ha-icon-button> <span slot="title" class="title-enlargeable" @click="${this._enlarge}"> ${e} </span> </ha-dialog-header> <div> ${this._error?r.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:this._sourceUrlWarning?r.qy` <ha-alert alert-type="warning" .title="${this.hass.localize("ui.panel.config.blueprint.add.source_warning_title")}"> ${this.hass.localize("ui.panel.config.blueprint.add.source_warning_description")} </ha-alert> `:r.s6} ${this._result?r.qy`${this.hass.localize("ui.panel.config.blueprint.add.import_header",{name:r.qy`<b>${this._result.blueprint.metadata.name}</b>`,domain:this._result.blueprint.metadata.domain})} <br> <ha-markdown breaks .content="${this._result.blueprint.metadata.description}"></ha-markdown> ${this._result.validation_errors?r.qy` <p class="error"> ${this.hass.localize("ui.panel.config.blueprint.add.unsupported_blueprint")} </p> <ul class="error"> ${this._result.validation_errors.map(e=>r.qy`<li>${e}</li>`)} </ul> `:r.qy` <ha-input id="input" .value="${this._result.suggested_filename||""}" .label="${this.hass.localize("ui.panel.config.blueprint.add.file_name")}" autofocus></ha-input> `} <ha-expansion-panel .header="${this.hass.localize("ui.panel.config.blueprint.add.raw_blueprint")}"> <ha-code-editor mode="yaml" .value="${this._result.raw_data}" read-only dir="ltr"></ha-code-editor> </ha-expansion-panel> ${this._result?.exists?r.qy` <ha-alert alert-type="warning" .title="${this.hass.localize("ui.panel.config.blueprint.add.override_title")}"> ${this.hass.localize("ui.panel.config.blueprint.add.override_description")} </ha-alert> `:r.s6} `:r.qy` <p> ${this.hass.localize("ui.panel.config.blueprint.add.import_introduction")} </p> <ha-button size="small" appearance="plain" href="${(0,m.o)(this.hass,"/get-blueprints")}" target="_blank" rel="noreferrer noopener"> ${this.hass.localize("ui.panel.config.blueprint.add.community_forums")} <ha-svg-icon slot="end" .path="${w}"></ha-svg-icon> </ha-button> <ha-input id="input" .label="${this.hass.localize("ui.panel.config.blueprint.add.url")}" .value="${this._url||""}" autofocus></ha-input> `} </div> <ha-dialog-footer slot="footer"> <ha-button appearance="plain" slot="secondaryAction" @click="${this.closeDialog}" .disabled="${this._saving}"> ${this.hass.localize("ui.common.cancel")} </ha-button> ${this._result?r.qy` <ha-button slot="primaryAction" @click="${this._save}" .disabled="${this._saving||!!this._result.validation_errors}" .loading="${this._saving}" .ariaLabel="${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")} </ha-button> `:r.qy` <ha-button slot="primaryAction" @click="${this._import}" .disabled="${this._importing}" .loading="${this._importing}" .ariaLabel="${this.hass.localize("ui.panel.config.blueprint.add."+(this._importing?"importing":"import_btn"))}"> ${this.hass.localize("ui.panel.config.blueprint.add.import_btn")} </ha-button> `} </ha-dialog-footer> </ha-dialog> `}_enlarge(){(0,l.J)(()=>{this.large=!this.large})}async _import(){this._url=void 0,this._importing=!0,this._error=void 0;try{const e=this._input?.value;if(!e)return void(this._error=this.hass.localize("ui.panel.config.blueprint.add.error_no_url"));this._sourceUrlWarning=!this._isTrustedBlueprintUrl(e),this._result=await(0,f.Jp)(this.hass,e),this._sourceUrlWarning=this._sourceUrlWarning||!this._isTrustedBlueprintUrl(this._result.blueprint.metadata.source_url)}catch(e){this._error=e.message}finally{this._importing=!1}}_isTrustedBlueprintUrl(e){if(!e)return!0;let t;try{t=new URL(e).hostname.toLowerCase()}catch{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{const e=this._input?.value;if(!e)return;await(0,f.Tk)(this.hass,this._result.blueprint.metadata.domain,e,this._result.raw_data,this._result.blueprint.metadata.source_url,this._result.exists),this._params.importedCallback(),this.closeDialog()}catch(e){this._error=e.message}finally{this._saving=!1}}constructor(...e){super(...e),this.large=!1,this._open=!1,this._importing=!1,this._saving=!1,this._sourceUrlWarning=!1}}_.styles=[g.nA,r.AH`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,i.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],_.prototype,"large",void 0),(0,i.Cg)([(0,n.wk)()],_.prototype,"_params",void 0),(0,i.Cg)([(0,n.wk)()],_.prototype,"_open",void 0),(0,i.Cg)([(0,n.wk)()],_.prototype,"_importing",void 0),(0,i.Cg)([(0,n.wk)()],_.prototype,"_saving",void 0),(0,i.Cg)([(0,n.wk)()],_.prototype,"_error",void 0),(0,i.Cg)([(0,n.wk)()],_.prototype,"_result",void 0),(0,i.Cg)([(0,n.wk)()],_.prototype,"_url",void 0),(0,i.Cg)([(0,n.wk)()],_.prototype,"_sourceUrlWarning",void 0),(0,i.Cg)([(0,n.P)("#input")],_.prototype,"_input",void 0),_=(0,i.Cg)([(0,n.EM)("ha-dialog-import-blueprint")],_),o()}catch(e){o(e)}})},996(e,t,a){a.d(t,{G:()=>o});a(45367),a(92731);class o{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(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=46571,e.exports=t},62003(e,t,a){var o={"./ha-icon-prev":["89133",[61982]],"./ha-icon-button-toolbar":["9882",[39763,76775]],"./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,85545]],"./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,85545]],"./ha-icon-button-arrow-next":["99028",[54101]],"./ha-icon-button-prev.ts":["45100",[99197]],"./ha-icon-picker":["64138",[39763,32450,46095,7305,92769,3283,26092,71749]],"./ha-icon-button-toolbar.ts":["9882",[39763,76775]],"./ha-icon-button-arrow-prev.ts":["90248",[17041]],"./ha-icon-button-next":["25440",[81049]],"./ha-icon-next":["43661",[63902]],"./ha-icon-picker.ts":["64138",[39763,32450,46095,7305,92769,3283,26092,71749]],"./ha-icon-prev.ts":["89133",[61982]],"./ha-icon-button-arrow-prev":["90248",[17041]],"./ha-icon-button-next.ts":["25440",[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 i(e){if(!a.o(o,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=o[e],i=t[0];return Promise.all(t[1].map(a.e)).then(()=>a(i))}i.keys=()=>Object.keys(o),i.id=62003,e.exports=i},65213(e,t,a){var o=a(44576),i=a(79039),r=o.RegExp,n=!i(function(){var e=!0;try{r(".","d")}catch(t){e=!1}var t={},a="",o=e?"dgimsy":"gimsy",i=function(e,o){Object.defineProperty(t,e,{get:function(){return a+=o,!0}})},n={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in e&&(n.hasIndices="d"),n)i(s,n[s]);return Object.getOwnPropertyDescriptor(r.prototype,"flags").get.call(t)!==o||a!==o});e.exports={correct:n}},67979(e,t,a){var o=a(28551);e.exports=function(){var e=o(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},69479(e,t,a){var o=a(43724),i=a(62106),r=a(65213),n=a(67979);o&&!r.correct&&(i(RegExp.prototype,"flags",{configurable:!0,get:n}),r.correct=!0)},95192(e,t,a){a.d(t,{IU:()=>c,Jt:()=>s,Yd:()=>o,hZ:()=>l,y$:()=>i});a(44114),a(18111),a(7588),a(61701);function o(e){return new Promise((t,a)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>a(e.error)})}function i(e,t){let a;return(i,r)=>(()=>{if(a)return a;const i=indexedDB.open(e);return i.onupgradeneeded=()=>i.result.createObjectStore(t),a=o(i),a.then(e=>{e.onclose=()=>a=void 0},()=>{}),a})().then(e=>r(e.transaction(t,i).objectStore(t)))}let r;function n(){return r||(r=i("keyval-store","keyval")),r}function s(e,t=n()){return t("readonly",t=>o(t.get(e)))}function l(e,t,a=n()){return a("readwrite",a=>(a.put(t,e),o(a.transaction)))}function c(e=n()){return e("readwrite",e=>(e.clear(),o(e.transaction)))}}};