iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 48.4 kB
JavaScript
/*! For license information please see 66006.4c23e295121136dc.js.LICENSE.txt */
export const __rspack_esm_id=66006;export const __rspack_esm_ids=[66006];export const __webpack_modules__={16629(e,t,r){r.d(t,{E7:()=>u,Mn:()=>a,P9:()=>d,lf:()=>h});r(18111),r(61701);var i=r(63004);const a=e=>{const t=e/100;return[Math.round(o(t)),Math.round(n(t)),Math.round(s(t))]},o=e=>{if(e<=66)return 255;const t=329.698727446*(e-60)**-.1332047592;return(0,i.q)(t,0,255)},n=e=>{let t;return t=e<=66?99.4708025861*Math.log(e)-161.1195681661:288.1221695283*(e-60)**-.0755148492,(0,i.q)(t,0,255)},s=e=>{if(e>=66)return 255;if(e<=19)return 0;const t=138.5177312231*Math.log(e-10)-305.0447927307;return(0,i.q)(t,0,255)},l=(e,t)=>{const r=Math.max(...e),i=Math.max(...t);let a;return a=0===i?0:r/i,t.map(e=>Math.round(e*a))},d=e=>0===e?1e6:Math.floor(1e6/e),c=e=>0===e?1e6:Math.floor(1e6/e),h=(e,t,r)=>{const[i,o,n,s,h]=e,u=c(t??2700),m=c(r??6500),p=u-m;let _;try{_=h/(s+h)}catch(e){_=.5}const b=m+_*p,f=b?d(b):0,[g,y,w]=a(f),v=Math.max(s,h)/255;return l([i,o,n,s,h],[i+g*v,o+y*v,n+w*v])},u=e=>{const[t,r,i,a]=e;return l([t,r,i,a],[t+a,r+a,i+a])}},36356(e,t,r){r.d(t,{q:()=>i});class i{get enabled(){return this._enabled}set enabled(e){e!==this._enabled&&(this._enabled=e,this._enabled?this._attach():this._detach(),this._host.requestUpdate())}hostUpdated(){this.enabled&&!this._scrollContainer&&this._attach()}hostDisconnected(){this._detach()}_attach(){this._scrollContainer=this._host.renderRoot?.querySelector(this._selector),this._scrollContainer&&this._scrollContainer.addEventListener("mousedown",this._mouseDown)}_detach(){window.removeEventListener("mousemove",this._mouseMove),window.removeEventListener("mouseup",this._mouseUp),this._scrollContainer&&(this._scrollContainer.removeEventListener("mousedown",this._mouseDown),this._scrollContainer=void 0),this.scrolled=!1,this.scrolling=!1,this.mouseIsDown=!1,this.scrollStartX=0,this.scrollLeft=0}constructor(e,{selector:t,enabled:r}){this.mouseIsDown=!1,this.scrolled=!1,this.scrolling=!1,this.scrollStartX=0,this.scrollLeft=0,this._enabled=!0,this._mouseDown=e=>{const t=this._scrollContainer;t&&(this.scrollStartX=e.pageX-t.offsetLeft,this.scrollLeft=t.scrollLeft,this.mouseIsDown=!0,this.scrolled=!1,window.addEventListener("mousemove",this._mouseMove),window.addEventListener("mouseup",this._mouseUp,{once:!0}))},this._mouseUp=()=>{this.mouseIsDown=!1,this.scrolling=!1,this._host.requestUpdate(),window.removeEventListener("mousemove",this._mouseMove)},this._mouseMove=e=>{if(!this.mouseIsDown)return;const t=this._scrollContainer;if(!t)return;const r=e.pageX-t.offsetLeft-this.scrollStartX;this.scrolled||(this.scrolled=Math.abs(r)>1,this.scrolling=this.scrolled,this._host.requestUpdate()),t.scrollLeft=this.scrollLeft-r},this._selector=t,this._host=e,this.enabled=r??!0,e.addController(this)}}},69558(e,t,r){r.d(t,{_:()=>o});r(18111),r(7588);var i=r(5124),a=r(42017);const o=(0,a.u$)(class extends a.WL{update(e,[t,r]){return this._element&&this._element.localName===t?(r&&Object.entries(r).forEach(([e,t])=>{this._element[e]=t}),i.c0):this.render(t,r)}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!==a.OA.CHILD)throw new Error("dynamicElementDirective can only be used in content bindings")}})},22682(e,t,r){r.d(t,{$:()=>n});const i="^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])",a=new RegExp(i+"$"),o=new RegExp(i),n=(e,t=!1)=>t?o.test(e):a.test(e)},22533(e,t,r){r.d(t,{i:()=>a});var i=r(52943);const a=(e,t)=>(e=>{switch(e){case"de":case"lb":return!0;default:return!1}})(t)?(0,i.Z)(e):e.toLocaleLowerCase(t)},58139(e,t,r){r.d(t,{d:()=>i,t:()=>a});const i=async(e,t)=>new Promise(r=>{const i=t(e,e=>{i(),r(e)})}),a=async e=>new Promise(t=>{const r=e.subscribe(e=>{r(),t(e)})})},52763(e,t,r){r.a(e,async function(e,i){try{r.d(t,{U:()=>_});r(74423),r(18111),r(7588),r(61701);var a=r(62826),o=r(5124),n=r(22441),s=r(69558),l=r(1087),d=r(38962),c=(r(11399),e([d]));d=(c.then?(await c)():c)[0];const h={boolean:()=>r.e(81347).then(r.bind(r,46990)),constant:()=>r.e(65733).then(r.bind(r,90820)),float:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(51868),r.e(27585)]).then(r.bind(r,20676)),grid:()=>r.e(60761).then(r.bind(r,70208)),expandable:()=>r.e(45001).then(r.bind(r,40003)),integer:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(21543),r.e(86712),r.e(49985)]).then(r.bind(r,20036)),multi_select:()=>Promise.all([r.e(4801),r.e(39763),r.e(46095),r.e(34995),r.e(80131),r.e(58303),r.e(71739),r.e(24407)]).then(r.bind(r,36182)),positive_time_period_dict:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(34995),r.e(67943),r.e(16508),r.e(85462)]).then(r.bind(r,89422)),select:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(34995),r.e(3283),r.e(81034),r.e(99463),r.e(26092),r.e(4809)]).then(r.bind(r,63804)),string:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(84725),r.e(95926)]).then(r.bind(r,54753)),optional_actions:()=>Promise.all([r.e(4801),r.e(39763),r.e(34995),r.e(85351)]).then(r.bind(r,8456))},u=(e,t)=>e?!t.name||t.flatten?e:e[t.name]:void 0,m=(e,t)=>e&&t.name?e[t.name]:null,p=(e,t)=>e&&t.name?e[t.name]:null;class _ 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 r,i=!0;return this.schema.forEach((e,a)=>{const o=t[a];if(!o)return;let n=!0;if("reportValidity"in o&&"function"==typeof o.reportValidity)n=o.reportValidity();else if(e.required&&(!("type"in e)||!["boolean","constant"].includes(e.type??""))&&(!("selector"in e)||!("boolean"in e.selector)&&!("constant"in e.selector))){const t=u(this.data,e);n=null!=t&&""!==t}n||(i=!1,r||(r=o))}),r&&r.focus?.(),i}willUpdate(e){e.has("schema")&&this.schema&&this.schema.forEach(e=>{"selector"in e||h[e.type]?.()})}render(){return o.qy` <div class="root" part="root"> ${this.error&&this.error.base?o.qy` <ha-alert alert-type="error"> ${this._computeError(this.error.base,this.schema)} </ha-alert> `:""} ${this.schema.map(e=>{const t=m(this.error,e),r=p(this.warning,e);return o.qy` ${t?o.qy` <ha-alert own-margin alert-type="error"> ${this._computeError(t,e)} </ha-alert> `:r?o.qy` <ha-alert own-margin alert-type="warning"> ${this._computeWarning(r,e)} </ha-alert> `:""} ${"selector"in e?o.qy`<ha-selector .schema="${e}" .hass="${this.hass}" .narrow="${this.narrow}" .name="${e.name}" .selector="${e.selector}" .value="${u(this.data,e)}" .label="${this._computeLabel(e,this.data)}" .disabled="${e.disabled||this.disabled||!1}" .placeholder="${e.required?void 0:e.default}" .helper="${this._computeHelper(e)}" .localizeValue="${this.localizeValue}" .required="${e.required||!1}" .context="${this._generateContext(e)}"></ha-selector>`:(0,s._)(this.fieldElementName(e.type),{schema:e,data:u(this.data,e),label:this._computeLabel(e,this.data),helper:this._computeHelper(e),disabled:this.disabled||e.disabled||!1,hass:this.hass,localize:this.hass?.localize,computeLabel:this.computeLabel,computeHelper:this.computeHelper,localizeValue:this.localizeValue,context:this._generateContext(e),...this.getFormProperties()})} `})} </div> `}fieldElementName(e){return`ha-form-${e}`}_generateContext(e){if(!e.context&&!this.context)return;const t={...this.context};if(e.context)for(const[r,i]of Object.entries(e.context))t[r]=this.data[i];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 r=!t.name||"flatten"in t&&t.flatten?e.detail.value:{[t.name]:e.detail.value};this.data={...this.data,...r},(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)?o.qy`<ul> ${e.map(e=>o.qy`<li> ${this.computeError?this.computeError(e,t):e} </li>`)} </ul>`: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}}_.shadowRootOptions={mode:"open",delegatesFocus:!0},_.styles=o.AH`.root>*{display:block}.root>:not([own-margin]):not(:last-child){margin-bottom:24px}ha-alert[own-margin]{margin-bottom:4px}`,(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"data",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"schema",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"error",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"warning",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"computeError",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"computeWarning",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"computeLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"computeHelper",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"localizeValue",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"context",void 0),(0,a.Cg)([(0,n.P)(".root")],_.prototype,"_root",void 0),_=(0,a.Cg)([(0,n.EM)("ha-form")],_),i()}catch(e){i(e)}})},43661(e,t,r){r.r(t),r.d(t,{HaIconNext:()=>s});var i=r(62826),a=r(22441),o=r(63091),n=r(67094);class s extends n.HaSvgIcon{constructor(...e){super(...e),this.path="rtl"===o.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,i.Cg)([(0,a.MZ)()],s.prototype,"path",void 0),s=(0,i.Cg)([(0,a.EM)("ha-icon-next")],s)},11399(e,t,r){r(17642),r(58004),r(33853),r(45876),r(32475),r(15024),r(31698);var i=r(62826),a=r(5124),o=r(22441),n=r(22786),s=r(69558),l=r(95311);const d={action:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(34995),r.e(3283),r.e(80131),r.e(72130),r.e(85010),r.e(67218),r.e(58416),r.e(58303),r.e(81034),r.e(16787),r.e(54066),r.e(25950),r.e(14421),r.e(86475),r.e(26092),r.e(8851),r.e(34310),r.e(90790),r.e(12009),r.e(20282),r.e(90577),r.e(16508),r.e(48531),r.e(91123),r.e(31863),r.e(283),r.e(30513),r.e(86618)]).then(r.bind(r,6274)),addon:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(26787),r.e(26092),r.e(45386),r.e(43305)]).then(r.bind(r,36784)),automation_behavior:()=>Promise.all([r.e(4801),r.e(81034),r.e(82416)]).then(r.bind(r,66034)),app:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(26787),r.e(26092),r.e(45386)]).then(r.bind(r,48585)),area:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(83523),r.e(26092),r.e(40404)]).then(r.bind(r,81857)),areas_display:()=>Promise.all([r.e(46095),r.e(64657),r.e(68273),r.e(64280),r.e(32838)]).then(r.bind(r,38235)),attribute:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(49168),r.e(26092),r.e(67471)]).then(r.bind(r,71498)),assist_pipeline:()=>Promise.all([r.e(4801),r.e(39763),r.e(46095),r.e(34995),r.e(43048),r.e(30195)]).then(r.bind(r,83642)),boolean:()=>Promise.all([r.e(93282),r.e(19623)]).then(r.bind(r,30714)),choose:()=>r.e(93934).then(r.bind(r,58141)),color_rgb:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(7106),r.e(31524)]).then(r.bind(r,34931)),condition:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(34995),r.e(3283),r.e(72130),r.e(85010),r.e(67218),r.e(16787),r.e(54066),r.e(25950),r.e(91095),r.e(26092),r.e(8851),r.e(34310),r.e(12009),r.e(20282),r.e(90577),r.e(48531),r.e(91123),r.e(283),r.e(60066)]).then(r.bind(r,81539)),config_entry:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(8706),r.e(26092),r.e(8851),r.e(36830)]).then(r.bind(r,49347)),conversation_agent:()=>Promise.all([r.e(4801),r.e(39763),r.e(46095),r.e(34995),r.e(20667),r.e(66896)]).then(r.bind(r,94215)),constant:()=>r.e(77057).then(r.bind(r,39032)),country:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(84887),r.e(65799),r.e(26092),r.e(40489),r.e(45262)]).then(r.bind(r,94164)),date:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(81484),r.e(93993)]).then(r.bind(r,94351)),datetime:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(34995),r.e(95366),r.e(78229)]).then(r.bind(r,39045)),device:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(16787),r.e(93162),r.e(26092),r.e(90577),r.e(90606)]).then(r.bind(r,2270)),duration:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(34995),r.e(90324),r.e(16508),r.e(21082)]).then(r.bind(r,79488)),entity:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(69923),r.e(26092),r.e(8851),r.e(1535),r.e(34682)]).then(r.bind(r,73863)),entity_name:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(80607),r.e(26092),r.e(85852)]).then(r.bind(r,7563)),statistic:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(7390),r.e(26092),r.e(8851),r.e(54884),r.e(98206)]).then(r.bind(r,28072)),file:()=>Promise.all([r.e(4801),r.e(80764)]).then(r.bind(r,25078)),floor:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(89100),r.e(54192),r.e(26092),r.e(93e3),r.e(55619)]).then(r.bind(r,9040)),label:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(79808),r.e(26092),r.e(66201),r.e(58397)]).then(r.bind(r,99560)),language:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(82025),r.e(26092),r.e(60293)]).then(r.bind(r,15430)),navigation:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(34995),r.e(3283),r.e(83113),r.e(99788),r.e(66716),r.e(54066),r.e(68077),r.e(26092),r.e(8851),r.e(19112),r.e(30002),r.e(59704),r.e(25322),r.e(89747),r.e(59532),r.e(52487),r.e(12009),r.e(20282),r.e(48531),r.e(79767),r.e(74942)]).then(r.bind(r,58350)),number:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(21543),r.e(4162)]).then(r.bind(r,31157)),numeric_threshold:()=>Promise.all([r.e(4801),r.e(39763),r.e(46095),r.e(34995),r.e(88992),r.e(50616)]).then(r.bind(r,18719)),object:()=>Promise.all([r.e(4801),r.e(39763),r.e(46095),r.e(72130),r.e(85010),r.e(42981),r.e(34310),r.e(46660)]).then(r.bind(r,97951)),period:()=>r.e(54234).then(r.bind(r,40929)),qr_code:()=>Promise.all([r.e(4801),r.e(51343),r.e(15251)]).then(r.bind(r,35313)),select:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(34995),r.e(3283),r.e(81034),r.e(26092),r.e(56629)]).then(r.bind(r,856)),selector:()=>r.e(77810).then(r.bind(r,13897)),serial_port:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(68432),r.e(26092),r.e(90587)]).then(r.bind(r,82178)),state:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(38809),r.e(26092),r.e(42684)]).then(r.bind(r,12995)),backup_location:()=>Promise.all([r.e(4801),r.e(39763),r.e(46095),r.e(34995),r.e(80131),r.e(83241),r.e(61757)]).then(r.bind(r,16360)),stt:()=>Promise.all([r.e(4801),r.e(39763),r.e(46095),r.e(34995),r.e(98286),r.e(15424)]).then(r.bind(r,42999)),target:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(35040),r.e(26092),r.e(8851),r.e(33758),r.e(8697),r.e(8955),r.e(17509)]).then(r.bind(r,84909)),template:()=>Promise.all([r.e(4801),r.e(39763),r.e(72130),r.e(33387),r.e(34310),r.e(82770)]).then(r.bind(r,62166)),text:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(37694),r.e(67988)]).then(r.bind(r,47971)),time:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(34995),r.e(92351),r.e(67766)]).then(r.bind(r,42945)),icon:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(86325),r.e(26092),r.e(8851),r.e(79768)]).then(r.bind(r,14885)),media:()=>Promise.all([r.e(4801),r.e(26295),r.e(91845),r.e(32376)]).then(r.bind(r,59422)),theme:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(4406),r.e(26092),r.e(76696)]).then(r.bind(r,77655)),timezone:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(56253),r.e(12727),r.e(26092),r.e(49386)]).then(r.bind(r,6719)),button_toggle:()=>r.e(7774).then(r.bind(r,79949)),trigger:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(34995),r.e(3283),r.e(80131),r.e(72130),r.e(85010),r.e(67218),r.e(58303),r.e(81034),r.e(16787),r.e(54066),r.e(25950),r.e(24906),r.e(26092),r.e(8851),r.e(34310),r.e(12009),r.e(20282),r.e(90577),r.e(48531),r.e(91123),r.e(31863),r.e(60597)]).then(r.bind(r,45078)),tts:()=>Promise.all([r.e(4801),r.e(39763),r.e(46095),r.e(34995),r.e(75905),r.e(85344)]).then(r.bind(r,59447)),tts_voice:()=>Promise.all([r.e(4801),r.e(39763),r.e(46095),r.e(34995),r.e(53524),r.e(98913)]).then(r.bind(r,41188)),location:()=>Promise.all([r.e(4801),r.e(87451),r.e(46146),r.e(8851),r.e(12122),r.e(78146),r.e(8740)]).then(r.bind(r,21160)),color_temp:()=>Promise.all([r.e(4801),r.e(39763),r.e(99788),r.e(21543),r.e(29628),r.e(59704),r.e(20282),r.e(42655)]).then(r.bind(r,90780)),ui_action:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(34995),r.e(3283),r.e(72130),r.e(85010),r.e(83113),r.e(58416),r.e(99788),r.e(66716),r.e(54066),r.e(25950),r.e(96529),r.e(26092),r.e(8851),r.e(19112),r.e(34310),r.e(30002),r.e(59704),r.e(25322),r.e(90790),r.e(89747),r.e(59532),r.e(52487),r.e(36332),r.e(12009),r.e(20282),r.e(48531),r.e(79767),r.e(80014)]).then(r.bind(r,38389)),ui_color:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(46051),r.e(26092),r.e(78043)]).then(r.bind(r,52744)),ui_state_content:()=>Promise.all([r.e(4801),r.e(39763),r.e(32450),r.e(46095),r.e(7305),r.e(92769),r.e(3283),r.e(8282),r.e(26092),r.e(52481)]).then(r.bind(r,96074))},c=new Set(["ui-action","ui-color"]);class h extends a.WF{reportValidity(){return this._selectorElement&&"reportValidity"in this._selectorElement&&"function"==typeof this._selectorElement.reportValidity?this._selectorElement?.reportValidity()??!0:!this.required||void 0!==this.value&&null!==this.value&&""!==this.value}async focus(){await this.updateComplete,this._selectorElement?.focus()}get _type(){const e=Object.keys(this.selector)[0];return c.has(e)?e.replace("-","_"):e}willUpdate(e){e.has("selector")&&this.selector&&d[this._type]?.()}render(){return a.qy` ${(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,n.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 c.has(t)?{[t.replace("-","_")]:e[t]}:e})}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)()],h.prototype,"name",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"selector",void 0),(0,i.Cg)([(0,o.MZ)()],h.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)()],h.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],h.prototype,"helper",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"localizeValue",void 0),(0,i.Cg)([(0,o.MZ)()],h.prototype,"placeholder",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],h.prototype,"disabled",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],h.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"context",void 0),(0,i.Cg)([(0,o.P)("#selector",!0)],h.prototype,"_selectorElement",void 0),h=(0,i.Cg)([(0,o.EM)("ha-selector")],h)},88827(e,t,r){r.a(e,async function(e,i){try{r.d(t,{B9:()=>m,QG:()=>p,Tf:()=>h,We:()=>u,Zn:()=>d,rM:()=>c});r(18111),r(22489),r(17642),r(58004),r(33853),r(45876),r(32475),r(15024),r(31698);var a=r(82591);if(66649!=r.j)var o=r(69093);var n=e([a]);a=(n.then?(await n)():n)[0];const s=66649!=r.j?["entity_id","assumed_state","attribution","custom_ui_more_info","custom_ui_state_card","device_class","editable","emulated_hue_name","emulated_hue","entity_picture","event_types","friendly_name","haaska_hidden","haaska_name","icon","initial_state","last_reset","restored","state_class","supported_features","unit_of_measurement","available_tones"]:null,l=66649!=r.j?{sensor:{enum:["options"]}}:null,d=new Set(["temperature","current_temperature","target_temperature","target_temp_temp","target_temp_high","target_temp_low","target_temp_step","min_temp","max_temp"]),c={climate:{humidity:"%",current_humidity:"%",target_humidity_low:"%",target_humidity_high:"%",target_humidity_step:"%",min_humidity:"%",max_humidity:"%"},cover:{current_position:"%",current_tilt_position:"%"},fan:{percentage:"%"},humidifier:{humidity:"%",current_humidity:"%",min_humidity:"%",max_humidity:"%",target_humidity_step:"%"},light:{color_temp:"mired",max_mireds:"mired",min_mireds:"mired",color_temp_kelvin:"K",min_color_temp_kelvin:"K",max_color_temp_kelvin:"K",brightness:"%"},sun:{azimuth:"°",elevation:"°"},vacuum:{battery_level:"%"},valve:{current_position:"%"},sensor:{battery_level:"%"},media_player:{volume_level:"%"}},h={light:{brightness:e=>Math.round(e/255*100).toString()},media_player:{volume_level:e=>Math.round(100*e).toString(),media_duration:(e,t)=>{const r=Math.floor(e/3600),i=Math.floor(e%3600/60),o=e%60;return(0,a.E2)(t,{hours:r,minutes:i,seconds:o})}},input_datetime:{year:e=>e.toString()}},u=["access_token","auto_update","available_modes","away_mode","changed_by","code_format","color_modes","current_activity","device_class","editable","effect_list","effect","entity_picture","event_type","event_types","fan_mode","fan_modes","fan_speed_list","forecast","friendly_name","frontend_stream_type","has_date","has_time","hs_color","hvac_mode","hvac_modes","icon","media_album_name","media_artist","media_content_type","media_position_updated_at","media_title","next_dawn","next_dusk","next_midnight","next_noon","next_rising","next_setting","operation_list","operation_mode","options","preset_mode","preset_modes","release_notes","release_summary","release_url","restored","rgb_color","rgbw_color","shuffle","sound_mode_list","sound_mode","source_list","source_type","source","state_class","supported_features","swing_mode","swing_mode","swing_modes","title","token","unit_of_measurement","xy_color"],m=["access_token","available_modes","color_modes","editable","effect_list","entity_picture","event_types","fan_modes","fan_speed_list","forecast","friendly_name","hvac_modes","icon","operation_list","options","preset_modes","sound_mode_list","source_list","state_class","swing_modes","token"],p=e=>{const t=(0,o.t)(e),r=s.concat(l[t]?.[e.attributes?.device_class]||[]);return Object.keys(e.attributes).filter(e=>-1===r.indexOf(e))};i()}catch(e){i(e)}})},86531(e,t,r){r.a(e,async function(e,i){try{r.d(t,{$O:()=>g,a$:()=>v,cj:()=>u,dG:()=>f,gM:()=>b,gd:()=>p,k$:()=>w,rc:()=>P});r(74423);var a=r(46190),o=r(71727),n=r(69093),s=r(22533),l=r(22675),d=r(25064),c=e([d]);d=(c.then?(await c)():c)[0];const h="ui.components.logbook.messages",u=["counter","proximity"],m={triggered_by_numeric_state_of:"numeric state of",triggered_by_state_of:"state of",triggered_by_event:"event",triggered_by_time_pattern:"time pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"ioBroker stopping",triggered_by_homeassistant_starting:"ioBroker starting"},p=async(e,t,r)=>_(e,t,void 0,void 0,r),_=(e,t,r,i,a,o)=>{if((i||o)&&(!i||0===i.length)&&(!o||0===o.length))return Promise.resolve([]);const n={type:"logbook/get_events",start_time:t};return r&&(n.end_time=r),i?.length&&(n.entity_ids=i),o?.length&&(n.device_ids=o),a&&(n.context_id=a),e.callWS(n)},b=(e,t,r,i,a,o,n)=>{if((o||n)&&(!o||0===o.length)&&(!n||0===n.length))return Promise.reject("No entities or devices");const s={type:"logbook/event_stream",start_time:r,end_time:i};return o?.length&&(s.entity_ids=o),n?.length&&(s.device_ids=n),e.connection.subscribeMessage(e=>t(e,a),s)},f=(e,t)=>({entity_id:e.entity_id,state:t,attributes:{device_class:e?.attributes.device_class,source_type:e?.attributes.source_type,has_date:e?.attributes.has_date,has_time:e?.attributes.has_time,entity_picture_local:a.oL.has((0,o.m)(e.entity_id))?void 0:e?.attributes.entity_picture_local,entity_picture:a.oL.has((0,o.m)(e.entity_id))?void 0:e?.attributes.entity_picture}}),g=(e,t)=>{for(const r of Object.keys(m)){const i=m[r];if(t.startsWith(i))return t.replace(i,`${e(`ui.components.logbook.${r}`)}`)}return t},y=66649!=r.j?{triggered_by_numeric_state_of:"numeric_state_of",triggered_by_state_of:"state_of",triggered_by_event:"event",triggered_by_time_pattern:"time_pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"homeassistant_stopping",triggered_by_homeassistant_starting:"homeassistant_starting"}:null,w=(e,t)=>{for(const r of Object.keys(m)){const i=m[r];if(t.startsWith(i)){const a=y[r];return t.replace(i,`${e(`ui.components.logbook.${a}`)}`)}}return t},v=(e,t,r,i,a)=>{switch(a){case"device_tracker":case"person":return"not_home"===r?t(`${h}.was_away`):"home"===r?t(`${h}.was_at_home`):t(`${h}.was_at_state`,{state:r});case"sun":return t("above_horizon"===r?`${h}.rose`:`${h}.set`);case"binary_sensor":{const a="on"===r,o="off"===r,n=i.attributes.device_class;if(n&&(a||o))return t(`${h}.${a?"detected_device_classes":"cleared_device_classes"}.${n}`,{device_class:(0,s.i)(t(`component.binary_sensor.entity_component.${n}.name`)||n,e.language)})||t(`${h}.${a?"detected_device_class":"cleared_device_class"}`,{device_class:(0,s.i)(t(`component.binary_sensor.entity_component.${n}.name`)||n,e.language)});break}case"cover":switch(r){case"open":return t(`${h}.was_opened`);case"opening":return t(`${h}.is_opening`);case"closing":return t(`${h}.is_closing`);case"closed":return t(`${h}.was_closed`)}break;case"event":return t(`${h}.detected_event_no_type`);case"lock":switch(r){case"unlocked":return t(`${h}.was_unlocked`);case"locking":return t(`${h}.is_locking`);case"unlocking":return t(`${h}.is_unlocking`);case"opening":return t(`${h}.is_opening`);case"open":return t(`${h}.is_opened`);case"locked":return t(`${h}.was_locked`);case"jammed":return t(`${h}.is_jammed`)}}return"on"===r?t(`${h}.turned_on`):"off"===r?t(`${h}.turned_off`):r===l.HV?t(`${h}.became_unknown`):r===l.Hh?t(`${h}.became_unavailable`):e.localize(`${h}.changed_to_state`,{state:i?e.formatEntityState(i,r):r})},P=(e,t=[])=>{const r=(0,n.t)(e);return!(u.includes(r)||"sensor"===r&&(0,d.Fp)(r,e,void 0,t))};i()}catch(e){i(e)}})},99129(e,t,r){r.d(t,{EG:()=>o,ML:()=>n});var i=r(35518),a=r(35952);const o=(e,t,r)=>e.subscribeEvents(e=>{e.data.url_path===t&&r()},"lovelace_updated"),n=(e,t=null)=>(0,i.X)(e,`_lovelace_${t??""}`,e=>(0,a.Dz)(e,t,!1),(r,i)=>o(e,t,()=>(0,a.Dz)(e,t,!1).then(e=>i.setState(e,!0))))},28918(e,t,r){r.d(t,{H:()=>a,o:()=>i});function i(e){return"boolean"==typeof e?e?{}:void 0:e}function a(e){return"strategy"in e}},91984(e,t,r){r.d(t,{R6:()=>a,TQ:()=>o,cg:()=>n});var i=r(31290);function a(e){return"strategy"in e}const o=(e,t)=>e.title??(e.path?(0,i.n)(e.path):String(t)),n=e=>e.icon??"mdi:view-compact"},95311(e,t,r){r.d(t,{DF:()=>m,Lo:()=>y,MH:()=>d,MM:()=>p,Qz:()=>u,Ru:()=>b,UU:()=>f,_7:()=>h,bZ:()=>c,m0:()=>l,tD:()=>g,vX:()=>_,wY:()=>w});r(74423),r(44114),r(18111),r(22489),r(30531),r(7588),r(13579),r(17642),r(58004),r(33853),r(45876),r(32475),r(15024),r(31698);var i=r(44537),a=r(69093),o=r(82286),n=r(24367),s=r(58594);const l=(e,t,r,i,a,o,n)=>{const s=[],l=[],d=[];return Object.values(r).forEach(r=>{r.labels.includes(t)&&u(e,a,i,r.area_id,o,n)&&d.push(r.area_id)}),Object.values(i).forEach(r=>{r.labels.includes(t)&&m(e.states,Object.values(a),r,o,n)&&l.push(r.id)}),Object.values(a).forEach(r=>{r.labels.includes(t)&&p(e.states[r.entity_id],o,n)&&s.push(r.entity_id)}),{areas:d,devices:l,entities:s}},d=(e,t,r,i,a)=>{const o=[];return Object.values(r).forEach(r=>{r.floor_id===t&&u(e,e.entities,e.devices,r.area_id,i,a)&&o.push(r.area_id)}),{areas:o}},c=(e,t,r,i,a,o)=>{const n=[],s=[];return Object.values(r).forEach(r=>{r.area_id===t&&m(e.states,Object.values(i),r,a,o)&&s.push(r.id)}),Object.values(i).forEach(r=>{r.area_id===t&&p(e.states[r.entity_id],a,o)&&n.push(r.entity_id)}),{devices:s,entities:n}},h=(e,t,r,i,a)=>{const o=[];return Object.values(r).forEach(r=>{r.device_id===t&&p(e.states[r.entity_id],i,a)&&o.push(r.entity_id)}),{entities:o}},u=(e,t,r,i,a,o)=>!!Object.values(r).some(r=>!(r.area_id!==i||!m(e.states,Object.values(t),r,a,o)))||Object.values(t).some(t=>!(t.area_id!==i||!p(e.states[t.entity_id],a,o))),m=(e,t,r,a,o)=>{const n=o?(0,s.fk)(o,t):void 0;if(a.target?.device&&!(0,i.e)(a.target.device).some(e=>_(e,r,n)))return!1;if(a.target?.entity){return t.filter(e=>e.device_id===r.id).some(t=>{const r=e[t.entity_id];return p(r,a,o)})}return!0},p=(e,t,r)=>!!e&&(!t.target?.entity||(0,i.e)(t.target.entity).some(t=>b(t,e,r))),_=(e,t,r)=>{const{manufacturer:i,model:a,model_id:o,integration:n}=e;return(!i||t.manufacturer===i)&&((!a||t.model===a)&&((!o||t.model_id===o)&&!(n&&r&&!r?.[t.id]?.has(n))))},b=(e,t,r)=>{const{domain:n,device_class:s,supported_features:l,unit_of_measurement:d,integration:c}=e;if(n){const e=(0,a.t)(t);if(Array.isArray(n)?!n.includes(e):e!==n)return!1}if(s){const e=t.attributes.device_class;if(e&&Array.isArray(s)?!s.includes(e):e!==s)return!1}if(l&&!(0,i.e)(l).some(e=>(0,o.$)(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!c||r?.[t.entity_id]?.domain===c},f=e=>{if(!e.entity)return{entity:null};if("filter"in e.entity)return e;const{domain:t,integration:r,device_class:i,...a}=e.entity;return t||r||i?{entity:{...a,filter:{domain:t,integration:r,device_class:i}}}:{entity:a}},g=e=>{if(!e.device)return{device:null};if("filter"in e.device)return e;const{integration:t,manufacturer:r,model:i,...a}=e.device;return t||r||i?{device:{...a,filter:{integration:t,manufacturer:r,model:i}}}:{device:a}},y=e=>{let t;if("target"in e)t=(0,i.e)(e.target?.entity);else if("entity"in e){if(e.entity?.include_entities)return;t=(0,i.e)(e.entity?.filter)}if(!t)return;const r=t.flatMap(e=>e.integration||e.device_class||e.supported_features||!e.domain?[]:(0,i.e)(e.domain).filter(e=>(0,n.z)(e)));return[...new Set(r)]},w=(e,t,r,a,o,n={target:{}})=>{if(!t)return[];const s=new Set((0,i.e)(t.entity_id)),u=new Set((0,i.e)(t.device_id)),m=new Set((0,i.e)(t.area_id)),p=new Set((0,i.e)(t.floor_id));return new Set((0,i.e)(t.label_id)).forEach(t=>{const i=l(e,t,o,a,r,n);i.devices.forEach(e=>u.add(e)),i.entities.forEach(e=>s.add(e)),i.areas.forEach(e=>m.add(e))}),p.forEach(t=>{d(e,t,o,n).areas.forEach(e=>m.add(e))}),m.forEach(t=>{const i=c(e,t,a,r,n);i.devices.forEach(e=>u.add(e)),i.entities.forEach(e=>s.add(e))}),u.forEach(t=>{h(e,t,r,n).entities.forEach(e=>s.add(e))}),Array.from(s)}},24673(e,t,r){r.a(e,async function(e,i){try{r.d(t,{CT:()=>_,HD:()=>u,M1:()=>v,aK:()=>p,gs:()=>g,oF:()=>y,pC:()=>m,pk:()=>f,sw:()=>k,t0:()=>P});r(74423);var a=r(36312);if(66649!=r.j)var o=r(71727);var n=r(68287),s=r(25064),l=r(86531),d=r(43248),c=e([l,s]);[l,s]=c.then?(await c)():c;const h=59509==r.j?["info","history","settings","related","add_to","details"]:null,u=e=>void 0!==e&&h.includes(e),m=66649!=r.j?["camera","configurator"]:null,p=66649!=r.j?["scene","automation"]:null,_=66649!=r.j?["script"]:null,b=66649!=r.j?["alarm_control_panel","cover","climate","conversation","fan","humidifier","input_boolean","lawn_mower","light","lock","siren","script","switch","vacuum","valve","water_heater","weather","media_player"]:null,f=66649!=r.j?["update"]:null,g=["alarm_control_panel","automation","camera","climate","configurator","conversation","counter","cover","date","datetime","fan","group","humidifier","image","input_boolean","input_datetime","lawn_mower","light","lock","media_player","person","remote","script","scene","siren","sun","switch","time","timer","update","vacuum","valve","water_heater","weather"],y=["input_number","input_select","input_text","number","scene","select","text","update"],w=66649!=r.j?["camera","configurator"]:null,v=(e,t)=>{if("weather"===(0,o.m)(t)){const r=e.states[t];if(r&&(0,d.N_)(r.state))return!1}return(0,a.x)(e.config,"history")&&!w.includes((0,o.m)(t))},P=(e,t,r=[])=>{if(!(0,a.x)(e.config,"logbook"))return!1;const i=e.states[t];if(!i)return!1;const n=(0,o.m)(t);return!(l.cj.includes(n)||"sensor"===n&&(0,s.Fp)(n,i,void 0,r)||w.includes(n))&&("weather"!==n||!i||!(0,d.N_)(i.state))},k=e=>{const t=(0,o.m)(e.entity_id);if("group"===t){const t=(0,n.z)(e);return null!=t&&"group"!==t&&b.includes(t)}return b.includes(t)};i()}catch(e){i(e)}})},15656(e,t,r){r.d(t,{Nu:()=>d,TG:()=>_,Xd:()=>u,d4:()=>p,uN:()=>h,xC:()=>m});r(18111),r(61701);if(59509==r.j)var i=r(28918);if(59509==r.j)var a=r(35952);if(59509==r.j)var o=r(91984);if(66649!=r.j)var n=r(53338);const s="custom:",l={dashboard:{"original-states":()=>r.e(60134).then(r.bind(r,43845)),map:()=>r.e(74994).then(r.bind(r,56009)),iframe:()=>r.e(1732).then(r.bind(r,38287)),areas:()=>Promise.all([r.e(99788),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(20992)]).then(r.bind(r,80821)),home:()=>Promise.all([r.e(99788),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(3650),r.e(97416)]).then(r.bind(r,67293)),energy:()=>Promise.all([r.e(67218),r.e(92610),r.e(26857),r.e(77183),r.e(19343)]).then(r.bind(r,94429))},view:{"original-states":()=>Promise.all([r.e(67218),r.e(92610),r.e(45688),r.e(77183),r.e(94530)]).then(r.bind(r,16330)),"energy-overview":()=>Promise.all([r.e(67218),r.e(92610),r.e(26857),r.e(77183),r.e(51016)]).then(r.bind(r,3260)),energy:()=>Promise.all([r.e(67218),r.e(92610),r.e(26857),r.e(77183),r.e(20984)]).then(r.bind(r,86242)),water:()=>Promise.all([r.e(67218),r.e(92610),r.e(26857),r.e(77183),r.e(8969)]).then(r.bind(r,88615)),gas:()=>Promise.all([r.e(67218),r.e(92610),r.e(26857),r.e(77183),r.e(17423)]).then(r.bind(r,21733)),power:()=>Promise.all([r.e(67218),r.e(92610),r.e(26857),r.e(77183),r.e(17879)]).then(r.bind(r,60093)),map:()=>r.e(6875).then(r.bind(r,14966)),iframe:()=>r.e(73441).then(r.bind(r,51480)),area:()=>Promise.all([r.e(99788),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(35818)]).then(r.bind(r,44979)),"areas-overview":()=>Promise.all([r.e(99788),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(94101)]).then(r.bind(r,69140)),"home-overview":()=>Promise.all([r.e(67218),r.e(92610),r.e(99788),r.e(28991),r.e(77183),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(3650),r.e(6078)]).then(r.bind(r,8892)),"home-media-players":()=>Promise.all([r.e(99788),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(3650),r.e(44685)]).then(r.bind(r,24876)),"home-area":()=>Promise.all([r.e(99788),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(3650),r.e(54547)]).then(r.bind(r,47302)),"home-other-devices":()=>r.e(27800).then(r.bind(r,78859)),light:()=>Promise.all([r.e(99788),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(2437)]).then(r.bind(r,71776)),security:()=>Promise.all([r.e(99788),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(85143)]).then(r.bind(r,31758)),climate:()=>Promise.all([r.e(99788),r.e(59704),r.e(25322),r.e(12009),r.e(20282),r.e(19051)]).then(r.bind(r,73026)),maintenance:()=>r.e(82691).then(r.bind(r,78030))},section:{"common-controls":()=>r.e(8717).then(r.bind(r,44124))}},d=async(e,t)=>{if(t in l[e]){await l[e][t]();const r=`${t}-${e}-strategy`;return customElements.get(r)}if(!t.startsWith(s))throw new Error("Unknown strategy");const r=`ll-strategy-${t.slice(7)}`,i=`ll-strategy-${e}-${t.slice(7)}`;if(!0===await Promise.race([customElements.whenDefined(r),customElements.whenDefined(i),new Promise(e=>{setTimeout(()=>e(!0),5e3)})]))throw new Error(`Timeout waiting for strategy element ${i} to be registered`);return customElements.get(i)??customElements.get(r)},c=async(e,t,r,i)=>{const a=r.type;if(!a)return t("No strategy type found");try{const t=await d(e,a);if((0,n.Xo)(t)){if("dashboard"===e&&"generateDashboard"in t)return await t.generateDashboard({config:{strategy:r,views:[]},hass:i});if("view"===e&&"generateView"in t)return await t.generateView({config:{views:[]},view:{strategy:r},hass:i})}const o=(0,n._V)(r);return await t.generate(o,i)}catch(e){return"timeout"!==e.message&&console.error(e),t(e)}},h=async(e,t)=>{const{strategy:r,...i}=e;return{...i,...await c("dashboard",e=>({views:[{title:"Error",cards:[{type:"markdown",content:`Error loading the dashboard strategy:\n> ${e}`}]}]}),r,t)}},u=async(e,t)=>{const{strategy:r,...i}=e;return{...i,...await c("view",e=>({cards:[{type:"markdown",content:`Error loading the view strategy:\n> ${e}`}]}),r,t)}},m=async(e,t)=>{const{strategy:r,...i}=e;return{...i,...await c("section",e=>({cards:[{type:"markdown",content:`Error loading the section strategy:\n> ${e}`}]}),r,t)}},p=async(e,t)=>{const r=(0,a.Wu)(e)?await h(e,t):{...e};return r.views=await Promise.all(r.views.map(async e=>{const r=(0,o.R6)(e)?await u(e,t):{...e};return r.sections&&(r.sections=await Promise.all(r.sections.map(async e=>(0,i.H)(e)?await m(e,t):{...e}))),r})),r};async function _(e,t){const r=await d("dashboard",t),i=await async function(e,t){const r=t.getCreateSuggestions;if("function"==typeof r)return r.call(t,e)}(e,r);return{strategyClass:r,fieldSuggestions:i}}},53338(e,t,r){r.d(t,{B2:()=>a,Xo:()=>i,_V:()=>o});const i=e=>!("generate"in e),a=e=>2===Object.keys(e).length&&"options"in e&&"object"==typeof e.options,o=e=>{if(!a(e))return e;const t={...e,...e.options};return delete t.options,t}},48646(e,t,r){var i=r(69565),a=r(28551),o=r(1767),n=r(50851);e.exports=function(e,t){t&&"string"==typeof e||a(e);var r=n(e);return o(a(void 0!==r?i(r,e):e))}},30531(e,t,r){var i=r(46518),a=r(69565),o=r(79306),n=r(28551),s=r(1767),l=r(48646),d=r(19462),c=r(9539),h=r(96395),u=r(30684),m=r(84549);var p=!h&&!u("flatMap",function(){}),_=!h&&!p&&m("flatMap",TypeError),b=h||p||_||function(){try{var e=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(e){return e});e.next(),e.return()}catch(e){return!0}}(),f=d(function(){for(var e,t,r=this.iterator,i=this.mapper;;){if(t=this.inner)try{if(!(e=n(a(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){c(r,"throw",e)}if(e=n(a(this.next,r)),this.done=!!e.done)return;try{this.inner=l(i(e.value,this.counter++),!1)}catch(e){c(r,"throw",e)}}});i({target:"Iterator",proto:!0,real:!0,forced:b},{flatMap:function(e){n(this);try{o(e)}catch(e){c(this,"throw",e)}return _?a(_,this,e):new f(s(this),{mapper:e,inner:null})}})},31886(e,t,r){r.a(e,async function(e,i){try{r.d(t,{BB:()=>a.B});r(38744);var a=r(88775),o=r(49232),n=r(78713),s=r(53834),l=r(35204),d=r(5806),c=e([a,o,n,s,l,d]);[a,o,n,s,l,d]=c.then?(await c)():c,i()}catch(e){i(e)}})},1126(e,t,r){r.a(e,async function(e,t){try{var i=r(5124),a=r(22441),o=r(6412),n=r(63672),s=r(17051),l=r(42462),d=r(28438),c=r(98779),h=r(27259),u=r(25877),m=r(31247),p=r(4444),_=r(92070),b=r(9395),f=r(717),g=r(17060),y=r(88496),w=r(57024),v=e([y,g]);[y,g]=v.then?(await v)():v;var P=Object.defineProperty,k=Object.getOwnPropertyDescriptor,$=(e,t,r,i)=>{for(var a,o=i>1?void 0:i?k(t,r):t,n=e.length-1;n>=0;n--)(a=e[n])&&(o=(i?a(t,r,o):a(o))||o);return i&&o&&P(t,r,o),o};let E=class extends f.A{firstUpdated(){i.S$||this.open&&(this.addOpenListeners(),this.drawer.showModal(),(0,p.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,p.I7)(this),this.removeOpenListeners()}async requestClose(e){const t=new d.L({source:e});if(this.dispatchEvent(t),t.defaultPrevented)return this.open=!0,void(0,h.Ud)(this.drawer,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.drawer,"hide"),this.open=!1,this.drawer.close(),(0,p.I7)(this);const r=this.originalTrigger;"function"==typeof r?.focus&&setTimeout(()=>r.focus()),this.dispatchEvent(new s.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,u.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,u.Fw)(this)}handleDialogCancel(e){e.preventDefault(),!this.drawer.classList.contains("hide")&&e.target===this.drawer&&(0,u.a0)(this)&&this.requestClose(this.drawer)}handleDialogClick(e){const t=e.target.closest('[data-drawer="close"]');t&&(e.stopPropagation(),this.requestClose(t))}async handleDialogPointerDown(e){e.target===this.drawer&&(this.lightDismiss?this.requestClose(this.drawer):await(0,h.Ud)(this.drawer,"pulse"))}handleOpenChange(){this.open&&!this.drawer.open?this.show():this.drawer.open&&(this.open=!0,this.requestClose(this.drawer))}async show(){const e=new c.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.drawer.showModal(),(0,p.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.drawer.focus()}),await(0,h.Ud)(this.drawer,"show"),this.dispatchEvent(new l.q))}render(){const e=!this.withoutHeader,t=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return i.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,n.J)(this.ariaDescribedby)}" part="dialog" class="${(0,o.H)({drawer:!0,open:this.open,top:"top"===this.placement,end:"end"===this.placement,bottom:"bottom"===this.placement,start:"start"===this.placement})}" ="${this.handleDialogCancel}" ="${this.handleDialogClick}" ="${this.handleDialogPointerDown}"> ${e?i.qy` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(8203)} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" ="${e=>this.requestClose(e.target)}"> <wa-icon name="xmark" label="${this.localize.term("close")}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `:""} <div part="body" class="body"><slot></slot></div> ${t?i.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new g.c(this),this.hasSlotController=new _.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.placement="end",this.withoutHeader=!1,this.lightDismiss=!0,this.withFooter=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&(0,u.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.drawer))}}};E.css=w.A,$([(0,a.P)(".drawer")],E.prototype,"drawer",2),$([(0,a.MZ)({type:Boolean,reflect:!0})],E.prototype,"open",2),$([(0,a.MZ)({reflect:!0})],E.prototype,"label",2),$([(0,a.MZ)({reflect:!0})],E.prototype,"placement",2),$([(0,a.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],E.prototype,"withoutHeader",2),$([(0,a.MZ)({attribute:"light-dismiss",type:Boolean})],E.prototype,"lightDismiss",2),$([(0,a.MZ)({attribute:"aria-labelledby"})],E.prototype,"ariaLabelledby",2),$([(0,a.MZ)({attribute:"aria-describedby"})],E.prototype,"ariaDescribedby",2),$([(0,a.MZ)({attribute:"with-footer",type:Boolean})],E.prototype,"withFooter",2),$([(0,b.w)("open",{waitUntilFirstUpdate:!0})],E.prototype,"handleOpenChange",1),E=$([(0,a.EM)("wa-drawer")],E),i.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-drawer]");if(t instanceof Element){const[e,r]=(0,m.v)(t.getAttribute("data-drawer")||"");if("open"===e&&r?.length){const e=t.getRootNode().getElementById(r);"wa-drawer"===e?.localName?e.open=!0:console.warn(`A drawer with an ID of "${r}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch(e){t(e)}})},57024(e,t,r){r.d(t,{A:()=>i});var i=r(5124).AH`:host{--size:25rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.drawer{display:flex;flex-direction:column;top:0;inset-inline-start:0;width:100%;height:100%;max-width:100%;max-height:100%;overflow:hidden;color:inherit;background-color:var(--wa-color-surface-raised);border:none;box-shadow:var(--wa-shadow-l);overflow:auto;padding:0;margin:0;animation-duration:var(--show-duration);animation-timing-function:ease}.drawer.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.drawer.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.drawer.show.top{animation:show-drawer-from-top var(--show-duration) ease}.drawer.hide.top{animation:show-drawer-from-top var(--hide-duration) ease reverse}.drawer.show.end{animation:show-drawer-from-end var(--show-duration) ease}.drawer.show.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.hide.end{animation:show-drawer-from-end var(--hide-duration) ease reverse}.drawer.hide.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.show.bottom{animation:show-drawer-from-bottom var(--show-duration) ease}.drawer.hide.bottom{animation:show-drawer-from-bottom var(--hide-duration) ease reverse}.drawer.show.start{animation:show-drawer-from-start var(--show-duration) ease}.drawer.show.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.hide.start{animation:show-drawer-from-start var(--hide-duration) ease reverse}.drawer.hide.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.pulse{animation:pulse 250ms ease}.drawer:focus{outline:0}.top{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:100%;height:var(--size)}.end{top:0;inset-inline-end:0;bottom:auto;inset-inline-start:auto;width:var(--size);height:100%}.bottom{top:auto;inset-inline-end:auto;bottom:0;inset-inline-start:0;width:100%;height:var(--size)}.start{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:var(--size);height:100%}.header{display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:last-of-type)){margin-inline-end:var(--wa-spacing-xs)}.drawer::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25));-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)} pulse{0%{scale:1}50%{scale:1.01}100%{scale:1}} show-drawer{from{opacity:0;scale:0.8}to{opacity:1;scale:1}} show-drawer-from-top{from{opacity:0;translate:0 -100%}to{opacity:1;translate:0 0}} show-drawer-from-end{from{opacity:0;translate:100%}to{opacity:1;translate:0 0}} show-drawer-from-bottom{from{opacity:0;translate:0 100%}to{opacity:1;translate:0 0}} show-drawer-from-start{from{opacity:0;translate:-100% 0}to{opacity:1;translate:0 0}} show-backdrop{from{opacity:0}to{opacity:1}} (forced-colors:active){.drawer{border:solid 1px #fff}}`}};