iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 29.2 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[3146],{65522:function(t,e,i){i.d(e,{A:function(){return a}});i(42762);const a=t=>{var e;return null===(e=t.name)||void 0===e?void 0:e.trim()}},81816:function(t,e,i){i.d(e,{aH:function(){return o},cx:function(){return s},es:function(){return c}});var a=i(37981),r=i(28978),n=i(79461);const o=(t,e,i)=>{const a=e[t.entity_id];return a?s(a,i):(0,r.u)(t)},s=(t,e,i)=>{const o=t.name||("original_name"in t&&null!=t.original_name?String(t.original_name):void 0),s=t.device_id?e[t.device_id]:void 0;if(!s)return o||(i?(0,r.u)(i):void 0);const c=(0,a.xn)(s);return c!==o?c&&o&&(0,n.p)(o,c)||o:void 0},c=(t,e,i)=>!o(t,e,i)},74705:function(t,e,i){i.d(e,{Bj:function(){return p},Cf:function(){return u},uU:function(){return h}});i(18111),i(81148),i(22489),i(61701),i(13579),i(62953);if(66649!=i.j)var a=i(44537);var r=i(15638),n=i(65522),o=i(37981),s=i(81816),c=i(55931),d=i(28978),l=i(28455);const h=(t,e,i,r,n,o,c)=>{var l;if("string"==typeof e)return e;if(!e)return(0,d.u)(t);let h=(0,a.e)(e);const p=null!==(l=null==c?void 0:c.separator)&&void 0!==l?l:" ";if(h.every(t=>"text"===t.type))return h.map(t=>t.text).join(p);if((0,s.es)(t,i,r)){h.some(t=>"device"===t.type)||(h=h.map(t=>"entity"===t.type?{type:"device"}:t))}const f=u(t,h,i,r,n,o);return 1===f.length?f[0]||"":f.filter(t=>t).join(p)},u=(t,e,i,a,r,d)=>{const{device:h,area:u,floor:p}=(0,l.ln)(t,i,a,r,d);return e.map(e=>{switch(e.type){case"entity":return(0,s.aH)(t,i,a);case"device":return h?(0,o.xn)(h):void 0;case"area":return u?(0,n.A)(u):void 0;case"floor":return p?(0,c.X)(p):void 0;case"text":return e.text;default:return""}})},p=(t,e)=>{const[i,a,n]=u(e,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors),o=(0,r.qC)(t.language,t.translationMetadata.translations);return{primary:i||a||e.entity_id,secondary:[n,i?a:void 0].filter(Boolean).join(o?" ◂ ":" ▸ ")||void 0}}},55931:function(t,e,i){i.d(e,{X:function(){return a}});i(42762);const a=t=>{var e;return null===(e=t.name)||void 0===e?void 0:e.trim()}},78649:function(t,e,i){i.d(e,{n:function(){return r}});i(27495);const a=/^(\w+)\.(\w+)$/,r=t=>a.test(t)},34470:function(t,e,i){i.d(e,{E:function(){return r}});let a;const r=(0,i(5124).AH)(a||(a=(t=>t)`ha-state-icon[data-domain=alarm_control_panel][data-state=arming],ha-state-icon[data-domain=alarm_control_panel][data-state=pending],ha-state-icon[data-domain=alarm_control_panel][data-state=triggered],ha-state-icon[data-domain=lock][data-state=jammed]{animation:pulse 1s infinite}@keyframes pulse{0%{opacity:1}50%{opacity:0}100%{opacity:1}}ha-state-icon[data-state=unavailable]{color:var(--state-unavailable-color)}`))},60353:function(t,e,i){i.d(e,{u:function(){return a}});class a{start(t){const e=Date.now();this._startY=t,this._startTime=e,this._lastY=t,this._lastTime=e,this._delta=0}move(t){const e=Date.now();return this._delta=this._startY-t,this._lastY=t,this._lastTime=e,this._delta}end(){const t=this.getVelocity(),e=Math.abs(t)>this._velocityThreshold;return{velocity:t,delta:this._delta,isSwipe:e,isDownwardSwipe:t>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const t=this._lastTime-this._startTime;return t>0?(this._lastY-this._startY)/t:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(t={}){var e,i;this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=null!==(e=t.velocitySwipeThreshold)&&void 0!==e?e:.5,this._movementTimeThreshold=null!==(i=t.movementTimeThreshold)&&void 0!==i?i:100}}},3931:function(t,e,i){i.d(e,{U:function(){return a}});i(3362),i(62953);const a=async(t,e,i,a,r,...n)=>{let o=a[t];o||(o=a[t]={});const s=o[r];if(s)return s;const c=i(a,r,...n);return o[r]=c,c.then(()=>setTimeout(()=>{o[r]=void 0},e),()=>{o[r]=void 0}),c}},5745:function(t,e,i){var a=i(40445),r=i(99731),n=i(67576);class o extends r.Y{}o=(0,a.Cg)([(0,n.EM)("ha-chip-set")],o)},74281:function(t,e,i){i.a(t,async function(t,e){try{i(18111),i(7588),i(45367),i(92731),i(62953);var a=i(40445),r=i(5124),n=i(67576),o=i(63672),s=i(89784),c=i(71727),d=i(69093),l=i(52658),h=i(34470),u=i(10897),p=i(38279),f=i(93367),g=t([f]);f=(g.then?(await g)():g)[0];let v,m,_,b=t=>t;const y="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";class w extends r.WF{connectedCallback(){var t,e;super.connectedCallback(),this.hasUpdated&&void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&this.requestUpdate("stateObj")}disconnectedCallback(){var t,e;super.disconnectedCallback(),void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&(this.style.backgroundImage="")}get _stateColor(){var t;const e=this.stateObj?(0,d.t)(this.stateObj):void 0;return null!==(t=this.stateColor)&&void 0!==t?t:"light"===e}render(){const t=this.stateObj;if(!t&&!this.overrideIcon&&!this.overrideImage)return(0,r.qy)(v||(v=b`<div class="missing"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div>`),y);const e=this.getClass();if(e&&e.forEach((t,e)=>{t?this.classList.add(e):this.classList.remove(e)}),!this.icon)return r.s6;const i=t?(0,d.t)(t):void 0;return(0,r.qy)(m||(m=b`<ha-state-icon style="${0}" data-domain="${0}" data-state="${0}" .icon="${0}" .stateObj="${0}"></ha-state-icon>`),(0,s.W)(this._iconStyle),(0,o.J)(i),(0,o.J)(null==t?void 0:t.state),this.overrideIcon,t)}willUpdate(t){if(super.willUpdate(t),!(t.has("stateObj")||t.has("overrideImage")||t.has("overrideIcon")||t.has("stateColor")||t.has("color")))return;const e=this.stateObj,i={};let a="";if(this.icon=!0,e){const t=(0,c.m)(e.entity_id);if(void 0===this.overrideImage)if(!e.attributes.entity_picture_local&&!e.attributes.entity_picture||this.overrideIcon){if(this.color)i.color=this.color;else if(this._stateColor){const t=(0,l.Se)(e);if(t&&(i.color=t),e.attributes.rgb_color&&(i.color=`rgb(${e.attributes.rgb_color.join(",")})`),e.attributes.brightness){const t=e.attributes.brightness;if("number"!=typeof t){const i=`Type error: state-badge expected number, but type of ${e.entity_id}.attributes.brightness is ${typeof t} (${t})`;console.warn(i)}i.filter=(0,l.mT)(e)}if(e.attributes.hvac_action){const t=e.attributes.hvac_action;t in p.sx?i.color=(0,l.Se)(e,p.sx[t]):delete i.color}}}else{let i=e.attributes.entity_picture_local||e.attributes.entity_picture;this.hass&&(i=this.hass.hassUrl(i)),"camera"===t&&(i=(0,u.su)(i,80,80)),a=`url(${i})`,this.icon=!1}else if(this.overrideImage){let t=this.overrideImage;this.hass&&(t=this.hass.hassUrl(t)),a=`url(${t})`,this.icon=!1}}this._iconStyle=i,this.style.backgroundImage=a}getClass(){const t=new Map(["has-no-radius","has-media-image","has-image"].map(t=>[t,!1]));if(this.stateObj){const e=(0,c.m)(this.stateObj.entity_id);"update"===e?t.set("has-no-radius",!0):"media_player"===e||"camera"===e?t.set("has-media-image",!0):""!==this.style.backgroundImage&&t.set("has-image",!0)}return t}static get styles(){return[h.E,(0,r.AH)(_||(_=b`:host{position:relative;display:inline-flex;width:40px;color:var(--state-icon-color);border-radius:var(--state-badge-border-radius,50%);height:40px;background-size:cover;box-sizing:border-box;--state-inactive-color:initial;align-items:center;justify-content:center}:host(.has-image){border-radius:var(--state-badge-with-image-border-radius,50%)}:host(.has-media-image){border-radius:var(--state-badge-with-media-image-border-radius,8%)}:host(.has-no-radius){border-radius:var(--ha-border-radius-square)}:host(:focus){outline:0}:host(:not([icon]):focus){border:2px solid var(--divider-color)}:host([icon]:focus){background:var(--divider-color)}ha-state-icon{transition:color .3s ease-in-out,filter .3s ease-in-out}.missing{color:#fce588}`))]}constructor(...t){super(...t),this.icon=!0,this._iconStyle={}}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"stateObj",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"overrideIcon",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"overrideImage",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"stateColor",void 0),(0,a.Cg)([(0,n.MZ)()],w.prototype,"color",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],w.prototype,"icon",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_iconStyle",void 0),w=(0,a.Cg)([(0,n.EM)("state-badge")],w),e()}catch(v){e(v)}})},99611:function(t,e,i){i.a(t,async function(t,e){try{i(18111),i(13579),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(40445),r=i(1126),n=i(35211),o=i(5124),s=i(67576),c=i(1087),d=i(60353),l=i(22792),h=i(59992),u=i(14503),p=i(22348),f=t([r,h]);[r,h]=f.then?(await f)():f;let g,v,m=t=>t;const _=300,b=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),y=new Set(["volume-slider-container","forecast"]);class w extends((0,h.V)(o.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(t){super.updated(t),t.has("open")&&(this._drawerOpen=this.open)}render(){return(0,o.qy)(g||(g=m` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" @keydown="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-hide="${0}" @wa-after-hide="${0}" @click="${0}" without-header @touchstart="${0}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(t){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(t)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${_}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},_)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,u.dp,(0,o.AH)(v||(v=m`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`),_,_)]}constructor(...t){super(...t),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new d.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,c.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var t;const e=this._autofocusElement;null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,p.V)(this._hassConfig.auth.external)?e&&(e.id||(e.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})):null==e||e.focus()})},this._handleAfterShow=()=>{(0,c.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=t=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);t.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,c.r)(this,"closed"))},this._handleHide=t=>{if(t.eventPhase!==Event.AT_TARGET)return;const e=t.detail.source===t.target.drawer;if(this._sliderInteractionActive)return t.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&e&&t.preventDefault(),this._escapePressed=!1},this._handleKeyDown=t=>{"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)},this._handleCloseAction=t=>{t.composedPath().some(t=>t instanceof HTMLElement&&("close"===t.getAttribute("data-dialog")||"close"===t.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=t=>{if(this.preventScrimClose)return;const e=t.composedPath();for(const i of e){if(i===this._drawer)break;if(i instanceof HTMLElement&&(i.scrollTop>0||b.has(i.localName)||Array.from(i.classList).some(t=>y.has(t))))return}t.stopPropagation(),this._startResizing(t.touches[0].clientY)},this._handleTouchMove=t=>{const e=t.touches[0].clientY,i=this._gestureRecognizer.move(e);i<0&&(t.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*i}px)`)}))},this._handleTouchEnd=()=>{var t;this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const i=null===(t=this._drawer.shadowRoot)||void 0===t?void 0:t.querySelector('[part="body"]'),a=(null==i?void 0:i.offsetHeight)||0;a>0&&e.delta<0&&Math.abs(e.delta)>.5*a?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,a.Cg)([(0,s.MZ)({attribute:"aria-labelledby"})],w.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"aria-describedby"})],w.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"open",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],w.prototype,"flexContent",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],w.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,s.wk)()],w.prototype,"_drawerOpen",void 0),(0,a.Cg)([(0,s.wk)()],w.prototype,"_sliderInteractionActive",void 0),(0,a.Cg)([(0,s.wk)(),(0,n.Fg)({context:l.WF,subscribe:!0})],w.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,s.P)("#drawer")],w.prototype,"_drawer",void 0),(0,a.Cg)([(0,s.P)("#body")],w.prototype,"_bodyElement",void 0),(0,a.Cg)([(0,s.P)("[autofocus]")],w.prototype,"_autofocusElement",void 0),w=(0,a.Cg)([(0,s.EM)("ha-bottom-sheet")],w),e()}catch(g){e(g)}})},93367:function(t,e,i){i.a(t,async function(t,e){try{var a=i(40445),r=i(35211),n=i(5124),o=i(67576),s=i(91450),c=i(69093),d=i(22792),l=i(85694),h=(i(47680),i(67094),t([l]));l=(h.then?(await h)():h)[0];let u,p,f,g,v=t=>t;class m extends n.WF{render(){var t,e;const i=this.icon||this.stateObj&&(null===(t=this._entities)||void 0===t||null===(t=t[this.stateObj.entity_id])||void 0===t?void 0:t.icon)||(null===(e=this.stateObj)||void 0===e?void 0:e.attributes.icon);if(i)return(0,n.qy)(u||(u=v`<ha-icon .icon="${0}"></ha-icon>`),i);if(!this.stateObj)return n.s6;if(!this._config||!this._connection||!this._entities)return this._renderFallback();const a=(0,l.fq)(this._entities,this._config.config,this._connection.connection,this.stateObj,this.stateValue).then(t=>t?(0,n.qy)(p||(p=v`<ha-icon .icon="${0}"></ha-icon>`),t):this._renderFallback());return(0,n.qy)(f||(f=v`${0}`),(0,s.T)(a))}_renderFallback(){const t=(0,c.t)(this.stateObj);return(0,n.qy)(g||(g=v` <ha-svg-icon .path="${0}"></ha-svg-icon> `),l.l[t]||l.lW)}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"stateObj",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"stateValue",void 0),(0,a.Cg)([(0,o.MZ)()],m.prototype,"icon",void 0),(0,a.Cg)([(0,o.wk)(),(0,r.Fg)({context:d.WF,subscribe:!0})],m.prototype,"_config",void 0),(0,a.Cg)([(0,o.wk)(),(0,r.Fg)({context:d.Wq,subscribe:!0})],m.prototype,"_connection",void 0),(0,a.Cg)([(0,o.wk)(),(0,r.Fg)({context:d.X1,subscribe:!0})],m.prototype,"_entities",void 0),m=(0,a.Cg)([(0,o.EM)("ha-state-icon")],m),e()}catch(u){e(u)}})},82e3:function(t,e,i){i.d(e,{D5:function(){return a},Fy:function(){return h},Gk:function(){return f},Hg:function(){return r},TJ:function(){return o},UQ:function(){return l},Y_:function(){return g},ds:function(){return p},e0:function(){return n},ec:function(){return u},go:function(){return c},n2:function(){return d},sq:function(){return s}});i(74423),i(18111),i(61701),i(33110),i(3362);const a=14881==i.j?`${location.protocol}//${location.host}`:null,r=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return Object.assign(Object.assign({},t),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},t),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},t),{},{autocomplete:"one-time-code",autofocus:!0});default:return t}}),n=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),o=()=>fetch("/auth/providers",{credentials:"same-origin"}),s=(t,e,i)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:t,handler:i,redirect_uri:e})}),c=(t,e)=>fetch(`/auth/login_flow/${t}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(e)}),d=t=>fetch(`/auth/login_flow/${t}`,{method:"DELETE",credentials:"same-origin"}),l=(t,e,i,a)=>{t.includes("?")?t.endsWith("&")||(t+="&"):t+="?",t+=`code=${encodeURIComponent(e)}`,i&&(t+=`&state=${encodeURIComponent(i)}`),a&&(t+="&storeToken=true"),document.location.assign(t)},h=async(t,e,i,a)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:i,password:a}),u=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:i}),p=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:i}),f=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:i}),g=(t,e,i)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:i})},10897:function(t,e,i){i.d(e,{C4:function(){return d},CK:function(){return c},FX:function(){return g},UC:function(){return p},_Z:function(){return b},bT:function(){return y},j4:function(){return m},sd:function(){return n},su:function(){return s},vc:function(){return _},w8:function(){return u},wv:function(){return h},y3:function(){return f},zS:function(){return o}});i(3362);var a=i(3931),r=i(82e3);const n=[1,2,3,4,6,8],o="web_rtc",s=(t,e,i)=>`${t}&width=${e}&height=${i}`,c=t=>t.attributes.access_token?`/api/camera_proxy_stream/${t.entity_id}?token=${t.attributes.access_token}`:void 0,d=async(t,e,i,r)=>{const n=await(0,a.U)("_cameraTmbUrl",9e3,l,t,e);return s(n,i,r)},l=async(t,e)=>{const i=await(0,r.e0)(t,`/api/camera_proxy/${e}`);return t.hassUrl(i.path)},h=async(t,e,i)=>{const a={type:"camera/stream",entity_id:e};i&&(a.format=i);const r=await t.callWS(a);return r.url=t.hassUrl(r.url),r},u=(t,e,i,a)=>t.connection.subscribeMessage(a,{type:"camera/webrtc/offer",entity_id:e,offer:i}),p=(t,e,i,a)=>t.callWS({type:"camera/webrtc/candidate",entity_id:e,session_id:i,candidate:a}),f=(t,e)=>t.callWS({type:"camera/get_prefs",entity_id:e}),g=(t,e,i)=>t.callWS(Object.assign({type:"camera/update_prefs",entity_id:e},i)),v="media-source://camera/",m=t=>t.startsWith(v),_=t=>t.substring(22),b=async(t,e)=>t.callWS({type:"camera/capabilities",entity_id:e}),y=async(t,e)=>t.callWS({type:"camera/webrtc/get_client_config",entity_id:e})},53756:function(t,e,i){i.d(e,{t:function(){return c},w:function(){return d}});i(74423),i(18111),i(22489),i(61701),i(62953);var a=i(71727),r=i(74705),n=i(28978),o=i(15638),s=i(95350);const c=[{name:"search_labels.entityName",weight:10},{name:"search_labels.friendlyName",weight:8},{name:"search_labels.deviceName",weight:7},{name:"search_labels.areaName",weight:6},{name:"search_labels.domainName",weight:6},{name:"search_labels.entityId",weight:3}],d=(t,e,i,c,d,l,h,u,p,f="")=>{let g,v=Object.keys(t.states);return h&&(v=v.filter(t=>h.includes(t))),u&&(v=v.filter(t=>!u.includes(t))),e&&(v=v.filter(t=>e.includes((0,a.m)(t)))),i&&(v=v.filter(t=>!i.includes((0,a.m)(t)))),g=v.map(e=>{const i=t.states[e],c=(0,n.u)(i),[d,l,h]=(0,r.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors),u=(0,s.p$)(t.localize,(0,a.m)(e)),p=(0,o.qC)(t.language,t.translationMetadata.translations),g=d||l||e,v=[h,d?l:void 0].filter(Boolean).join(p?" ◂ ":" ▸ ");return{id:`${f}${e}`,primary:g,secondary:v,domain_name:u,sorting_label:[g,v].filter(Boolean).join("_"),search_labels:{entityName:d||null,deviceName:l||null,areaName:h||null,domainName:u||null,friendlyName:c||null,entityId:e},stateObj:i}}),d&&(g=g.filter(t=>{var e;return t.id===p||(null===(e=t.stateObj)||void 0===e?void 0:e.attributes.device_class)&&d.includes(t.stateObj.attributes.device_class)})),l&&(g=g.filter(t=>{var e;return t.id===p||(null===(e=t.stateObj)||void 0===e?void 0:e.attributes.unit_of_measurement)&&l.includes(t.stateObj.attributes.unit_of_measurement)})),c&&(g=g.filter(t=>t.id===p||t.stateObj&&c(t.stateObj))),g}},95350:function(t,e,i){i.d(e,{$h:function(){return u},FP:function(){return v},Og:function(){return n},QC:function(){return h},QQ:function(){return s},S1:function(){return o},Ud:function(){return m},fK:function(){return d},l7:function(){return l},nQ:function(){return f},p$:function(){return c}});i(3362),i(62953);if(66649!=i.j)var a=i(90889);var r=i(9899);const n=66649!=i.j?{bluetooth:"config/bluetooth",dhcp:"config/dhcp",matter:"config/matter",mqtt:"config/mqtt",ssdp:"config/ssdp",thread:"config/thread",zeroconf:"config/zeroconf",zha:"config/zha/dashboard",zwave_js:"config/zwave_js/dashboard"}:null;var o=66649!=i.j?function(t){return t[t.CRITICAL=50]="CRITICAL",t[t.ERROR=40]="ERROR",t[t.WARNING=30]="WARNING",t[t.INFO=20]="INFO",t[t.DEBUG=10]="DEBUG",t[t.NOTSET=0]="NOTSET",t}({}):null;const s=(t,e)=>e.issue_tracker||`https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+${t}%22`,c=(t,e,i)=>t(`component.${e}.title`)||(null==i?void 0:i.name)||e,d=(t,e)=>{const i={type:"manifest/list"};return e&&(i.integrations=e),t.callWS(i)},l=async(t,e)=>{const i=await t.sendMessagePromise({type:"manifest/list"}),a={};for(const r of i)a[r.domain]=r;return e(a),()=>{}},h=(t,e)=>t.callWS({type:"manifest/get",integration:e}),u=t=>t.callWS({type:"integration/setup_info"}),p=t=>t.sendMessagePromise({type:"logger/log_info"}),f=(t,e,i,a)=>t.callWS({type:"logger/integration_log_level",integration:e,level:i,persistence:a}),g=(t,e)=>t.subscribeEvents((0,r.s)(()=>p(t).then(t=>e.setState(t,!0)),200,!0),"logging_changed"),v=(t,e)=>(0,a.N)("_integration_log_info",p,g,t,e),m=(t,e)=>t.callWS({type:"integration/wait",domain:e})},24367:function(t,e,i){i.d(e,{L:function(){return r},z:function(){return n}});var a=i(23832);const r=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],n=(0,a.g)(r)},19711:function(t,e,i){i.d(e,{$:function(){return n}});i(3362),i(62953);var a=i(1087);const r=()=>Promise.all([i.e(80131),i.e(70183),i.e(47677)]).then(i.bind(i,79029)),n=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-helper-detail",dialogImport:r,dialogParams:e})}},75796:function(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HuiHomeDashboardStrategyEditor:function(){return u}});var r=i(40445),n=i(5124),o=i(67576),s=i(1087),c=i(77122),d=t([c]);c=(d.then?(await d)():d)[0];let l,h=t=>t;class u extends n.WF{setConfig(t){this._config=t}render(){return this.hass&&this._config?(0,n.qy)(l||(l=h` <ha-entities-picker .hass="${0}" .value="${0}" label="${0}" placeholder="${0}" reorder @value-changed="${0}"> </ha-entities-picker> `),this.hass,this._config.favorite_entities||[],this.hass.localize("ui.panel.lovelace.editor.strategy.home.favorite_entities"),this.hass.localize("ui.panel.lovelace.editor.strategy.home.add_favorite_entity"),this._valueChanged):n.s6}_valueChanged(t){var e;if(t.stopPropagation(),!this._config||!this.hass)return;const i=t.detail.value,a=Object.assign(Object.assign({},this._config),{},{favorite_entities:i});0===(null===(e=a.favorite_entities)||void 0===e?void 0:e.length)&&delete a.favorite_entities,(0,s.r)(this,"config-changed",{config:a})}}(0,r.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,r.Cg)([(0,o.wk)()],u.prototype,"_config",void 0),u=(0,r.Cg)([(0,o.EM)("hui-home-dashboard-strategy-editor")],u),a()}catch(l){a(l)}})},53580:function(t,e,i){i.d(e,{mdiHomeAssistant:function(){return a}});const a="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},88438:function(t,e,i){i.d(e,{C:function(){return a}});const a="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}}]);