UNPKG

iobroker.lovelace

Version:

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

4 lines 48.3 kB
(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[55392],{78011:function(e,t,i){"use strict";i.d(t,{x:function(){return s}});i(27495);const a=/^(\w+)\.(\w+)$/,s=e=>a.test(e)},99611:function(e,t,i){"use strict";i.a(e,async function(e,t){try{i(18111),i(13579),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(40445),s=i(1126),o=i(35211),r=i(5124),n=i(67576),l=i(1087),d=i(60353),c=i(22792),h=i(59992),v=i(14503),p=i(22348),u=e([s,h]);[s,h]=u.then?(await u)():u;let g,b,m=e=>e;const y=300,f=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),_=new Set(["volume-slider-container","forecast"]);class w extends((0,h.V)(r.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(e){super.updated(e),e.has("open")&&(this._drawerOpen=this.open)}render(){return(0,r.qy)(g||(g=m` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" @keydown="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-hide="${0}" @wa-after-hide="${0}" @click="${0}" without-header @touchstart="${0}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(e){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(e)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${y}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},y)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,v.dp,(0,r.AH)(b||(b=m`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`),y,y)]}constructor(...e){super(...e),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new d.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,l.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var e;const t=this._autofocusElement;null!==(e=this._hassConfig)&&void 0!==e&&e.auth.external&&(0,p.V)(this._hassConfig.auth.external)?t&&(t.id||(t.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})):null==t||t.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=e=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);e.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=e=>{if(e.eventPhase!==Event.AT_TARGET)return;const t=e.detail.source===e.target.drawer;if(this._sliderInteractionActive)return e.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1},this._handleKeyDown=e=>{"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)},this._handleCloseAction=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&("close"===e.getAttribute("data-dialog")||"close"===e.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=e=>{if(this.preventScrimClose)return;const t=e.composedPath();for(const i of t){if(i===this._drawer)break;if(i instanceof HTMLElement&&(i.scrollTop>0||f.has(i.localName)||Array.from(i.classList).some(e=>_.has(e))))return}e.stopPropagation(),this._startResizing(e.touches[0].clientY)},this._handleTouchMove=e=>{const t=e.touches[0].clientY,i=this._gestureRecognizer.move(t);i<0&&(e.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*i}px)`)}))},this._handleTouchEnd=()=>{var e;this._unregisterResizeHandlers(),this._isDragging=!1;const t=this._gestureRecognizer.end();if(t.isSwipe)return void(t.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const i=null===(e=this._drawer.shadowRoot)||void 0===e?void 0:e.querySelector('[part="body"]'),a=(null==i?void 0:i.offsetHeight)||0;a>0&&t.delta<0&&Math.abs(t.delta)>.5*a?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,a.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],w.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],w.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"open",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],w.prototype,"flexContent",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],w.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_drawerOpen",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_sliderInteractionActive",void 0),(0,a.Cg)([(0,n.wk)(),(0,o.Fg)({context:c.WF,subscribe:!0})],w.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,n.P)("#drawer")],w.prototype,"_drawer",void 0),(0,a.Cg)([(0,n.P)("#body")],w.prototype,"_bodyElement",void 0),(0,a.Cg)([(0,n.P)("[autofocus]")],w.prototype,"_autofocusElement",void 0),w=(0,a.Cg)([(0,n.EM)("ha-bottom-sheet")],w),t()}catch(g){t(g)}})},38377:function(e,t,i){"use strict";var a=i(59787),s=(i(74423),i(72712),i(18111),i(22489),i(61701),i(18237),i(3362),i(27495),i(62953),i(40445)),o=i(5124),r=i(67576),n=i(20889),l=i(30015),d=i.n(l),c=i(1087),h=(i(3296),i(27208),i(48408),i(14603),i(47566),i(98721),i(2209));let v;var p=i(996);let u,g=e=>e;const b=e=>(0,o.qy)(u||(u=g`${0}`),e),m=new p.G(1e3),y={reType:(0,a.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 f extends o.mN{disconnectedCallback(){if(super.disconnectedCallback(),this.cache){const e=this._computeCacheKey();m.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();m.has(e)&&((0,o.XX)(b((0,n._)(m.get(e))),this.renderRoot),this._resize())}}_computeCacheKey(){return d()({content:this.content,allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl,breaks:this.breaks})}async _render(){const e=await(async(e,t,a)=>(v||(v=(0,h.LV)(new Worker(new URL(i.p+i.u(55640),i.b)))),v.renderMarkdown(e,t,a)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl});(0,o.XX)(b((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){var a;const i=(null===(a=e.firstElementChild)||void 0===a||null===(a=a.firstChild)||void 0===a?void 0:a.textContent)&&y.reType.exec(e.firstElementChild.firstChild.textContent);if(i){const{type:a}=i.groups,s=document.createElement("ha-alert");s.alertType=y.typeToHaAlert[a.toLowerCase()],s.append(...Array.from(e.childNodes).map(e=>{const t=Array.from(e.childNodes);if(!this.breaks&&t.length){var a;const e=t[0];e.nodeType===Node.TEXT_NODE&&e.textContent===i.input&&null!==(a=e.textContent)&&void 0!==a&&a.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!==i.input)),t.parentNode().replaceChild(s,e)}}else e instanceof HTMLElement&&["ha-alert","ha-qr-code","ha-icon","ha-svg-icon"].includes(e.localName)&&i(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,s.Cg)([(0,r.MZ)()],f.prototype,"content",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"allow-svg",type:Boolean})],f.prototype,"allowSvg",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"allow-data-url",type:Boolean})],f.prototype,"allowDataUrl",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],f.prototype,"breaks",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,attribute:"lazy-images"})],f.prototype,"lazyImages",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],f.prototype,"cache",void 0),f=(0,s.Cg)([(0,r.EM)("ha-markdown-element")],f)},3587:function(e,t,i){"use strict";i(3362),i(62953);var a=i(40445),s=i(5124),o=i(67576);i(38377);let r,n,l=e=>e;class d extends s.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,s.qy)(r||(r=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):s.s6}constructor(...e){super(...e),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1}}d.styles=(0,s.AH)(n||(n=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,a.Cg)([(0,o.MZ)()],d.prototype,"content",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"allow-svg",type:Boolean})],d.prototype,"allowSvg",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"allow-data-url",type:Boolean})],d.prototype,"allowDataUrl",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],d.prototype,"breaks",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"lazy-images"})],d.prototype,"lazyImages",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],d.prototype,"cache",void 0),(0,a.Cg)([(0,o.P)("ha-markdown-element")],d.prototype,"_markdownElement",void 0),d=(0,a.Cg)([(0,o.EM)("ha-markdown")],d)},67431:function(e,t,i){"use strict";i.a(e,async function(e,t){try{i(89463),i(74423),i(44114),i(18111),i(22489),i(20116),i(7588),i(61701),i(13579),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(40445),s=i(5124),o=i(67576),r=i(22786),n=i(44537),l=i(1087),d=i(71727),c=i(68246),h=i(82286),v=i(24790),p=i(95350),u=i(95311),g=i(36918),b=(i(9503),i(26300)),m=(i(3587),i(11399),i(99766)),y=i(13563),f=(i(8034),i(10763)),_=e([b,m,y,f]);[b,m,y,f]=_.then?(await _)():_;let w,k,x,$,C,M,S,O,E,j,z,T,A,q=e=>e;const Z="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,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,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z",D=(e,t)=>"object"==typeof t?!!Array.isArray(t)&&t.some(t=>e.includes(t)):e.includes(t),I=e=>e.selector&&!e.required&&!("boolean"in e.selector&&e.default);class P extends s.WF{willUpdate(e){var t,i,a,s,o,r,n,c;if(this.hasUpdated||(this.hass.loadBackendTranslation("services"),this.hass.loadBackendTranslation("selector")),!e.has("value"))return;const h=e.get("value");(null==h?void 0:h.action)!==(null===(t=this.value)||void 0===t?void 0:t.action)&&(this._checkedKeys=new Set);const v=this._getServiceInfo(null===(i=this.value)||void 0===i?void 0:i.action,this.hass.services);var p;null!==(a=this.value)&&void 0!==a&&a.action?null!=h&&h.action&&(0,d.m)(this.value.action)===(0,d.m)(h.action)||this._fetchManifest((0,d.m)(null===(p=this.value)||void 0===p?void 0:p.action)):this._manifest=void 0;if(v&&"target"in v&&(null!==(s=this.value)&&void 0!==s&&null!==(s=s.data)&&void 0!==s&&s.entity_id||null!==(o=this.value)&&void 0!==o&&null!==(o=o.data)&&void 0!==o&&o.area_id||null!==(r=this.value)&&void 0!==r&&null!==(r=r.data)&&void 0!==r&&r.device_id)){var u,g,b;const e=Object.assign({},this.value.target);!this.value.data.entity_id||null!==(u=this.value.target)&&void 0!==u&&u.entity_id||(e.entity_id=this.value.data.entity_id),!this.value.data.area_id||null!==(g=this.value.target)&&void 0!==g&&g.area_id||(e.area_id=this.value.data.area_id),!this.value.data.device_id||null!==(b=this.value.target)&&void 0!==b&&b.device_id||(e.device_id=this.value.data.device_id),this._value=Object.assign(Object.assign({},this.value),{},{target:e,data:Object.assign({},this.value.data)}),delete this._value.data.entity_id,delete this._value.data.device_id,delete this._value.data.area_id}else this._value=this.value;if((null==h?void 0:h.action)!==(null===(n=this.value)||void 0===n?void 0:n.action)){let e=!1;if(this._value&&v){const t=this.value&&!("data"in this.value);this._value.data||(this._value.data={}),v.flatFields.forEach(i=>{i.selector&&i.required&&void 0===i.default&&"boolean"in i.selector&&void 0===this._value.data[i.key]&&(e=!0,this._value.data[i.key]=!1),t&&i.selector&&void 0!==i.default&&void 0===this._value.data[i.key]&&(e=!0,this._value.data[i.key]=i.default)})}e&&(0,l.r)(this,"value-changed",{value:Object.assign({},this._value)})}if(null!==(c=this._value)&&void 0!==c&&c.data){const e=this._yamlEditor;e&&e.value!==this._value.data&&e.setValue(this._value.data)}}_filterField(e,t){return null===t||!!t.length&&!!t.some(t=>{var i;const a=this.hass.states[t];return!!a&&(!(null===(i=e.supported_features)||void 0===i||!i.some(e=>(0,h.$)(a,e)))||!(!e.attribute||!Object.entries(e.attribute).some(([e,t])=>e in a.attributes&&D(t,a.attributes[e]))))})}render(){var e,t,i,a,o,r,n,l,h,v;const p=this._getServiceInfo(null===(e=this._value)||void 0===e?void 0:e.action,this.hass.services),u=(null==p?void 0:p.fields.length)&&!p.hasSelector.length||p&&Object.keys((null===(t=this._value)||void 0===t?void 0:t.data)||{}).some(e=>!p.hasSelector.includes(e)),b=u&&(null==p?void 0:p.fields.find(e=>"entity_id"===e.key)),m=Boolean(!u&&(null==p?void 0:p.flatFields.some(e=>I(e)))),y=this._getTargetedEntities(null==p?void 0:p.target,this._value),f=null!==(i=this._value)&&void 0!==i&&i.action?(0,d.m)(this._value.action):void 0,_=null!==(a=this._value)&&void 0!==a&&a.action?(0,c.Y)(this._value.action):void 0,j=f&&_?null===(o=this.hass.services[f])||void 0===o||null===(o=o[_])||void 0===o?void 0:o.description_placeholders:void 0,z=_&&this.hass.localize(`component.${f}.services.${_}.description`,j)||(null==p?void 0:p.description);return(0,s.qy)(w||(w=q`${0} ${0} ${0} ${0} `),this.hidePicker?s.s6:(0,s.qy)(k||(k=q`<ha-service-picker .hass="${0}" .value="${0}" .disabled="${0}" @value-changed="${0}" .showServiceId="${0}"></ha-service-picker>`),this.hass,null===(r=this._value)||void 0===r?void 0:r.action,this.disabled,this._serviceChanged,this.showServiceId),this.hideDescription?s.s6:(0,s.qy)(x||(x=q` <div class="description"> ${0} ${0} </div> `),z?(0,s.qy)($||($=q`<p>${0}</p>`),z):"",this._manifest?(0,s.qy)(C||(C=q` <a href="${0}" title="${0}" target="_blank" rel="noreferrer"> <ha-icon-button .path="${0}" class="help-icon"></ha-icon-button> </a>`),this._manifest.is_built_in?(0,g.o)(this.hass,`/integrations/${this._manifest.domain}`):this._manifest.documentation,this.hass.localize("ui.components.service-control.integration_doc"),Z):s.s6),p&&"target"in p?(0,s.qy)(M||(M=q`<ha-settings-row .narrow="${0}"> <span slot="heading">${0}</span> <ha-selector .hass="${0}" .selector="${0}" .disabled="${0}" @value-changed="${0}" .value="${0}"></ha-selector></ha-settings-row>`),this.narrow,this.hass.localize("ui.components.service-control.target"),this.hass,this._targetSelector(p.target,null===(n=this._value)||void 0===n?void 0:n.target),this.disabled,this._targetChanged,null===(l=this._value)||void 0===l?void 0:l.target):b?(0,s.qy)(S||(S=q`<ha-entity-picker .hass="${0}" .disabled="${0}" .value="${0}" .label="${0}" @value-changed="${0}" allow-custom-entity></ha-entity-picker>`),this.hass,this.disabled,null===(h=this._value)||void 0===h||null===(h=h.data)||void 0===h?void 0:h.entity_id,this.hass.localize(`component.${f}.services.${_}.fields.entity_id.description`,j)||b.description,this._entityPicked):"",u?(0,s.qy)(O||(O=q`<ha-yaml-editor .label="${0}" .name="${0}" .readOnly="${0}" .defaultValue="${0}" @value-changed="${0}"></ha-yaml-editor>`),this.hass.localize("ui.components.service-control.action_data"),"data",this.disabled,null===(v=this._value)||void 0===v?void 0:v.data,this._dataChanged):null==p?void 0:p.fields.map(e=>{if(!e.fields)return this._renderField(e,m,f,_,y);const t=Object.entries(e.fields).map(([e,t])=>Object.assign({key:e},t));return t.length&&this._hasFilteredFields(t,y)?(0,s.qy)(E||(E=q`<ha-expansion-panel left-chevron .expanded="${0}" .header="${0}" .secondary="${0}"> <ha-service-section-icon slot="icons" .hass="${0}" .service="${0}" .section="${0}"></ha-service-section-icon> ${0} </ha-expansion-panel>`),!e.collapsed,this.hass.localize(`component.${f}.services.${_}.sections.${e.key}.name`,j)||e.name||e.key,this._getSectionDescription(e,f,_),this.hass,this._value.action,e.key,Object.entries(e.fields).map(([e,t])=>this._renderField(Object.assign({key:e},t),m,f,_,y))):s.s6}))}_getSectionDescription(e,t,i){return this.hass.localize(`component.${t}.services.${i}.sections.${e.key}.description`,t&&i?this.hass.services[t][i].description_placeholders:void 0)}_hasFilteredFields(e,t){return e.some(e=>!e.filter||this._filterField(e.filter,t))}_toggleCheckbox(e){var t;const i=null===(t=e.currentTarget)||void 0===t||null===(t=t.parentElement)||void 0===t?void 0:t.querySelector("ha-checkbox");null==i||i.click()}_checkboxChanged(e){const t=e.currentTarget.checked,i=e.currentTarget.key;let a;if(t){var s,o;this._checkedKeys.add(i);const e=null===(s=this._getServiceInfo(null===(o=this._value)||void 0===o?void 0:o.action,this.hass.services))||void 0===s?void 0:s.flatFields.find(e=>e.key===i);let t=null==e?void 0:e.default;var r,n;if(null==t&&null!=e&&e.selector&&"constant"in e.selector)t=null===(r=e.selector.constant)||void 0===r?void 0:r.value;if(null==t&&null!=e&&e.selector&&"boolean"in e.selector&&(t=!1),null!=t)a=Object.assign(Object.assign({},null===(n=this._value)||void 0===n?void 0:n.data),{},{[i]:t})}else{var d;this._checkedKeys.delete(i),a=Object.assign({},null===(d=this._value)||void 0===d?void 0:d.data),delete a[i],delete this._stickySelector[i]}a&&(0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._value),{},{data:a})}),this.requestUpdate("_checkedKeys")}_serviceChanged(e){var t;if(e.stopPropagation(),e.detail.value===(null===(t=this._value)||void 0===t?void 0:t.action))return;const i=e.detail.value||"";let a;if(i){var s;const e=this._getServiceInfo(i,this.hass.services),t=null===(s=this._value)||void 0===s?void 0:s.target;if(t&&null!=e&&e.target){var o,r,d,c,h,v;const i={target:Object.assign({},e.target)};let s=(null===(o=(0,n.e)(t.entity_id||(null===(r=this._value.data)||void 0===r?void 0:r.entity_id)))||void 0===o?void 0:o.slice())||[],l=(null===(d=(0,n.e)(t.device_id||(null===(c=this._value.data)||void 0===c?void 0:c.device_id)))||void 0===d?void 0:d.slice())||[],p=(null===(h=(0,n.e)(t.area_id||(null===(v=this._value.data)||void 0===v?void 0:v.area_id)))||void 0===h?void 0:h.slice())||[];p.length&&(p=p.filter(e=>(0,u.Qz)(this.hass,this.hass.entities,this.hass.devices,e,i))),l.length&&(l=l.filter(e=>(0,u.DF)(this.hass.states,Object.values(this.hass.entities),this.hass.devices[e],i))),s.length&&(s=s.filter(e=>(0,u.MM)(this.hass.states[e],i))),a=Object.assign(Object.assign(Object.assign({},s.length?{entity_id:s}:{}),l.length?{device_id:l}:{}),p.length?{area_id:p}:{})}}const p={action:i,target:a};(0,l.r)(this,"value-changed",{value:p})}_entityPicked(e){var t,i;e.stopPropagation();const a=e.detail.value;if((null===(t=this._value)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.entity_id)===a)return;let s;var o;!a&&null!==(i=this._value)&&void 0!==i&&i.data?(s=Object.assign({},this._value),delete s.data.entity_id):s=Object.assign(Object.assign({},this._value),{},{data:Object.assign(Object.assign({},null===(o=this._value)||void 0===o?void 0:o.data),{},{entity_id:e.detail.value})});(0,l.r)(this,"value-changed",{value:s})}_targetChanged(e){var t;if(e.stopPropagation(),!1===e.detail.isValid)return;const i=e.detail.value;if((null===(t=this._value)||void 0===t?void 0:t.target)===i)return;let a;i?a=Object.assign(Object.assign({},this._value),{},{target:e.detail.value}):(a=Object.assign({},this._value),delete a.target),(0,l.r)(this,"value-changed",{value:a})}_serviceDataChanged(e){var t,i,a;if(e.stopPropagation(),!1===e.detail.isValid)return;const s=e.currentTarget.key,o=e.detail.value;if(!((null===(t=this._value)||void 0===t||null===(t=t.data)||void 0===t?void 0:t[s])!==o&&(null!==(i=this._value)&&void 0!==i&&i.data&&s in this._value.data||""!==o&&void 0!==o)))return;const r=Object.assign(Object.assign({},null===(a=this._value)||void 0===a?void 0:a.data),{},{[s]:o});(""===o||void 0===o||"object"==typeof o&&!Object.keys(o).length)&&(delete r[s],delete this._stickySelector[s]),(0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._value),{},{data:r})})}_dataChanged(e){e.stopPropagation(),e.detail.isValid&&(0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._value),{},{data:e.detail.value})})}async _fetchManifest(e){this._manifest=void 0;try{this._manifest=await(0,p.QC)(this.hass,e)}catch(t){}}constructor(...e){super(...e),this.disabled=!1,this.narrow=!1,this.showServiceId=!1,this.hidePicker=!1,this.hideDescription=!1,this._checkedKeys=new Set,this._stickySelector={},this._getServiceInfo=(0,r.A)((e,t)=>{if(!e||!t)return;const i=(0,d.m)(e),a=(0,c.Y)(e);if(!(i in t))return;if(!(a in t[i]))return;const s=Object.entries(t[i][a].fields).map(([e,t])=>Object.assign(Object.assign({key:e},t),{},{selector:t.selector})),o=[],r=[];return s.forEach(e=>{e.fields?Object.entries(e.fields).forEach(([e,t])=>{o.push(Object.assign(Object.assign({},t),{},{key:e})),t.selector&&r.push(e)}):(o.push(e),e.selector&&r.push(e.key))}),Object.assign(Object.assign({},t[i][a]),{},{fields:s,flatFields:o,hasSelector:r})}),this._getTargetedEntities=(0,r.A)((e,t)=>{var i,a,s,o,r,l,d,c,h,p,g,b,m,y,f,_,w,k,x,$;const C=e?{target:e}:{target:{}};if((0,v.r)(null==t?void 0:t.target)||(0,v.r)(null==t||null===(i=t.data)||void 0===i?void 0:i.entity_id)||(0,v.r)(null==t||null===(a=t.data)||void 0===a?void 0:a.device_id)||(0,v.r)(null==t||null===(s=t.data)||void 0===s?void 0:s.area_id)||(0,v.r)(null==t||null===(o=t.data)||void 0===o?void 0:o.floor_id)||(0,v.r)(null==t||null===(r=t.data)||void 0===r?void 0:r.label_id))return null;const M=(null===(l=(0,n.e)((null==t||null===(d=t.target)||void 0===d?void 0:d.entity_id)||(null==t||null===(c=t.data)||void 0===c?void 0:c.entity_id)))||void 0===l?void 0:l.slice())||[],S=(null===(h=(0,n.e)((null==t||null===(p=t.target)||void 0===p?void 0:p.device_id)||(null==t||null===(g=t.data)||void 0===g?void 0:g.device_id)))||void 0===h?void 0:h.slice())||[],O=(null===(b=(0,n.e)((null==t||null===(m=t.target)||void 0===m?void 0:m.area_id)||(null==t||null===(y=t.data)||void 0===y?void 0:y.area_id)))||void 0===b?void 0:b.slice())||[],E=null===(f=(0,n.e)((null==t||null===(_=t.target)||void 0===_?void 0:_.floor_id)||(null==t||null===(w=t.data)||void 0===w?void 0:w.floor_id)))||void 0===f?void 0:f.slice(),j=null===(k=(0,n.e)((null==t||null===(x=t.target)||void 0===x?void 0:x.label_id)||(null==t||null===($=t.data)||void 0===$?void 0:$.label_id)))||void 0===k?void 0:k.slice();return j&&j.forEach(e=>{const t=(0,u.m0)(this.hass,e,this.hass.areas,this.hass.devices,this.hass.entities,C);S.push(...t.devices);const i=t.entities.filter(e=>{var t,i;return!(null!==(t=this.hass.entities[e])&&void 0!==t&&t.entity_category||null!==(i=this.hass.entities[e])&&void 0!==i&&i.hidden)});M.push(i),O.push(...t.areas)}),E&&E.forEach(e=>{const t=(0,u.MH)(this.hass,e,this.hass.areas,C);O.push(...t.areas)}),O.length&&O.forEach(e=>{const t=(0,u.bZ)(this.hass,e,this.hass.devices,this.hass.entities,C),i=t.entities.filter(e=>{var t,i;return!(null!==(t=this.hass.entities[e])&&void 0!==t&&t.entity_category||null!==(i=this.hass.entities[e])&&void 0!==i&&i.hidden)});M.push(...i),S.push(...t.devices)}),S.length&&S.forEach(e=>{const t=(0,u._7)(this.hass,e,this.hass.entities,C).entities.filter(e=>{var t,i;return!(null!==(t=this.hass.entities[e])&&void 0!==t&&t.entity_category||null!==(i=this.hass.entities[e])&&void 0!==i&&i.hidden)});M.push(...t)}),M}),this._targetSelector=(0,r.A)((e,t)=>{var i;return!t||"object"==typeof t&&!Object.keys(t).length?delete this._stickySelector.target:(0,v.r)(t)&&(this._stickySelector.target="string"==typeof t?{template:null}:{object:null}),null!==(i=this._stickySelector.target)&&void 0!==i?i:e?{target:Object.assign({},e)}:{target:{}}}),this._renderField=(e,t,i,a,o)=>{var r,n,l,d,c,h;if(e.filter&&!this._filterField(e.filter,o))return s.s6;const p=(null===(r=this._value)||void 0===r?void 0:r.data)&&(0,v.r)(this._value.data[e.key]),u=p&&"string"==typeof this._value.data[e.key]?{template:null}:p&&"object"==typeof this._value.data[e.key]?{object:null}:null!==(n=null!==(l=this._stickySelector[e.key])&&void 0!==l?l:null==e?void 0:e.selector)&&void 0!==n?n:{text:null};p&&(this._stickySelector[e.key]=u);const g=I(e),b=i&&a?this.hass.services[i][a].description_placeholders:void 0;return e.selector?(0,s.qy)(j||(j=q`<ha-settings-row .narrow="${0}"> ${0} <span slot="heading" class="${0}" @click="${0}">${0}</span> <span slot="description" class="${0}" @click="${0}"><ha-markdown breaks allow-svg .content="${0}"></ha-markdown> </span> <ha-selector .context="${0}" .disabled="${0}" .hass="${0}" .selector="${0}" .key="${0}" @value-changed="${0}" .value="${0}" .placeholder="${0}" .localizeValue="${0}" .required="${0}"></ha-selector> </ha-settings-row>`),this.narrow,g?(0,s.qy)(T||(T=q`<ha-checkbox .key="${0}" .checked="${0}" .disabled="${0}" @change="${0}" slot="prefix"></ha-checkbox>`),e.key,this._checkedKeys.has(e.key)||!(null===(d=this._value)||void 0===d||!d.data)&&void 0!==this._value.data[e.key],this.disabled,this._checkboxChanged):t?(0,s.qy)(z||(z=q`<div slot="prefix" class="checkbox-spacer"></div>`)):"",g?"clickable":"",g?this._toggleCheckbox:void 0,this.hass.localize(`component.${i}.services.${a}.fields.${e.key}.name`,b)||e.name||e.key,g?"clickable":"",g?this._toggleCheckbox:void 0,this.hass.localize(`component.${i}.services.${a}.fields.${e.key}.description`,b)||(null==e?void 0:e.description),this._selectorContext(o),this.disabled||g&&!this._checkedKeys.has(e.key)&&(!(null!==(c=this._value)&&void 0!==c&&c.data)||void 0===this._value.data[e.key]),this.hass,u,e.key,this._serviceDataChanged,null!==(h=this._value)&&void 0!==h&&h.data?this._value.data[e.key]:void 0,e.default,this._localizeValueCallback,e.required):""},this._selectorContext=(0,r.A)(e=>({filter_entity:e||void 0})),this._localizeValueCallback=e=>{var t;return null!==(t=this._value)&&void 0!==t&&t.action?this.hass.localize(`component.${(0,d.m)(this._value.action)}.selector.${e}`):""}}}P.styles=(0,s.AH)(A||(A=q`ha-settings-row{padding:var(--service-control-padding,0 16px)}ha-settings-row[narrow]{padding-bottom:8px}ha-settings-row{--settings-row-content-width:100%;--settings-row-prefix-display:contents;border-top:var(--service-control-items-border-top,1px solid var(--divider-color))}ha-entity-picker,ha-service-picker,ha-yaml-editor{display:block;margin:var(--service-control-padding,0 16px)}ha-yaml-editor{padding:16px 0}p{margin:var(--service-control-padding,0 16px);padding:16px 0}:host([hide-picker]) p{padding-top:0}.checkbox-spacer{width:32px}.clickable{cursor:pointer}.help-icon{color:var(--secondary-text-color)}.description{justify-content:space-between;display:flex;align-items:center;padding-right:2px;padding-inline-end:2px;padding-inline-start:initial}.description p{direction:ltr}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-summary-padding:0 16px;--expansion-panel-content-padding:0}`)),(0,a.Cg)([(0,o.MZ)({attribute:!1})],P.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],P.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],P.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],P.prototype,"narrow",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"show-service-id",type:Boolean})],P.prototype,"showServiceId",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-picker",type:Boolean,reflect:!0})],P.prototype,"hidePicker",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-description",type:Boolean})],P.prototype,"hideDescription",void 0),(0,a.Cg)([(0,o.wk)()],P.prototype,"_value",void 0),(0,a.Cg)([(0,o.wk)()],P.prototype,"_checkedKeys",void 0),(0,a.Cg)([(0,o.wk)()],P.prototype,"_manifest",void 0),(0,a.Cg)([(0,o.P)("ha-yaml-editor")],P.prototype,"_yamlEditor",void 0),P=(0,a.Cg)([(0,o.EM)("ha-service-control")],P),t()}catch(w){t(w)}})},65329:function(e,t,i){"use strict";i.a(e,async function(e,t){try{var a=i(40445),s=i(5124),o=i(67576),r=i(91450),n=i(71727),l=i(85694),d=(i(47680),i(67094),e([l]));l=(d.then?(await d)():d)[0];let c,h,v,p,u=e=>e;class g extends s.WF{render(){if(this.icon)return(0,s.qy)(c||(c=u`<ha-icon .icon="${0}"></ha-icon>`),this.icon);if(!this.service)return s.s6;if(!this.hass)return this._renderFallback();const e=(0,l.f$)(this.hass.connection,this.hass.config,this.service).then(e=>e?(0,s.qy)(h||(h=u`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback());return(0,s.qy)(v||(v=u`${0}`),(0,r.T)(e))}_renderFallback(){const e=(0,n.m)(this.service);return(0,s.qy)(p||(p=u` <ha-svg-icon .path="${0}"></ha-svg-icon> `),l.l[e]||l.Gn)}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)()],g.prototype,"service",void 0),(0,a.Cg)([(0,o.MZ)()],g.prototype,"icon",void 0),g=(0,a.Cg)([(0,o.EM)("ha-service-icon")],g),t()}catch(c){t(c)}})},99766:function(e,t,i){"use strict";i.a(e,async function(e,t){try{i(89463),i(44114),i(26910),i(18111),i(7588),i(3362),i(62953);var a=i(40445),s=i(5124),o=i(67576),r=i(22786),n=i(1087),l=i(78011),d=i(85694),c=i(95350),h=(i(75064),i(38508)),v=i(65329),p=e([h,v,d]);[h,v,d]=p.then?(await p)():p;let u,g,b,m,y,f,_,w=e=>e;const k="M12,5A2,2 0 0,1 14,7C14,7.24 13.96,7.47 13.88,7.69C17.95,8.5 21,11.91 21,16H3C3,11.91 6.05,8.5 10.12,7.69C10.04,7.47 10,7.24 10,7A2,2 0 0,1 12,5M22,19H2V17H22V19Z",x=[{name:"search_labels.name",weight:10},{name:"search_labels.description",weight:8},{name:"search_labels.domainName",weight:6},{name:"search_labels.serviceId",weight:3}];class $ extends s.WF{async open(){var e;await this.updateComplete,await(null===(e=this._picker)||void 0===e?void 0:e.open())}firstUpdated(e){super.firstUpdated(e),this.hass.loadBackendTranslation("services"),(0,d.Yd)(this.hass.connection,this.hass.config)}render(){var e;const t=null!==(e=this.placeholder)&&void 0!==e?e:this.hass.localize("ui.components.service-picker.action");return(0,s.qy)(u||(u=w` <ha-generic-picker .hass="${0}" .autofocus="${0}" .notFoundLabel="${0}" .label="${0}" .placeholder="${0}" .value="${0}" .getItems="${0}" .rowRenderer="${0}" .valueRenderer="${0}" .searchKeys="${0}" .unknownItemText="${0}" @value-changed="${0}"> </ha-generic-picker> `),this.hass,this.autofocus,this.hass.localize("ui.components.service-picker.no_match"),this.label,t,this.value,this._getItems,this._rowRenderer,this._valueRenderer(this.hass.localize,this.hass.services),x,this.hass.localize("ui.components.service-picker.unknown"),this._valueChanged)}_valueChanged(e){e.stopPropagation();const t=e.detail.value;t?(0,l.x)(t)&&this._setValue(t):this._setValue(void 0)}_setValue(e){this.value=e,(0,n.r)(this,"value-changed",{value:e}),(0,n.r)(this,"change")}constructor(...e){super(...e),this.disabled=!1,this.showServiceId=!1,this._rowRenderer=(e,t)=>(0,s.qy)(g||(g=w` <ha-combo-box-item type="button" .borderTop="${0}"> <ha-service-icon slot="start" .hass="${0}" .service="${0}"></ha-service-icon> <span slot="headline">${0}</span> <span slot="supporting-text">${0}</span> ${0} ${0} </ha-combo-box-item> `),0!==t,this.hass,e.id,e.primary,e.secondary,e.service_id&&this.showServiceId?(0,s.qy)(b||(b=w`<span slot="supporting-text" class="code"> ${0} </span>`),e.service_id):s.s6,e.domain_name?(0,s.qy)(m||(m=w` <div slot="trailing-supporting-text" class="domain"> ${0} </div> `),e.domain_name):s.s6),this._valueRenderer=(0,r.A)((e,t)=>i=>{var a;const o=i,[r,n]=o.split(".");if(null===(a=t[r])||void 0===a||!a[n])return(0,s.qy)(y||(y=w` <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <span slot="headline">${0}</span> `),k,i);const l=this.hass.services[r][n].description_placeholders,d=e(`component.${r}.services.${n}.name`,l)||t[r][n].name||n;return(0,s.qy)(f||(f=w` <ha-service-icon slot="start" .hass="${0}" .service="${0}"></ha-service-icon> <span slot="headline">${0}</span> ${0} `),this.hass,o,d,this.showServiceId?(0,s.qy)(_||(_=w`<span slot="supporting-text" class="code">${0}</span>`),o):s.s6)}),this._getItems=()=>this._services(this.hass.localize,this.hass.services),this._services=(0,r.A)((e,t)=>{if(!t)return[];const i=[];return Object.keys(t).sort().forEach(a=>{const s=Object.keys(t[a]).sort();for(const o of s){const s=`${a}.${o}`,r=(0,c.p$)(e,a),n=this.hass.services[a][o].description_placeholders,l=this.hass.localize(`component.${a}.services.${o}.name`,n)||t[a][o].name||o,d=this.hass.localize(`component.${a}.services.${o}.description`,n)||t[a][o].description||"";i.push({id:s,primary:l,secondary:d,domain_name:r,service_id:s,search_labels:{serviceId:s,domainName:r,name:l,description:d},sorting_label:s})}}),i})}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],$.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)()],$.prototype,"label",void 0),(0,a.Cg)([(0,o.MZ)()],$.prototype,"placeholder",void 0),(0,a.Cg)([(0,o.MZ)()],$.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"show-service-id",type:Boolean})],$.prototype,"showServiceId",void 0),(0,a.Cg)([(0,o.P)("ha-generic-picker")],$.prototype,"_picker",void 0),$=(0,a.Cg)([(0,o.EM)("ha-service-picker")],$),t()}catch(u){t(u)}})},13563:function(e,t,i){"use strict";i.a(e,async function(e,t){try{var a=i(40445),s=i(5124),o=i(67576),r=i(91450),n=(i(47680),i(67094),i(85694)),l=e([n]);n=(l.then?(await l)():l)[0];let d,c,h,v=e=>e;class p extends s.WF{render(){if(this.icon)return(0,s.qy)(d||(d=v`<ha-icon .icon="${0}"></ha-icon>`),this.icon);if(!this.service||!this.section)return s.s6;if(!this.hass)return this._renderFallback();const e=(0,n.Yw)(this.hass.connection,this.hass.config,this.service,this.section).then(e=>e?(0,s.qy)(c||(c=v`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback());return(0,s.qy)(h||(h=v`${0}`),(0,r.T)(e))}_renderFallback(){return s.s6}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)()],p.prototype,"service",void 0),(0,a.Cg)([(0,o.MZ)()],p.prototype,"section",void 0),(0,a.Cg)([(0,o.MZ)()],p.prototype,"icon",void 0),p=(0,a.Cg)([(0,o.EM)("ha-service-section-icon")],p),t()}catch(d){t(d)}})},8034:function(e,t,i){"use strict";i(27495),i(62953);var a=i(40445),s=i(92070),o=i(5124),r=i(67576);let n,l,d,c=e=>e;class h extends o.WF{render(){const e=this._hasSlotController.test("description");return(0,o.qy)(n||(n=c` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" part="heading" ?two-line="${0}" ?three-line="${0}"> <slot name="heading"></slot> ${0} </div> </div> <div class="content"> <slot></slot> </div> `),!this.threeLine&&e,this.threeLine,e?(0,o.qy)(l||(l=c`<span class="secondary"><slot name="description"></slot></span>`)):o.s6)}constructor(...e){super(...e),this.narrow=!1,this.slim=!1,this.threeLine=!1,this.wrapHeading=!1,this.empty=!1,this._hasSlotController=new s.X(this,"description")}}h.styles=(0,o.AH)(d||(d=c`:host{display:flex;padding:0 var(--ha-space-4);align-content:normal;align-self:auto;align-items:center}.body{padding-top:var(--settings-row-body-padding-top,var(--ha-space-2));padding-bottom:var(--settings-row-body-padding-bottom,var(--ha-space-2));padding-left:0;padding-inline-start:0;padding-right:var(--ha-space-4);padding-inline-end:var(--ha-space-4);overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:88px}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:var(--ha-space-1);font-family:var( --mdc-typography-body2-font-family, var(--mdc-typography-font-family, var(--ha-font-family-body)) );font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(72px - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;min-width:0;padding:var(--settings-row-content-padding-block,var(--ha-space-4)) 0}:host([empty]) .content{display:none}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:var(--ha-space-2)}::slotted(ha-switch){padding:var(--settings-row-switch-padding-block,var(--ha-space-4)) 0}.secondary{white-space:normal}.prefix-wrap{flex:var(--settings-row-prefix-flex,1);display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`)),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"slim",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"three-line"})],h.prototype,"threeLine",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],h.prototype,"wrapHeading",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"empty",void 0),h=(0,a.Cg)([(0,r.EM)("ha-settings-row")],h)},996:function(e,t,i){"use strict";i.d(t,{G:function(){return a}});i(45367),i(92731),i(62953);class a{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,i){var a={"./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 s(e){if(!i.o(a,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=a[e],s=t[0];return Promise.all(t[1].map(i.e)).then(function(){return i(s)})}s.keys=function(){return Object.keys(a)},s.id=62003,e.exports=s}}]);