(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["94860"],{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)},69709: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(96196),n=i(77845),l=i(1420),r=i(30015),d=i.n(r),c=i(1087),h=(i(3296),i(27208),i(48408),i(14603),i(47566),i(98721),i(2209));let v;var u=i(996);let p,g=e=>e;const y=e=>(0,o.qy)(p||(p=g`${0}`),e),b=new u.G(1e3),m={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 _ extends o.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,o.XX)(y((0,l._)(b.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)(y((0,l._)(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)&&m.reType.exec(e.firstElementChild.firstChild.textContent);if(i){const{type:a}=i.groups,s=document.createElement("ha-alert");s.alertType=m.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(96175)(`./${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,n.MZ)()],_.prototype,"content",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"allow-svg",type:Boolean})],_.prototype,"allowSvg",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"allow-data-url",type:Boolean})],_.prototype,"allowDataUrl",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"breaks",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,attribute:"lazy-images"})],_.prototype,"lazyImages",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"cache",void 0),_=(0,s.Cg)([(0,n.EM)("ha-markdown-element")],_)},3587:function(e,t,i){"use strict";i(3362),i(62953);var a=i(40445),s=i(96196),o=i(77845);i(69709);let n,l,r=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)(n||(n=r`<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)(l||(l=r`
    :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;
        & > 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: 0.2em 0.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;
      th,
      td {
        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"] th,
      table[role="presentation"] td {
        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(96196),o=i(77845),n=i(22786),l=i(44537),r=i(1087),d=i(71727),c=i(68246),h=i(82286),v=i(24790),u=i(95350),p=i(95311),g=i(36918),y=(i(9503),i(26300)),b=(i(3587),i(11399),i(99766)),m=i(13563),_=(i(8034),i(10763)),f=e([y,b,m,_]);[y,b,m,_]=f.then?(await f)():f;let w,k,$,x,C,M,j,O,z,S,q,Z,E,A,F=e=>e;const T="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",I=(e,t)=>"object"==typeof t?!!Array.isArray(t)&&t.some(t=>e.includes(t)):e.includes(t),B=e=>e.selector&&!e.required&&!("boolean"in e.selector&&e.default);class U extends s.WF{willUpdate(e){var t,i,a,s,o,n,l,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 u;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===(u=this.value)||void 0===u?void 0:u.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!==(n=this.value)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&n.device_id)){var p,g,y;const e=Object.assign({},this.value.target);!this.value.data.entity_id||null!==(p=this.value.target)&&void 0!==p&&p.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!==(y=this.value.target)&&void 0!==y&&y.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===(l=this.value)||void 0===l?void 0:l.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,r.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&&I(t,a.attributes[e]))))})}render(){var e,t,i,a,o,n,l,r,h,v;const u=this._getServiceInfo(null===(e=this._value)||void 0===e?void 0:e.action,this.hass.services),p=(null==u?void 0:u.fields.length)&&!u.hasSelector.length||u&&Object.keys((null===(t=this._value)||void 0===t?void 0:t.data)||{}).some(e=>!u.hasSelector.includes(e)),y=p&&(null==u?void 0:u.fields.find(e=>"entity_id"===e.key)),b=Boolean(!p&&(null==u?void 0:u.flatFields.some(e=>B(e)))),m=this._getTargetedEntities(null==u?void 0:u.target,this._value),_=null!==(i=this._value)&&void 0!==i&&i.action?(0,d.m)(this._value.action):void 0,f=null!==(a=this._value)&&void 0!==a&&a.action?(0,c.Y)(this._value.action):void 0,q=_&&f?null===(o=this.hass.services[_])||void 0===o||null===(o=o[f])||void 0===o?void 0:o.description_placeholders:void 0,Z=f&&this.hass.localize(`component.${_}.services.${f}.description`,q)||(null==u?void 0:u.description);return(0,s.qy)(w||(w=F`${0} ${0} ${0} ${0} `),this.hidePicker?s.s6:(0,s.qy)(k||(k=F`<ha-service-picker .hass="${0}" .value="${0}" .disabled="${0}" @value-changed="${0}" .showServiceId="${0}"></ha-service-picker>`),this.hass,null===(n=this._value)||void 0===n?void 0:n.action,this.disabled,this._serviceChanged,this.showServiceId),this.hideDescription?s.s6:(0,s.qy)($||($=F` <div class="description"> ${0} ${0} </div> `),Z?(0,s.qy)(x||(x=F`<p>${0}</p>`),Z):"",this._manifest?(0,s.qy)(C||(C=F` <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"),T):s.s6),u&&"target"in u?(0,s.qy)(M||(M=F`<ha-settings-row .narrow="${0}"> ${0} <span slot="heading">${0}</span> <span slot="description">${0}</span><ha-selector .hass="${0}" .selector="${0}" .disabled="${0}" @value-changed="${0}" .value="${0}"></ha-selector></ha-settings-row>`),this.narrow,b?(0,s.qy)(j||(j=F`<div slot="prefix" class="checkbox-spacer"></div>`)):"",this.hass.localize("ui.components.service-control.target"),this.hass.localize("ui.components.service-control.target_secondary"),this.hass,this._targetSelector(u.target,null===(l=this._value)||void 0===l?void 0:l.target),this.disabled,this._targetChanged,null===(r=this._value)||void 0===r?void 0:r.target):y?(0,s.qy)(O||(O=F`<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.${_}.services.${f}.fields.entity_id.description`,q)||y.description,this._entityPicked):"",p?(0,s.qy)(z||(z=F`<ha-yaml-editor .hass="${0}" .label="${0}" .name="${0}" .readOnly="${0}" .defaultValue="${0}" @value-changed="${0}"></ha-yaml-editor>`),this.hass,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==u?void 0:u.fields.map(e=>{if(!e.fields)return this._renderField(e,b,_,f,m);const t=Object.entries(e.fields).map(([e,t])=>Object.assign({key:e},t));return t.length&&this._hasFilteredFields(t,m)?(0,s.qy)(S||(S=F`<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.${_}.services.${f}.sections.${e.key}.name`,q)||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),b,_,f,m))):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))}_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 n,l;if(null==t&&null!=e&&e.selector&&"constant"in e.selector)t=null===(n=e.selector.constant)||void 0===n?void 0:n.value;if(null==t&&null!=e&&e.selector&&"boolean"in e.selector&&(t=!1),null!=t)a=Object.assign(Object.assign({},null===(l=this._value)||void 0===l?void 0:l.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,r.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,n,d,c,h,v;const i={target:Object.assign({},e.target)};let s=(null===(o=(0,l.e)(t.entity_id||(null===(n=this._value.data)||void 0===n?void 0:n.entity_id)))||void 0===o?void 0:o.slice())||[],r=(null===(d=(0,l.e)(t.device_id||(null===(c=this._value.data)||void 0===c?void 0:c.device_id)))||void 0===d?void 0:d.slice())||[],u=(null===(h=(0,l.e)(t.area_id||(null===(v=this._value.data)||void 0===v?void 0:v.area_id)))||void 0===h?void 0:h.slice())||[];u.length&&(u=u.filter(e=>(0,p.Qz)(this.hass,this.hass.entities,this.hass.devices,e,i))),r.length&&(r=r.filter(e=>(0,p.DF)(this.hass,Object.values(this.hass.entities),this.hass.devices[e],i))),s.length&&(s=s.filter(e=>(0,p.MM)(this.hass.states[e],i))),a=Object.assign(Object.assign(Object.assign({},s.length?{entity_id:s}:{}),r.length?{device_id:r}:{}),u.length?{area_id:u}:{})}}const u={action:i,target:a};(0,r.r)(this,"value-changed",{value:u})}_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,r.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,r.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 n=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 n[s],delete this._stickySelector[s]),(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._value),{},{data:n})})}_dataChanged(e){e.stopPropagation(),e.detail.isValid&&(0,r.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,u.QC)(this.hass,e)}catch(t){}}constructor(...e){super(...e),this.disabled=!1,this.narrow=!1,this.showAdvanced=!1,this.showServiceId=!1,this.hidePicker=!1,this.hideDescription=!1,this._checkedKeys=new Set,this._stickySelector={},this._getServiceInfo=(0,n.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=[],n=[];return s.forEach(e=>{e.fields?Object.entries(e.fields).forEach(([e,t])=>{o.push(Object.assign(Object.assign({},t),{},{key:e})),t.selector&&n.push(e)}):(o.push(e),e.selector&&n.push(e.key))}),Object.assign(Object.assign({},t[i][a]),{},{fields:s,flatFields:o,hasSelector:n})}),this._getTargetedEntities=(0,n.A)((e,t)=>{var i,a,s,o,n,r,d,c,h,u,g,y,b,m,_,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===(n=t.data)||void 0===n?void 0:n.label_id))return null;const M=(null===(r=(0,l.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===r?void 0:r.slice())||[],j=(null===(h=(0,l.e)((null==t||null===(u=t.target)||void 0===u?void 0:u.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===(y=(0,l.e)((null==t||null===(b=t.target)||void 0===b?void 0:b.area_id)||(null==t||null===(m=t.data)||void 0===m?void 0:m.area_id)))||void 0===y?void 0:y.slice())||[],z=null===(_=(0,l.e)((null==t||null===(f=t.target)||void 0===f?void 0:f.floor_id)||(null==t||null===(w=t.data)||void 0===w?void 0:w.floor_id)))||void 0===_?void 0:_.slice(),S=null===(k=(0,l.e)((null==t||null===($=t.target)||void 0===$?void 0:$.label_id)||(null==t||null===(x=t.data)||void 0===x?void 0:x.label_id)))||void 0===k?void 0:k.slice();return S&&S.forEach(e=>{const t=(0,p.m0)(this.hass,e,this.hass.areas,this.hass.devices,this.hass.entities,C);j.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)}),z&&z.forEach(e=>{const t=(0,p.MH)(this.hass,e,this.hass.areas,C);O.push(...t.areas)}),O.length&&O.forEach(e=>{const t=(0,p.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),j.push(...t.devices)}),j.length&&j.forEach(e=>{const t=(0,p._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,n.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 n,l,r,d,c,h,u;if(e.filter&&!this._filterField(e.filter,o))return s.s6;const p=(null===(n=this._value)||void 0===n?void 0:n.data)&&(0,v.r)(this._value.data[e.key]),g=p&&"string"==typeof this._value.data[e.key]?{template:null}:p&&"object"==typeof this._value.data[e.key]?{object:null}:null!==(l=null!==(r=this._stickySelector[e.key])&&void 0!==r?r:null==e?void 0:e.selector)&&void 0!==l?l:{text:null};p&&(this._stickySelector[e.key]=g);const y=B(e),b=i&&a?this.hass.services[i][a].description_placeholders:void 0;return e.selector&&(!e.advanced||this.showAdvanced||null!==(d=this._value)&&void 0!==d&&d.data&&void 0!==this._value.data[e.key])?(0,s.qy)(q||(q=F`<ha-settings-row .narrow="${0}"> ${0} <span slot="heading">${0}</span> <span slot="description"><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,y?(0,s.qy)(E||(E=F`<ha-checkbox .key="${0}" .checked="${0}" .disabled="${0}" @change="${0}" slot="prefix"></ha-checkbox>`),e.key,this._checkedKeys.has(e.key)||(null===(c=this._value)||void 0===c?void 0:c.data)&&void 0!==this._value.data[e.key],this.disabled,this._checkboxChanged):t?(0,s.qy)(Z||(Z=F`<div slot="prefix" class="checkbox-spacer"></div>`)):"",this.hass.localize(`component.${i}.services.${a}.fields.${e.key}.name`,b)||e.name||e.key,this.hass.localize(`component.${i}.services.${a}.fields.${e.key}.description`,b)||(null==e?void 0:e.description),this._selectorContext(o),this.disabled||y&&!this._checkedKeys.has(e.key)&&(!(null!==(h=this._value)&&void 0!==h&&h.data)||void 0===this._value.data[e.key]),this.hass,g,e.key,this._serviceDataChanged,null!==(u=this._value)&&void 0!==u&&u.data?this._value.data[e.key]:void 0,e.default,this._localizeValueCallback,e.required):""},this._selectorContext=(0,n.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}`):""}}}U.styles=(0,s.AH)(A||(A=F`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}ha-checkbox{margin-left:-16px;margin-inline-start:-16px;margin-inline-end:initial}.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})],U.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],U.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],U.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],U.prototype,"narrow",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"show-advanced",type:Boolean})],U.prototype,"showAdvanced",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"show-service-id",type:Boolean})],U.prototype,"showServiceId",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-picker",type:Boolean,reflect:!0})],U.prototype,"hidePicker",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-description",type:Boolean})],U.prototype,"hideDescription",void 0),(0,a.Cg)([(0,o.wk)()],U.prototype,"_value",void 0),(0,a.Cg)([(0,o.wk)()],U.prototype,"_checkedKeys",void 0),(0,a.Cg)([(0,o.wk)()],U.prototype,"_manifest",void 0),(0,a.Cg)([(0,o.P)("ha-yaml-editor")],U.prototype,"_yamlEditor",void 0),U=(0,a.Cg)([(0,o.EM)("ha-service-control")],U),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(96196),o=i(77845),n=i(45847),l=i(71727),r=i(85694),d=(i(88945),i(67094),e([r]));r=(d.then?(await d)():d)[0];let c,h,v,u,p=e=>e;class g extends s.WF{render(){if(this.icon)return(0,s.qy)(c||(c=p`<ha-icon .icon="${0}"></ha-icon>`),this.icon);if(!this.service)return s.s6;if(!this.hass)return this._renderFallback();const e=(0,r.f$)(this.hass,this.service).then(e=>e?(0,s.qy)(h||(h=p`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback());return(0,s.qy)(v||(v=p`${0}`),(0,n.T)(e))}_renderFallback(){const e=(0,l.m)(this.service);return(0,s.qy)(u||(u=p` <ha-svg-icon .path="${0}"></ha-svg-icon> `),r.l[e]||r.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(96196),o=i(77845),n=i(22786),l=i(1087),r=i(78011),d=i(85694),c=i(95350),h=(i(75064),i(38508)),v=i(65329),u=e([h,v,d]);[h,v,d]=u.then?(await u)():u;let p,g,y,b,m,_,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",$=[{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 x 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)}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)(p||(p=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),$,this.hass.localize("ui.components.service-picker.unknown"),this._valueChanged)}_valueChanged(e){e.stopPropagation();const t=e.detail.value;t?(0,r.x)(t)&&this._setValue(t):this._setValue(void 0)}_setValue(e){this.value=e,(0,l.r)(this,"value-changed",{value:e}),(0,l.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)(y||(y=w`<span slot="supporting-text" class="code"> ${0} </span>`),e.service_id):s.s6,e.domain_name?(0,s.qy)(b||(b=w` <div slot="trailing-supporting-text" class="domain"> ${0} </div> `),e.domain_name):s.s6),this._valueRenderer=(0,n.A)((e,t)=>i=>{var a;const o=i,[n,l]=o.split(".");if(null===(a=t[n])||void 0===a||!a[l])return(0,s.qy)(m||(m=w` <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <span slot="headline">${0}</span> `),k,i);const r=this.hass.services[n][l].description_placeholders,d=e(`component.${n}.services.${l}.name`,r)||t[n][l].name||l;return(0,s.qy)(_||(_=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)(f||(f=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,n.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}`,n=(0,c.p$)(e,a),l=this.hass.services[a][o].description_placeholders,r=this.hass.localize(`component.${a}.services.${o}.name`,l)||t[a][o].name||o,d=this.hass.localize(`component.${a}.services.${o}.description`,l)||t[a][o].description||"";i.push({id:s,primary:r,secondary:d,domain_name:n,service_id:s,search_labels:{serviceId:s,domainName:n,name:r,description:d},sorting_label:s})}}),i})}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],x.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)()],x.prototype,"label",void 0),(0,a.Cg)([(0,o.MZ)()],x.prototype,"placeholder",void 0),(0,a.Cg)([(0,o.MZ)()],x.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"show-service-id",type:Boolean})],x.prototype,"showServiceId",void 0),(0,a.Cg)([(0,o.P)("ha-generic-picker")],x.prototype,"_picker",void 0),x=(0,a.Cg)([(0,o.EM)("ha-service-picker")],x),t()}catch(p){t(p)}})},13563:function(e,t,i){"use strict";i.a(e,async function(e,t){try{var a=i(40445),s=i(96196),o=i(77845),n=i(45847),l=(i(88945),i(67094),i(85694)),r=e([l]);l=(r.then?(await r)():r)[0];let d,c,h,v=e=>e;class u 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,l.Yw)(this.hass,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,n.T)(e))}_renderFallback(){return s.s6}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)()],u.prototype,"service",void 0),(0,a.Cg)([(0,o.MZ)()],u.prototype,"section",void 0),(0,a.Cg)([(0,o.MZ)()],u.prototype,"icon",void 0),u=(0,a.Cg)([(0,o.EM)("ha-service-section-icon")],u),t()}catch(d){t(d)}})},8034:function(e,t,i){"use strict";i(62953);var a=i(40445),s=i(96196),o=i(77845);let n,l,r=e=>e;class d extends s.WF{render(){return(0,s.qy)(n||(n=r` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" ?two-line="${0}" ?three-line="${0}"> <slot name="heading"></slot> <div class="secondary"><slot name="description"></slot></div> </div> </div> <div class="content"><slot></slot></div> `),!this.threeLine,this.threeLine)}constructor(...e){super(...e),this.narrow=!1,this.slim=!1,this.threeLine=!1,this.wrapHeading=!1}}d.styles=(0,s.AH)(l||(l=r`:host{display:flex;padding:0 16px;align-content:normal;align-self:auto;align-items:center}.body{padding-top:8px;padding-bottom:8px;padding-left:0;padding-inline-start:0;padding-right:16px;padding-inline-end:16px;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:4px;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:16px 0}.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:8px}::slotted(ha-switch){padding:16px 0}.secondary{white-space:normal}.prefix-wrap{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,o.MZ)({type:Boolean,reflect:!0})],d.prototype,"narrow",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],d.prototype,"slim",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"three-line"})],d.prototype,"threeLine",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],d.prototype,"wrapHeading",void 0),d=(0,a.Cg)([(0,o.EM)("ha-settings-row")],d)},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}}},96175:function(e,t,i){var a={"./ha-icon-prev":["89133","61982"],"./ha-icon-button-toolbar":["9882","30628","41983"],"./ha-alert":["38962","19695"],"./ha-icon-button-toggle":["62501","77254"],"./ha-svg-icon.ts":["67094"],"./ha-alert.ts":["38962","19695"],"./ha-icon":["88945","51146"],"./ha-icon-next.ts":["43661","63902"],"./ha-qr-code.ts":["60543","51343","62740"],"./ha-icon-overflow-menu.ts":["75248","30628","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","30628","34995","78097"],"./ha-icon-button-arrow-next":["99028","54101"],"./ha-icon-button-prev.ts":["45100","99197"],"./ha-icon-picker":["64138","46095","31065","30628","92769","62453","78398","39005","73431"],"./ha-icon-button-toolbar.ts":["9882","30628","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","46095","31065","30628","92769","62453","78398","39005","73431"],"./ha-icon-prev.ts":["89133","61982"],"./ha-icon-button-arrow-prev":["90248","17041"],"./ha-icon-button-next.ts":["3059","81049"],"./ha-icon.ts":["88945","51146"],"./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.slice(1).map(i.e)).then(function(){return i(s)})}s.keys=function(){return Object.keys(a)},s.id=96175,e.exports=s}}]);
//# sourceMappingURL=94860.69c94d2d4e7dc8e8.js.map