UNPKG

iobroker.lovelace

Version:

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

1 lines 26.4 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[40982],{69558:function(e,t,i){i.d(t,{_:function(){return o}});i(16280),i(18111),i(7588),i(62953);var r=i(5124),n=i(54495);const o=(0,n.u$)(class extends n.WL{update(e,[t,i]){return this._element&&this._element.localName===t?(i&&Object.entries(i).forEach(([e,t])=>{this._element[e]=t}),r.c0):this.render(t,i)}render(e,t){return this._element=document.createElement(e),t&&Object.entries(t).forEach(([e,t])=>{this._element[e]=t}),this._element}constructor(e){if(super(e),e.type!==n.OA.CHILD)throw new Error("dynamicElementDirective can only be used in content bindings")}})},52763:function(e,t,i){i.a(e,async function(e,r){try{i.d(t,{U:function(){return w}});i(74423),i(18111),i(7588),i(61701),i(3362),i(62953);var n=i(40445),o=i(5124),a=i(67576),s=i(69558),l=i(1087),c=i(38962),d=(i(11399),e([c]));c=(d.then?(await d)():d)[0];let u,h,m,p,b,f,v,_,y,g=e=>e;const P={boolean:()=>i.e(81347).then(i.bind(i,46990)),constant:()=>i.e(65733).then(i.bind(i,90820)),float:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(51868),i.e(62574),i.e(16113)]).then(i.bind(i,20676)),grid:()=>i.e(60761).then(i.bind(i,70208)),expandable:()=>i.e(45001).then(i.bind(i,40003)),integer:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(21543),i.e(86712),i.e(62574),i.e(12145)]).then(i.bind(i,20036)),multi_select:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(80131),i.e(58303),i.e(71739),i.e(78219)]).then(i.bind(i,36182)),positive_time_period_dict:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(67943),i.e(62574),i.e(16508),i.e(21486)]).then(i.bind(i,89422)),select:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(81034),i.e(99463),i.e(62574),i.e(26092),i.e(39005),i.e(35873),i.e(63577)]).then(i.bind(i,63804)),string:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(84725),i.e(62574),i.e(6762)]).then(i.bind(i,54753)),optional_actions:()=>Promise.all([i.e(72850),i.e(39763),i.e(34995),i.e(67395)]).then(i.bind(i,8456))},C=(e,t)=>e?!t.name||t.flatten?e:e[t.name]:void 0,E=(e,t)=>e&&t.name?e[t.name]:null,M=(e,t)=>e&&t.name?e[t.name]:null;class w extends o.WF{getFormProperties(){return{}}reportValidity(){const e=this._root;if(!e)return!0;const t=[...e.children].filter(e=>"ha-alert"!==e.localName);let i,r=!0;var n,o;(this.schema.forEach((e,n)=>{var o;const a=t[n];if(!a)return;let s=!0;if("reportValidity"in a&&"function"==typeof a.reportValidity)s=a.reportValidity();else if(e.required&&(!("type"in e)||!["boolean","constant"].includes(null!==(o=e.type)&&void 0!==o?o:""))&&(!("selector"in e)||!("boolean"in e.selector)&&!("constant"in e.selector))){const t=C(this.data,e);s=null!=t&&""!==t}s||(r=!1,i||(i=a))}),i)&&(null===(n=(o=i).focus)||void 0===n||n.call(o));return r}willUpdate(e){e.has("schema")&&this.schema&&this.schema.forEach(e=>{var t;"selector"in e||null===(t=P[e.type])||void 0===t||t.call(P)})}render(){return(0,o.qy)(u||(u=g` <div class="root" part="root"> ${0} ${0} </div> `),this.error&&this.error.base?(0,o.qy)(h||(h=g` <ha-alert alert-type="error"> ${0} </ha-alert> `),this._computeError(this.error.base,this.schema)):"",this.schema.map(e=>{var t;const i=E(this.error,e),r=M(this.warning,e);return(0,o.qy)(m||(m=g` ${0} ${0} `),i?(0,o.qy)(p||(p=g` <ha-alert own-margin alert-type="error"> ${0} </ha-alert> `),this._computeError(i,e)):r?(0,o.qy)(b||(b=g` <ha-alert own-margin alert-type="warning"> ${0} </ha-alert> `),this._computeWarning(r,e)):"","selector"in e?(0,o.qy)(f||(f=g`<ha-selector .schema="${0}" .hass="${0}" .narrow="${0}" .name="${0}" .selector="${0}" .value="${0}" .label="${0}" .disabled="${0}" .placeholder="${0}" .helper="${0}" .localizeValue="${0}" .required="${0}" .context="${0}"></ha-selector>`),e,this.hass,this.narrow,e.name,e.selector,C(this.data,e),this._computeLabel(e,this.data),e.disabled||this.disabled||!1,e.required?void 0:e.default,this._computeHelper(e),this.localizeValue,e.required||!1,this._generateContext(e)):(0,s._)(this.fieldElementName(e.type),Object.assign({schema:e,data:C(this.data,e),label:this._computeLabel(e,this.data),helper:this._computeHelper(e),disabled:this.disabled||e.disabled||!1,hass:this.hass,localize:null===(t=this.hass)||void 0===t?void 0:t.localize,computeLabel:this.computeLabel,computeHelper:this.computeHelper,localizeValue:this.localizeValue,context:this._generateContext(e)},this.getFormProperties())))}))}fieldElementName(e){return`ha-form-${e}`}_generateContext(e){if(!e.context&&!this.context)return;const t=Object.assign({},this.context);if(e.context)for(const[i,r]of Object.entries(e.context))t[i]=this.data[r];return t}createRenderRoot(){const e=super.createRenderRoot();return this.addValueChangedListener(e),e}addValueChangedListener(e){e.addEventListener("value-changed",e=>{e.stopPropagation();const t=e.target.schema;if(e.target===this)return;const i=!t.name||"flatten"in t&&t.flatten?e.detail.value:{[t.name]:e.detail.value};this.data=Object.assign(Object.assign({},this.data),i),(0,l.r)(this,"value-changed",{value:this.data})})}_computeLabel(e,t){return this.computeLabel?this.computeLabel(e,t):e?e.name:""}_computeHelper(e){return this.computeHelper?this.computeHelper(e):""}_computeError(e,t){return Array.isArray(e)?(0,o.qy)(v||(v=g`<ul> ${0} </ul>`),e.map(e=>(0,o.qy)(_||(_=g`<li> ${0} </li>`),this.computeError?this.computeError(e,t):e))):this.computeError?this.computeError(e,t):e}_computeWarning(e,t){return this.computeWarning?this.computeWarning(e,t):e}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1}}w.shadowRootOptions={mode:"open",delegatesFocus:!0},w.styles=(0,o.AH)(y||(y=g`.root>*{display:block}.root>:not([own-margin]):not(:last-child){margin-bottom:24px}ha-alert[own-margin]{margin-bottom:4px}`)),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean})],w.prototype,"narrow",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"data",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"schema",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"error",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"warning",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean})],w.prototype,"disabled",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"computeError",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"computeWarning",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"computeLabel",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"computeHelper",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"localizeValue",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"context",void 0),(0,n.Cg)([(0,a.P)(".root")],w.prototype,"_root",void 0),w=(0,n.Cg)([(0,a.EM)("ha-form")],w),r()}catch(u){r(u)}})},11399:function(e,t,i){i(3362),i(27495),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(25440),i(62953);var r=i(40445),n=i(5124),o=i(67576),a=i(22786),s=i(69558),l=i(95311);let c,d=e=>e;const u={action:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(80131),i.e(72130),i.e(85010),i.e(67218),i.e(98470),i.e(58303),i.e(81034),i.e(23659),i.e(54066),i.e(25950),i.e(64006),i.e(79185),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(34310),i.e(55392),i.e(12009),i.e(20282),i.e(13628),i.e(16508),i.e(28501),i.e(84207),i.e(31863),i.e(283),i.e(30513),i.e(33547)]).then(i.bind(i,6274)),addon:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(26787),i.e(62574),i.e(26092),i.e(39005),i.e(71625),i.e(43305)]).then(i.bind(i,36784)),automation_behavior:()=>Promise.all([i.e(72850),i.e(81034),i.e(99220)]).then(i.bind(i,66034)),app:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(26787),i.e(62574),i.e(26092),i.e(39005),i.e(71625)]).then(i.bind(i,48585)),area:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(83523),i.e(62574),i.e(26092),i.e(39005),i.e(13905)]).then(i.bind(i,81857)),areas_display:()=>Promise.all([i.e(46095),i.e(64657),i.e(68273),i.e(64280),i.e(47956)]).then(i.bind(i,38235)),attribute:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(49168),i.e(62574),i.e(26092),i.e(39005),i.e(58072)]).then(i.bind(i,71498)),assist_pipeline:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(43048),i.e(63071)]).then(i.bind(i,83642)),boolean:()=>Promise.all([i.e(93282),i.e(19623)]).then(i.bind(i,30714)),choose:()=>i.e(93934).then(i.bind(i,58141)),color_rgb:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(7106),i.e(62574),i.e(21332)]).then(i.bind(i,34931)),condition:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(23659),i.e(54066),i.e(25950),i.e(48106),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(34310),i.e(12009),i.e(20282),i.e(13628),i.e(28501),i.e(84207),i.e(283),i.e(77190)]).then(i.bind(i,81539)),config_entry:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(8706),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(81594)]).then(i.bind(i,49347)),conversation_agent:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(20667),i.e(44770)]).then(i.bind(i,94215)),constant:()=>i.e(77057).then(i.bind(i,39032)),country:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(84887),i.e(65799),i.e(62574),i.e(26092),i.e(39005),i.e(64157),i.e(47352)]).then(i.bind(i,94164)),date:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(81178),i.e(62574),i.e(36553)]).then(i.bind(i,94351)),datetime:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(62574),i.e(12466)]).then(i.bind(i,39045)),device:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(23659),i.e(33246),i.e(62574),i.e(26092),i.e(39005),i.e(83128)]).then(i.bind(i,2270)),duration:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(90324),i.e(62574),i.e(16508),i.e(24858)]).then(i.bind(i,79488)),entity:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(69923),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(1535),i.e(34435)]).then(i.bind(i,73863)),entity_name:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(80607),i.e(62574),i.e(26092),i.e(39005),i.e(3067)]).then(i.bind(i,7563)),statistic:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(72224),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(54884),i.e(88493)]).then(i.bind(i,28072)),file:()=>Promise.all([i.e(72850),i.e(49224)]).then(i.bind(i,25078)),floor:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(89100),i.e(54192),i.e(62574),i.e(26092),i.e(39005),i.e(33790),i.e(94628)]).then(i.bind(i,9040)),label:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(79808),i.e(62574),i.e(26092),i.e(39005),i.e(66201),i.e(40231)]).then(i.bind(i,99560)),language:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(82025),i.e(62574),i.e(26092),i.e(39005),i.e(59324)]).then(i.bind(i,15430)),navigation:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(83113),i.e(99788),i.e(54066),i.e(83502),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(19112),i.e(30002),i.e(59704),i.e(25322),i.e(89747),i.e(71572),i.e(12009),i.e(20282),i.e(28501),i.e(46152),i.e(33173)]).then(i.bind(i,58350)),number:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(21543),i.e(62574),i.e(64809)]).then(i.bind(i,31157)),numeric_threshold:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(88992),i.e(99386)]).then(i.bind(i,18719)),object:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(72130),i.e(85010),i.e(42981),i.e(34310),i.e(87352)]).then(i.bind(i,97951)),period:()=>i.e(54234).then(i.bind(i,40929)),qr_code:()=>Promise.all([i.e(72850),i.e(51343),i.e(90791)]).then(i.bind(i,35313)),select:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(81034),i.e(62574),i.e(26092),i.e(39005),i.e(35873),i.e(99457)]).then(i.bind(i,856)),selector:()=>i.e(77810).then(i.bind(i,13897)),serial_port:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(68432),i.e(62574),i.e(26092),i.e(39005),i.e(87464)]).then(i.bind(i,82178)),state:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(19269),i.e(62574),i.e(26092),i.e(39005),i.e(48007)]).then(i.bind(i,12995)),backup_location:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(80131),i.e(83241),i.e(72777)]).then(i.bind(i,16360)),stt:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(98286),i.e(87890)]).then(i.bind(i,42999)),target:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(40420),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(13628),i.e(14351),i.e(24891),i.e(45862)]).then(i.bind(i,84909)),template:()=>Promise.all([i.e(72850),i.e(39763),i.e(72130),i.e(33387),i.e(34310),i.e(15732)]).then(i.bind(i,62166)),text:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(37694),i.e(62574),i.e(55844)]).then(i.bind(i,47971)),time:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(92351),i.e(62574),i.e(17066)]).then(i.bind(i,42945)),icon:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(86325),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(82568)]).then(i.bind(i,14885)),media:()=>Promise.all([i.e(72850),i.e(33887),i.e(91845),i.e(22308)]).then(i.bind(i,59422)),theme:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(4406),i.e(62574),i.e(26092),i.e(39005),i.e(5127)]).then(i.bind(i,77655)),timezone:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(56253),i.e(12727),i.e(62574),i.e(26092),i.e(39005),i.e(78464),i.e(41460)]).then(i.bind(i,6719)),button_toggle:()=>i.e(7774).then(i.bind(i,79949)),trigger:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(80131),i.e(72130),i.e(85010),i.e(67218),i.e(58303),i.e(81034),i.e(23659),i.e(54066),i.e(25950),i.e(4379),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(34310),i.e(12009),i.e(20282),i.e(13628),i.e(28501),i.e(84207),i.e(31863),i.e(155)]).then(i.bind(i,45078)),tts:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(75905),i.e(56146)]).then(i.bind(i,59447)),tts_voice:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(53524),i.e(58485)]).then(i.bind(i,41188)),location:()=>Promise.all([i.e(72850),i.e(66139),i.e(70622),i.e(73512),i.e(8851),i.e(12122),i.e(76696),i.e(83462)]).then(i.bind(i,21160)),color_temp:()=>Promise.all([i.e(72850),i.e(39763),i.e(99788),i.e(21543),i.e(29628),i.e(59704),i.e(20282),i.e(68611)]).then(i.bind(i,90780)),ui_action:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(72130),i.e(85010),i.e(83113),i.e(98470),i.e(99788),i.e(54066),i.e(25950),i.e(31746),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(19112),i.e(34310),i.e(30002),i.e(59704),i.e(25322),i.e(55392),i.e(89747),i.e(71572),i.e(36332),i.e(12009),i.e(20282),i.e(28501),i.e(46152),i.e(59800)]).then(i.bind(i,38389)),ui_color:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(46051),i.e(62574),i.e(26092),i.e(39005),i.e(80651)]).then(i.bind(i,52744)),ui_state_content:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(67493),i.e(62574),i.e(26092),i.e(39005),i.e(48408)]).then(i.bind(i,96074))},h=new Set(["ui-action","ui-color"]);class m extends n.WF{reportValidity(){var e,t;return this._selectorElement&&"reportValidity"in this._selectorElement&&"function"==typeof this._selectorElement.reportValidity?null===(e=null===(t=this._selectorElement)||void 0===t?void 0:t.reportValidity())||void 0===e||e:!this.required||void 0!==this.value&&null!==this.value&&""!==this.value}async focus(){var e;await this.updateComplete,null===(e=this._selectorElement)||void 0===e||e.focus()}get _type(){const e=Object.keys(this.selector)[0];return h.has(e)?e.replace("-","_"):e}willUpdate(e){var t;e.has("selector")&&this.selector&&(null===(t=u[this._type])||void 0===t||t.call(u))}render(){return(0,n.qy)(c||(c=d` ${0} `),(0,s._)(`ha-selector-${this._type}`,{hass:this.hass,narrow:this.narrow,name:this.name,selector:this._handleLegacySelector(this.selector),value:this.value,label:this.label,placeholder:this.placeholder,disabled:this.disabled,required:this.required,helper:this.helper,context:this.context,localizeValue:this.localizeValue,id:"selector"}))}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1,this.required=!0,this._handleLegacySelector=(0,a.A)(e=>{if("entity"in e)return(0,l.UU)(e);if("device"in e)return(0,l.tD)(e);const t=Object.keys(this.selector)[0];return h.has(t)?{[t.replace("-","_")]:e[t]}:e})}}(0,r.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean})],m.prototype,"narrow",void 0),(0,r.Cg)([(0,o.MZ)()],m.prototype,"name",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"selector",void 0),(0,r.Cg)([(0,o.MZ)()],m.prototype,"value",void 0),(0,r.Cg)([(0,o.MZ)()],m.prototype,"label",void 0),(0,r.Cg)([(0,o.MZ)()],m.prototype,"helper",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"localizeValue",void 0),(0,r.Cg)([(0,o.MZ)()],m.prototype,"placeholder",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean})],m.prototype,"disabled",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean})],m.prototype,"required",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,r.Cg)([(0,o.P)("#selector",!0)],m.prototype,"_selectorElement",void 0),m=(0,r.Cg)([(0,o.EM)("ha-selector")],m)},95311:function(e,t,i){i.d(t,{DF:function(){return f},Lo:function(){return C},MH:function(){return h},MM:function(){return v},Qz:function(){return b},Ru:function(){return y},UU:function(){return g},_7:function(){return p},bZ:function(){return m},m0:function(){return u},tD:function(){return P},vX:function(){return _},wY:function(){return E}});var r=i(86518),n=(i(78350),i(74423),i(44114),i(30237),i(18111),i(22489),i(30531),i(7588),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953),i(44537)),o=i(69093),a=i(82286),s=i(24367),l=i(58594);const c=["domain","integration","device_class"],d=["integration","manufacturer","model"],u=(e,t,i,r,n,o,a)=>{const s=[],l=[],c=[];return Object.values(i).forEach(i=>{i.labels.includes(t)&&b(e,n,r,i.area_id,o,a)&&c.push(i.area_id)}),Object.values(r).forEach(i=>{i.labels.includes(t)&&f(e.states,Object.values(n),i,o,a)&&l.push(i.id)}),Object.values(n).forEach(i=>{i.labels.includes(t)&&v(e.states[i.entity_id],o,a)&&s.push(i.entity_id)}),{areas:c,devices:l,entities:s}},h=(e,t,i,r,n)=>{const o=[];return Object.values(i).forEach(i=>{i.floor_id===t&&b(e,e.entities,e.devices,i.area_id,r,n)&&o.push(i.area_id)}),{areas:o}},m=(e,t,i,r,n,o)=>{const a=[],s=[];return Object.values(i).forEach(i=>{i.area_id===t&&f(e.states,Object.values(r),i,n,o)&&s.push(i.id)}),Object.values(r).forEach(i=>{i.area_id===t&&v(e.states[i.entity_id],n,o)&&a.push(i.entity_id)}),{devices:s,entities:a}},p=(e,t,i,r,n)=>{const o=[];return Object.values(i).forEach(i=>{i.device_id===t&&v(e.states[i.entity_id],r,n)&&o.push(i.entity_id)}),{entities:o}},b=(e,t,i,r,n,o)=>!!Object.values(i).some(i=>!(i.area_id!==r||!f(e.states,Object.values(t),i,n,o)))||Object.values(t).some(t=>!(t.area_id!==r||!v(e.states[t.entity_id],n,o))),f=(e,t,i,r,o)=>{var a,s;const c=o?(0,l.fk)(o,t):void 0;if(null!==(a=r.target)&&void 0!==a&&a.device&&!(0,n.e)(r.target.device).some(e=>_(e,i,c)))return!1;if(null!==(s=r.target)&&void 0!==s&&s.entity){return t.filter(e=>e.device_id===i.id).some(t=>{const i=e[t.entity_id];return v(i,r,o)})}return!0},v=(e,t,i)=>{var r;return!!e&&(null===(r=t.target)||void 0===r||!r.entity||(0,n.e)(t.target.entity).some(t=>y(t,e,i)))},_=(e,t,i)=>{const{manufacturer:r,model:n,model_id:o,integration:a}=e;if(r&&t.manufacturer!==r)return!1;if(n&&t.model!==n)return!1;if(o&&t.model_id!==o)return!1;var s;if(a&&i&&(null==i||null===(s=i[t.id])||void 0===s||!s.has(a)))return!1;return!0},y=(e,t,i)=>{var r;const{domain:s,device_class:l,supported_features:c,unit_of_measurement:d,integration:u}=e;if(s){const e=(0,o.t)(t);if(Array.isArray(s)?!s.includes(e):e!==s)return!1}if(l){const e=t.attributes.device_class;if(e&&Array.isArray(l)?!l.includes(e):e!==l)return!1}if(c&&!(0,n.e)(c).some(e=>(0,a.$)(t,e)))return!1;if(d){const e=t.attributes.unit_of_measurement;if(!e||(Array.isArray(d)?!d.includes(e):e!==d))return!1}return!u||(null==i||null===(r=i[t.entity_id])||void 0===r?void 0:r.domain)===u},g=e=>{if(!e.entity)return{entity:null};if("filter"in e.entity)return e;const t=e.entity,{domain:i,integration:n,device_class:o}=t,a=(0,r.A)(t,c);return i||n||o?{entity:Object.assign(Object.assign({},a),{},{filter:{domain:i,integration:n,device_class:o}})}:{entity:a}},P=e=>{if(!e.device)return{device:null};if("filter"in e.device)return e;const t=e.device,{integration:i,manufacturer:n,model:o}=t,a=(0,r.A)(t,d);return i||n||o?{device:Object.assign(Object.assign({},a),{},{filter:{integration:i,manufacturer:n,model:o}})}:{device:a}},C=e=>{let t;var i;if("target"in e)t=(0,n.e)(null===(i=e.target)||void 0===i?void 0:i.entity);else if("entity"in e){var r,o;if(null!==(r=e.entity)&&void 0!==r&&r.include_entities)return;t=(0,n.e)(null===(o=e.entity)||void 0===o?void 0:o.filter)}if(!t)return;const a=t.flatMap(e=>e.integration||e.device_class||e.supported_features||!e.domain?[]:(0,n.e)(e.domain).filter(e=>(0,s.z)(e)));return[...new Set(a)]},E=(e,t,i,r,o,a={target:{}})=>{if(!t)return[];const s=new Set((0,n.e)(t.entity_id)),l=new Set((0,n.e)(t.device_id)),c=new Set((0,n.e)(t.area_id)),d=new Set((0,n.e)(t.floor_id));return new Set((0,n.e)(t.label_id)).forEach(t=>{const n=u(e,t,o,r,i,a);n.devices.forEach(e=>l.add(e)),n.entities.forEach(e=>s.add(e)),n.areas.forEach(e=>c.add(e))}),d.forEach(t=>{h(e,t,o,a).areas.forEach(e=>c.add(e))}),c.forEach(t=>{const n=m(e,t,r,i,a);n.devices.forEach(e=>l.add(e)),n.entities.forEach(e=>s.add(e))}),l.forEach(t=>{p(e,t,i,a).entities.forEach(e=>s.add(e))}),Array.from(s)}},24367:function(e,t,i){i.d(t,{L:function(){return n},z:function(){return o}});var r=i(23832);const n=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],o=(0,r.g)(n)},6933:function(e,t,i){i.a(e,async function(e,r){try{i.r(t),i.d(t,{HuiAlarmModesCardFeatureEditor:function(){return f}});var n=i(86518),o=(i(94490),i(18111),i(61701),i(62953),i(40445)),a=i(5124),s=i(67576),l=i(22786),c=i(1087),d=i(52763),u=i(9182),h=e([d]);d=(h.then?(await h)():h)[0];const m=["customize_modes"];let p,b=e=>e;class f extends a.WF{setConfig(e){this._config=e}render(){var e,t;if(!this.hass||!this._config)return a.s6;const i=Object.assign(Object.assign({},this._config),{},{customize_modes:void 0!==this._config.modes}),r=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[null===(t=this.context)||void 0===t?void 0:t.entity_id]:void 0,n=this._schema(this.hass.localize,r,i.customize_modes);return(0,a.qy)(p||(p=b` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> `),this.hass,i,n,this._computeLabelCallback,this._valueChanged)}_valueChanged(e){var t,i;const r=e.detail.value,{customize_modes:o}=r,a=(0,n.A)(r,m),s=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[null===(i=this.context)||void 0===i?void 0:i.entity_id]:void 0;o&&!a.modes&&(a.modes=s?(0,u.SR)(s).reverse():[]),!o&&a.modes&&delete a.modes,(0,c.r)(this,"config-changed",{config:a})}constructor(...e){super(...e),this._schema=(0,l.A)((e,t,i)=>[{name:"customize_modes",selector:{boolean:{}}},...i?[{name:"modes",selector:{select:{multiple:!0,reorder:!0,options:t?(0,u.SR)(t).map(t=>({value:t,label:`${e(`ui.panel.lovelace.editor.features.types.alarm-modes.modes_list.${t}`)}`})):[]}}}]:[]]),this._computeLabelCallback=e=>{switch(e.name){case"modes":case"customize_modes":return this.hass.localize(`ui.panel.lovelace.editor.features.types.alarm-modes.${e.name}`);default:return""}}}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],f.prototype,"context",void 0),(0,o.Cg)([(0,s.wk)()],f.prototype,"_config",void 0),f=(0,o.Cg)([(0,s.EM)("hui-alarm-modes-card-feature-editor")],f),r()}catch(m){r(m)}})},48646:function(e,t,i){var r=i(69565),n=i(28551),o=i(1767),a=i(50851);e.exports=function(e,t){t&&"string"==typeof e||n(e);var i=a(e);return o(n(void 0!==i?r(i,e):e))}},78350:function(e,t,i){var r=i(46518),n=i(70259),o=i(79306),a=i(48981),s=i(26198),l=i(1469);r({target:"Array",proto:!0},{flatMap:function(e){var t,i=a(this),r=s(i);return o(e),t=l(i,0),n(t,i,i,r,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},30237:function(e,t,i){i(6469)("flatMap")},30531:function(e,t,i){var r=i(46518),n=i(69565),o=i(79306),a=i(28551),s=i(1767),l=i(48646),c=i(19462),d=i(9539),u=i(96395),h=i(30684),m=i(84549);var p=!u&&!h("flatMap",function(){}),b=!u&&!p&&m("flatMap",TypeError),f=u||p||b||function(){try{var e=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(e){return e});e.next(),e.return()}catch(t){return!0}}(),v=c(function(){for(var e,t,i=this.iterator,r=this.mapper;;){if(t=this.inner)try{if(!(e=a(n(t.next,t.iterator))).done)return e.value;this.inner=null}catch(o){d(i,"throw",o)}if(e=a(n(this.next,i)),this.done=!!e.done)return;try{this.inner=l(r(e.value,this.counter++),!1)}catch(o){d(i,"throw",o)}}});r({target:"Iterator",proto:!0,real:!0,forced:f},{flatMap:function(e){a(this);try{o(e)}catch(t){d(this,"throw",t)}return b?n(b,this,e):new v(s(this),{mapper:e,inner:null})}})},54495:function(e,t,i){i.d(t,{OA:function(){return r.OA},WL:function(){return r.WL},u$:function(){return r.u$}});var r=i(42017)}}]);