supervisor/supervisor/api/panel/frontend_es5/9905.6f322fb797681e1a.js
github-actions[bot] 0513ea0438
Update frontend to version 20250806.0 (#5810)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-07 11:10:34 +02:00

2 lines
13 KiB
JavaScript

"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["9905"],{34394:function(e,t,i){i.d(t,{I:function(){return s},k:function(){return a}});i(26847),i(67886),i(65451),i(46015),i(38334),i(94880),i(75643),i(29761),i(27530);const a=new Set(["primary","accent","disabled","red","pink","purple","deep-purple","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","deep-orange","brown","light-grey","grey","dark-grey","blue-grey","black","white"]);function s(e){return a.has(e)?`var(--${e}-color)`:e}},11992:function(e,t,i){i.a(e,async function(e,t){try{i(84730),i(39710),i(26847),i(81738),i(33480),i(94814),i(22960),i(6989),i(72489),i(1455),i(67886),i(65451),i(46015),i(38334),i(94880),i(75643),i(29761),i(56389),i(44261),i(27530);var a=i(73742),s=i(59048),o=i(7616),l=i(28105),r=i(39884),n=i(44272),c=i(10500),d=i(27831),h=i(72242),u=i(6291),p=i(54614),_=i(64879),b=(i(993),e([_]));_=(b.then?(await b)():b)[0];let v,y,m,g,f,C=e=>e;const $="M17.63,5.84C17.27,5.33 16.67,5 16,5H5A2,2 0 0,0 3,7V17A2,2 0 0,0 5,19H16C16.67,19 17.27,18.66 17.63,18.15L22,12L17.63,5.84Z",k="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",w="___ADD_NEW___",A="___NO_LABELS___";class L extends((0,u.f)(s.oi)){async open(){var e;await this.updateComplete,await(null===(e=this._picker)||void 0===e?void 0:e.open())}hassSubscribe(){return[(0,d.f4)(this.hass.connection,e=>{this._labels=e})]}render(){var e;const t=null!==(e=this.placeholder)&&void 0!==e?e:this.hass.localize("ui.components.label-picker.label"),i=this._computeValueRenderer(this._labels);return(0,s.dy)(v||(v=C` <ha-generic-picker .hass="${0}" .autofocus="${0}" .label="${0}" .notFoundLabel="${0}" .placeholder="${0}" .value="${0}" .getItems="${0}" .getAdditionalItems="${0}" .valueRenderer="${0}" @value-changed="${0}"> </ha-generic-picker> `),this.hass,this.autofocus,this.label,this.hass.localize("ui.components.label-picker.no_match"),t,this.value,this._getItems,this._getAdditionalItems,i,this._valueChanged)}_valueChanged(e){e.stopPropagation();const t=e.detail.value;if(t!==A)if(t){if(t.startsWith(w)){this.hass.loadFragmentTranslation("config");const e=t.substring(w.length);return void(0,p.T)(this,{suggestedName:e,createEntry:async e=>{try{const t=await(0,d.jo)(this.hass,e);this._setValue(t.label_id)}catch(t){(0,h.Ys)(this,{title:this.hass.localize("ui.components.label-picker.failed_create_label"),text:t.message})}}})}this._setValue(t)}else this._setValue(void 0)}_setValue(e){this.value=e,setTimeout(()=>{(0,r.B)(this,"value-changed",{value:e}),(0,r.B)(this,"change")},0)}constructor(...e){super(...e),this.noAdd=!1,this.disabled=!1,this.required=!1,this._labelMap=(0,l.Z)(e=>e?new Map(e.map(e=>[e.label_id,e])):new Map),this._computeValueRenderer=(0,l.Z)(e=>t=>{const i=this._labelMap(e).get(t);return i?(0,s.dy)(m||(m=C` ${0} <span slot="headline">${0}</span> `),i.icon?(0,s.dy)(g||(g=C`<ha-icon slot="start" .icon="${0}"></ha-icon>`),i.icon):(0,s.dy)(f||(f=C`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),$),i.name):(0,s.dy)(y||(y=C` <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <span slot="headline">${0}</span> `),$,t)}),this._getLabels=(0,l.Z)((e,t,i,a,s,o,l,r,d,h)=>{if(!e||0===e.length)return[{id:A,primary:this.hass.localize("ui.components.label-picker.no_labels"),icon_path:$}];const u=Object.values(i),p=Object.values(a);let _,b,v={};(s||o||l||r||d)&&(v=(0,c.R6)(p),_=u,b=p.filter(e=>e.labels.length>0),s&&(_=_.filter(e=>{const t=v[e.id];return!(!t||!t.length)&&v[e.id].some(e=>s.includes((0,n.M)(e.entity_id)))}),b=b.filter(e=>s.includes((0,n.M)(e.entity_id)))),o&&(_=_.filter(e=>{const t=v[e.id];return!t||!t.length||p.every(e=>!o.includes((0,n.M)(e.entity_id)))}),b=b.filter(e=>!o.includes((0,n.M)(e.entity_id)))),l&&(_=_.filter(e=>{const t=v[e.id];return!(!t||!t.length)&&v[e.id].some(e=>{const t=this.hass.states[e.entity_id];return!!t&&(t.attributes.device_class&&l.includes(t.attributes.device_class))})}),b=b.filter(e=>{const t=this.hass.states[e.entity_id];return t.attributes.device_class&&l.includes(t.attributes.device_class)})),r&&(_=_.filter(e=>r(e))),d&&(_=_.filter(e=>{const t=v[e.id];return!(!t||!t.length)&&v[e.id].some(e=>{const t=this.hass.states[e.entity_id];return!!t&&d(t)})}),b=b.filter(e=>{const t=this.hass.states[e.entity_id];return!!t&&d(t)})));let y=e;const m=new Set;let g;_&&(g=_.filter(e=>e.area_id).map(e=>e.area_id),_.forEach(e=>{e.labels.forEach(e=>m.add(e))})),b&&(g=(null!=g?g:[]).concat(b.filter(e=>e.area_id).map(e=>e.area_id)),b.forEach(e=>{e.labels.forEach(e=>m.add(e))})),g&&g.forEach(e=>{t[e].labels.forEach(e=>m.add(e))}),h&&(y=y.filter(e=>!h.includes(e.label_id))),(_||b)&&(y=y.filter(e=>m.has(e.label_id)));return y.map(e=>({id:e.label_id,primary:e.name,icon:e.icon||void 0,icon_path:e.icon?void 0:$,sorting_label:e.name,search_labels:[e.name,e.label_id,e.description].filter(e=>Boolean(e))}))}),this._getItems=()=>this._getLabels(this._labels,this.hass.areas,this.hass.devices,this.hass.entities,this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.excludeLabels),this._allLabelNames=(0,l.Z)(e=>e?[...new Set(e.map(e=>e.name.toLowerCase()).filter(Boolean))]:[]),this._getAdditionalItems=e=>{if(this.noAdd)return[];const t=this._allLabelNames(this._labels);return e&&!t.includes(e.toLowerCase())?[{id:w+e,primary:this.hass.localize("ui.components.label-picker.add_new_sugestion",{name:e}),icon_path:k}]:[{id:w,primary:this.hass.localize("ui.components.label-picker.add_new"),icon_path:k}]}}}(0,a.__decorate)([(0,o.Cb)({attribute:!1})],L.prototype,"hass",void 0),(0,a.__decorate)([(0,o.Cb)()],L.prototype,"label",void 0),(0,a.__decorate)([(0,o.Cb)()],L.prototype,"value",void 0),(0,a.__decorate)([(0,o.Cb)()],L.prototype,"helper",void 0),(0,a.__decorate)([(0,o.Cb)()],L.prototype,"placeholder",void 0),(0,a.__decorate)([(0,o.Cb)({type:Boolean,attribute:"no-add"})],L.prototype,"noAdd",void 0),(0,a.__decorate)([(0,o.Cb)({type:Array,attribute:"include-domains"})],L.prototype,"includeDomains",void 0),(0,a.__decorate)([(0,o.Cb)({type:Array,attribute:"exclude-domains"})],L.prototype,"excludeDomains",void 0),(0,a.__decorate)([(0,o.Cb)({type:Array,attribute:"include-device-classes"})],L.prototype,"includeDeviceClasses",void 0),(0,a.__decorate)([(0,o.Cb)({type:Array,attribute:"exclude-label"})],L.prototype,"excludeLabels",void 0),(0,a.__decorate)([(0,o.Cb)({attribute:!1})],L.prototype,"deviceFilter",void 0),(0,a.__decorate)([(0,o.Cb)({attribute:!1})],L.prototype,"entityFilter",void 0),(0,a.__decorate)([(0,o.Cb)({type:Boolean})],L.prototype,"disabled",void 0),(0,a.__decorate)([(0,o.Cb)({type:Boolean})],L.prototype,"required",void 0),(0,a.__decorate)([(0,o.SB)()],L.prototype,"_labels",void 0),(0,a.__decorate)([(0,o.IO)("ha-generic-picker")],L.prototype,"_picker",void 0),L=(0,a.__decorate)([(0,o.Mo)("ha-label-picker")],L),t()}catch(v){t(v)}})},80032:function(e,t,i){i.a(e,async function(e,t){try{i(39710),i(26847),i(18574),i(81738),i(94814),i(22960),i(6989),i(1455),i(56389),i(27530);var a=i(73742),s=i(59048),o=i(7616),l=i(88245),r=i(28105),n=i(34394),c=i(39884),d=i(36221),h=i(27831),u=i(6291),p=i(54614),_=(i(67801),i(96005),i(11992)),b=e([_]);_=(b.then?(await b)():b)[0];let v,y,m,g,f,C,$=e=>e;class k extends((0,u.f)(s.oi)){async open(){var e;await this.updateComplete,await(null===(e=this.labelPicker)||void 0===e?void 0:e.open())}async focus(){var e;await this.updateComplete,await(null===(e=this.labelPicker)||void 0===e?void 0:e.focus())}hassSubscribe(){return[(0,h.f4)(this.hass.connection,e=>{const t={};e.forEach(e=>{t[e.label_id]=e}),this._labels=t})]}render(){const e=this._sortedLabels(this.value,this._labels,this.hass.locale.language);return(0,s.dy)(v||(v=$` ${0} ${0} <ha-label-picker .hass="${0}" .helper="${0}" .disabled="${0}" .required="${0}" .placeholder="${0}" .excludeLabels="${0}" @value-changed="${0}"> </ha-label-picker> `),this.label?(0,s.dy)(y||(y=$`<label>${0}</label>`),this.label):s.Ld,null!=e&&e.length?(0,s.dy)(m||(m=$`<ha-chip-set> ${0} </ha-chip-set>`),(0,l.r)(e,e=>null==e?void 0:e.label_id,e=>{const t=null!=e&&e.color?(0,n.I)(e.color):void 0;return(0,s.dy)(g||(g=$` <ha-input-chip .item="${0}" @remove="${0}" @click="${0}" .label="${0}" selected="selected" style="${0}"> ${0} </ha-input-chip> `),e,this._removeItem,this._openDetail,null==e?void 0:e.name,t?`--color: ${t}`:"",null!=e&&e.icon?(0,s.dy)(f||(f=$`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),e.icon):s.Ld)})):s.Ld,this.hass,this.helper,this.disabled,this.required,this.placeholder,this.value,this._labelChanged)}get _value(){return this.value||[]}_removeItem(e){const t=e.currentTarget.item;this._setValue(this._value.filter(e=>e!==t.label_id))}_openDetail(e){const t=e.currentTarget.item;(0,p.T)(this,{entry:t,updateEntry:async e=>{await(0,h.$0)(this.hass,t.label_id,e)}})}_labelChanged(e){e.stopPropagation();const t=e.detail.value;t&&!this._value.includes(t)&&(this._setValue([...this._value,t]),this.labelPicker.value="")}_setValue(e){this.value=e,setTimeout(()=>{(0,c.B)(this,"value-changed",{value:e}),(0,c.B)(this,"change")},0)}constructor(...e){super(...e),this.noAdd=!1,this.disabled=!1,this.required=!1,this._sortedLabels=(0,r.Z)((e,t,i)=>null==e?void 0:e.map(e=>null==t?void 0:t[e]).sort((e,t)=>(0,d.$K)((null==e?void 0:e.name)||"",(null==t?void 0:t.name)||"",i)))}}k.styles=(0,s.iv)(C||(C=$`ha-chip-set{margin-bottom:8px}ha-input-chip{--md-input-chip-selected-container-color:var(--color, var(--grey-color));--ha-input-chip-selected-container-opacity:0.5;--md-input-chip-selected-outline-width:1px}label{display:block;margin:0 0 8px}`)),(0,a.__decorate)([(0,o.Cb)({attribute:!1})],k.prototype,"hass",void 0),(0,a.__decorate)([(0,o.Cb)()],k.prototype,"label",void 0),(0,a.__decorate)([(0,o.Cb)({attribute:!1})],k.prototype,"value",void 0),(0,a.__decorate)([(0,o.Cb)()],k.prototype,"helper",void 0),(0,a.__decorate)([(0,o.Cb)()],k.prototype,"placeholder",void 0),(0,a.__decorate)([(0,o.Cb)({type:Boolean,attribute:"no-add"})],k.prototype,"noAdd",void 0),(0,a.__decorate)([(0,o.Cb)({type:Array,attribute:"include-domains"})],k.prototype,"includeDomains",void 0),(0,a.__decorate)([(0,o.Cb)({type:Array,attribute:"exclude-domains"})],k.prototype,"excludeDomains",void 0),(0,a.__decorate)([(0,o.Cb)({type:Array,attribute:"include-device-classes"})],k.prototype,"includeDeviceClasses",void 0),(0,a.__decorate)([(0,o.Cb)({type:Array,attribute:"exclude-label"})],k.prototype,"excludeLabels",void 0),(0,a.__decorate)([(0,o.Cb)({attribute:!1})],k.prototype,"deviceFilter",void 0),(0,a.__decorate)([(0,o.Cb)({attribute:!1})],k.prototype,"entityFilter",void 0),(0,a.__decorate)([(0,o.Cb)({type:Boolean})],k.prototype,"disabled",void 0),(0,a.__decorate)([(0,o.Cb)({type:Boolean})],k.prototype,"required",void 0),(0,a.__decorate)([(0,o.SB)()],k.prototype,"_labels",void 0),(0,a.__decorate)([(0,o.IO)("ha-label-picker",!0)],k.prototype,"labelPicker",void 0),k=(0,a.__decorate)([(0,o.Mo)("ha-labels-picker")],k),t()}catch(v){t(v)}})},27831:function(e,t,i){i.d(t,{$0:function(){return d},f4:function(){return n},jo:function(){return c}});i(18574),i(87799);var a=i(88865),s=i(36221),o=i(87639);const l=e=>e.sendMessagePromise({type:"config/label_registry/list"}).then(e=>e.sort((e,t)=>(0,s.$K)(e.name,t.name))),r=(e,t)=>e.subscribeEvents((0,o.D)(()=>l(e).then(e=>t.setState(e,!0)),500,!0),"label_registry_updated"),n=(e,t)=>(0,a.B)("_labelRegistry",l,r,e,t),c=(e,t)=>e.callWS(Object.assign({type:"config/label_registry/create"},t)),d=(e,t,i)=>e.callWS(Object.assign({type:"config/label_registry/update",label_id:t},i))},6291:function(e,t,i){i.d(t,{f:function(){return o}});i(39710),i(26847),i(81738),i(72489),i(1455),i(56389),i(27530);var a=i(73742),s=i(7616);const o=e=>{class t extends e{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then(e=>e()):e()}this.__unsubs=void 0}}updated(e){if(super.updated(e),e.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of e.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var e;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(e=this.hassSubscribeRequiredHostProps)&&void 0!==e&&e.some(e=>void 0===this[e])||(this.__unsubs=this.hassSubscribe())}}return(0,a.__decorate)([(0,s.Cb)({attribute:!1})],t.prototype,"hass",void 0),t}},54614:function(e,t,i){i.d(t,{T:function(){return o}});i(26847),i(1455),i(27530);var a=i(39884);const s=()=>Promise.all([i.e("7063"),i.e("5696"),i.e("970"),i.e("4205")]).then(i.bind(i,44730)),o=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"dialog-label-detail",dialogImport:s,dialogParams:t})}}}]);
//# sourceMappingURL=9905.6f322fb797681e1a.js.map