iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 33.1 kB
JavaScript
/*! For license information please see 62199.fdf60156a23ee2b0.js.LICENSE.txt */
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["62199"],{65703:function(e,t,i){i.d(t,{K:()=>b});i(71695),i(81804),i(22139),i(47021);var r=i(9065),a=(i(16060),i(78611)),o=i(91532),s=i(57243),d=i(50778),n=i(35359);let c,l,p,h,m,g,u,v,_,f,y=e=>e;class b extends s.oi{constructor(){super(...arguments),this.value="",this.group=null,this.tabindex=-1,this.disabled=!1,this.twoline=!1,this.activated=!1,this.graphic=null,this.multipleGraphics=!1,this.hasMeta=!1,this.noninteractive=!1,this.selected=!1,this.shouldRenderRipple=!1,this._managingList=null,this.boundOnClick=this.onClick.bind(this),this._firstChanged=!0,this._skipPropRequest=!1,this.rippleHandlers=new o.A((()=>(this.shouldRenderRipple=!0,this.ripple))),this.listeners=[{target:this,eventNames:["click"],cb:()=>{this.onClick()}},{target:this,eventNames:["mouseenter"],cb:this.rippleHandlers.startHover},{target:this,eventNames:["mouseleave"],cb:this.rippleHandlers.endHover},{target:this,eventNames:["focus"],cb:this.rippleHandlers.startFocus},{target:this,eventNames:["blur"],cb:this.rippleHandlers.endFocus},{target:this,eventNames:["mousedown","touchstart"],cb:e=>{const t=e.type;this.onDown("mousedown"===t?"mouseup":"touchend",e)}}]}get text(){const e=this.textContent;return e?e.trim():""}render(){const e=this.renderText(),t=this.graphic?this.renderGraphic():(0,s.dy)(c||(c=y``)),i=this.hasMeta?this.renderMeta():(0,s.dy)(l||(l=y``));return(0,s.dy)(p||(p=y` ${0} ${0} ${0} ${0}`),this.renderRipple(),t,e,i)}renderRipple(){return this.shouldRenderRipple?(0,s.dy)(h||(h=y` <mwc-ripple .activated="${0}"> </mwc-ripple>`),this.activated):this.activated?(0,s.dy)(m||(m=y`<div class="fake-activated-ripple"></div>`)):""}renderGraphic(){const e={multi:this.multipleGraphics};return(0,s.dy)(g||(g=y` <span class="mdc-deprecated-list-item__graphic material-icons ${0}"> <slot name="graphic"></slot> </span>`),(0,n.$)(e))}renderMeta(){return(0,s.dy)(u||(u=y` <span class="mdc-deprecated-list-item__meta material-icons"> <slot name="meta"></slot> </span>`))}renderText(){const e=this.twoline?this.renderTwoline():this.renderSingleLine();return(0,s.dy)(v||(v=y` <span class="mdc-deprecated-list-item__text"> ${0} </span>`),e)}renderSingleLine(){return(0,s.dy)(_||(_=y`<slot></slot>`))}renderTwoline(){return(0,s.dy)(f||(f=y` <span class="mdc-deprecated-list-item__primary-text"> <slot></slot> </span> <span class="mdc-deprecated-list-item__secondary-text"> <slot name="secondary"></slot> </span> `))}onClick(){this.fireRequestSelected(!this.selected,"interaction")}onDown(e,t){const i=()=>{window.removeEventListener(e,i),this.rippleHandlers.endPress()};window.addEventListener(e,i),this.rippleHandlers.startPress(t)}fireRequestSelected(e,t){if(this.noninteractive)return;const i=new CustomEvent("request-selected",{bubbles:!0,composed:!0,detail:{source:t,selected:e}});this.dispatchEvent(i)}connectedCallback(){super.connectedCallback(),this.noninteractive||this.setAttribute("mwc-list-item","");for(const e of this.listeners)for(const t of e.eventNames)e.target.addEventListener(t,e.cb,{passive:!0})}disconnectedCallback(){super.disconnectedCallback();for(const e of this.listeners)for(const t of e.eventNames)e.target.removeEventListener(t,e.cb);this._managingList&&(this._managingList.debouncedLayout?this._managingList.debouncedLayout(!0):this._managingList.layout(!0))}firstUpdated(){const e=new Event("list-item-rendered",{bubbles:!0,composed:!0});this.dispatchEvent(e)}}(0,r.__decorate)([(0,d.IO)("slot")],b.prototype,"slotElement",void 0),(0,r.__decorate)([(0,d.GC)("mwc-ripple")],b.prototype,"ripple",void 0),(0,r.__decorate)([(0,d.Cb)({type:String})],b.prototype,"value",void 0),(0,r.__decorate)([(0,d.Cb)({type:String,reflect:!0})],b.prototype,"group",void 0),(0,r.__decorate)([(0,d.Cb)({type:Number,reflect:!0})],b.prototype,"tabindex",void 0),(0,r.__decorate)([(0,d.Cb)({type:Boolean,reflect:!0}),(0,a.P)((function(e){e?this.setAttribute("aria-disabled","true"):this.setAttribute("aria-disabled","false")}))],b.prototype,"disabled",void 0),(0,r.__decorate)([(0,d.Cb)({type:Boolean,reflect:!0})],b.prototype,"twoline",void 0),(0,r.__decorate)([(0,d.Cb)({type:Boolean,reflect:!0})],b.prototype,"activated",void 0),(0,r.__decorate)([(0,d.Cb)({type:String,reflect:!0})],b.prototype,"graphic",void 0),(0,r.__decorate)([(0,d.Cb)({type:Boolean})],b.prototype,"multipleGraphics",void 0),(0,r.__decorate)([(0,d.Cb)({type:Boolean})],b.prototype,"hasMeta",void 0),(0,r.__decorate)([(0,d.Cb)({type:Boolean,reflect:!0}),(0,a.P)((function(e){e?(this.removeAttribute("aria-checked"),this.removeAttribute("mwc-list-item"),this.selected=!1,this.activated=!1,this.tabIndex=-1):this.setAttribute("mwc-list-item","")}))],b.prototype,"noninteractive",void 0),(0,r.__decorate)([(0,d.Cb)({type:Boolean,reflect:!0}),(0,a.P)((function(e){const t=this.getAttribute("role"),i="gridcell"===t||"option"===t||"row"===t||"tab"===t;i&&e?this.setAttribute("aria-selected","true"):i&&this.setAttribute("aria-selected","false"),this._firstChanged?this._firstChanged=!1:this._skipPropRequest||this.fireRequestSelected(e,"property")}))],b.prototype,"selected",void 0),(0,r.__decorate)([(0,d.SB)()],b.prototype,"shouldRenderRipple",void 0),(0,r.__decorate)([(0,d.SB)()],b.prototype,"_managingList",void 0)},46289:function(e,t,i){i.d(t,{W:()=>a});let r;const a=(0,i(57243).iv)(r||(r=(e=>e)`:host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding,16px);padding-right:var(--mdc-list-side-padding,16px);outline:0;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}:host:focus{outline:0}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary,#6200ee);--mdc-ripple-color:var( --mdc-theme-primary, #6200ee )}:host([activated]) .mdc-deprecated-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary,#6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:.12;opacity:var(--mdc-ripple-activated-opacity, .12);background-color:#6200ee;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#6200ee))}.mdc-deprecated-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-deprecated-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-deprecated-list-item__meta{width:var(--mdc-list-item-meta-size,24px);height:var(--mdc-list-item-meta-size,24px);margin-left:auto;margin-right:0;color:rgba(0,0,0,.38);color:var(--mdc-theme-text-hint-on-background,rgba(0,0,0,.38))}.mdc-deprecated-list-item__meta.multi{width:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:var(--mdc-list-item-meta-size,24px);line-height:var(--mdc-list-item-meta-size, 24px)}.mdc-deprecated-list-item__meta ::slotted(.material-icons),.mdc-deprecated-list-item__meta ::slotted(mwc-icon){line-height:var(--mdc-list-item-meta-size, 24px)!important}.mdc-deprecated-list-item__meta ::slotted(:not(.material-icons):not(mwc-icon)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit)}.mdc-deprecated-list-item__meta[dir=rtl],[dir=rtl] .mdc-deprecated-list-item__meta{margin-left:0;margin-right:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:100%;height:100%}.mdc-deprecated-list-item__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mdc-deprecated-list-item__text ::slotted([for]),.mdc-deprecated-list-item__text[for]{pointer-events:none}.mdc-deprecated-list-item__primary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;margin-bottom:-20px;display:block}.mdc-deprecated-list-item__primary-text::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-deprecated-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-deprecated-list-item__secondary-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;display:block}.mdc-deprecated-list-item__secondary-text::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-deprecated-list--dense .mdc-deprecated-list-item__secondary-text{font-size:inherit}* ::slotted(a),a{color:inherit;text-decoration:none}:host([twoline]){height:72px}:host([twoline]) .mdc-deprecated-list-item__text{align-self:flex-start}:host([disabled]),:host([noninteractive]){cursor:default;pointer-events:none}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*){opacity:.38}:host([disabled]) .mdc-deprecated-list-item__primary-text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__secondary-text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*){color:#000;color:var(--mdc-theme-on-surface,#000)}.mdc-deprecated-list-item__secondary-text ::slotted(*){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.mdc-deprecated-list-item__graphic ::slotted(*){background-color:transparent;color:rgba(0,0,0,.38);color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.mdc-deprecated-list-group__subheader ::slotted(*){color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size,40px);height:var(--mdc-list-item-graphic-size,40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size,40px);line-height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 40px)!important}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){border-radius:50%}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic{margin-left:0;margin-right:var(--mdc-list-item-graphic-margin,16px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=control]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=large]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=medium]) .mdc-deprecated-list-item__graphic[dir=rtl],[dir=rtl] :host([graphic=avatar]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=control]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=large]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=medium]) .mdc-deprecated-list-item__graphic{margin-left:var(--mdc-list-item-graphic-margin,16px);margin-right:0}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size,24px);height:var(--mdc-list-item-graphic-size,24px);margin-left:0;margin-right:var(--mdc-list-item-graphic-margin,32px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size,24px);line-height:var(--mdc-list-item-graphic-size, 24px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 24px)!important}:host([graphic=icon]) .mdc-deprecated-list-item__graphic[dir=rtl],[dir=rtl] :host([graphic=icon]) .mdc-deprecated-list-item__graphic{margin-left:var(--mdc-list-item-graphic-margin,32px);margin-right:0}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:56px}:host([graphic=large]:not([twoLine])),:host([graphic=medium]:not([twoLine])){height:72px}:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size,56px);height:var(--mdc-list-item-graphic-size,56px)}:host([graphic=large]) .mdc-deprecated-list-item__graphic.multi,:host([graphic=medium]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(*),:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size,56px);line-height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon),:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 56px)!important}:host([graphic=large]){padding-left:0px}`))},87319:function(e,t,i){var r=i(9065),a=i(50778),o=i(65703),s=i(46289);let d=class extends o.K{};d.styles=[s.W],d=(0,r.__decorate)([(0,a.Mo)("mwc-list-item")],d)},99426:function(e,t,i){i.r(t);var r=i(61701),a=(i(71695),i(47021),i(57243)),o=i(50778),s=i(35359),d=i(36522);i(23334),i(37583);let n,c,l,p,h=e=>e;const m={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,r.Z)([(0,o.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"title",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({attribute:"alert-type"})],key:"alertType",value(){return"info"}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"dismissable",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,a.dy)(n||(n=h` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,s.$)({[this.alertType]:!0}),this.title?"":"no-title",m[this.alertType],(0,s.$)({content:!0,narrow:this.narrow}),this.title?(0,a.dy)(c||(c=h`<div class="title">${0}</div>`),this.title):a.Ld,this.dismissable?(0,a.dy)(l||(l=h`<ha-icon-button ="${0}" label="Dismiss alert" .path="${0}"></ha-icon-button>`),this._dismissClicked,"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"):a.Ld)}},{kind:"method",key:"_dismissClicked",value:function(){(0,d.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value(){return(0,a.iv)(p||(p=h`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`))}}]}}),a.oi)},54977:function(e,t,i){var r=i(61701),a=(i(71695),i(47021),i(57243)),o=i(50778);let s,d,n,c=e=>e;(0,r.Z)([(0,o.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"raised",value(){return!1}},{kind:"field",static:!0,key:"styles",value(){return(0,a.iv)(s||(s=c`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,12px);border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, 24px);letter-spacing:-.012em;line-height:48px;padding:12px 16px 16px;display:block;margin-block-start:0px;margin-block-end:0px;font-weight:400}:host ::slotted(.card-content:not(:first-child)),slot:not(:first-child)::slotted(.card-content){padding-top:0px;margin-top:-8px}:host ::slotted(.card-content){padding:16px}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:5px 16px}`))}},{kind:"method",key:"render",value:function(){return(0,a.dy)(d||(d=c` ${0} <slot></slot> `),this.header?(0,a.dy)(n||(n=c`<h1 class="card-header">${0}</h1>`),this.header):a.Ld)}}]}}),a.oi)},7285:function(e,t,i){i.d(t,{M:()=>m});var r=i(61701),a=i(72621),o=(i(71695),i(47021),i(65703)),s=i(46289),d=i(57243),n=i(50778);let c,l,p,h=e=>e,m=(0,r.Z)([(0,n.Mo)("ha-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,a.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[s.W,(0,d.iv)(c||(c=h`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,d.iv)(l||(l=h`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,d.iv)(p||(p=h``))]}}]}}),o.K)},34515:function(e,t,i){i.r(t);var r=i(61701),a=(i(71695),i(47021),i(31622),i(57243)),o=i(50778);i(54202),i(43344),i(99426);let s,d,n,c,l,p=e=>e;(0,r.Z)([(0,o.Mo)("hass-error-screen")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"toolbar",value(){return!0}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"rootnav",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)()],key:"error",value:void 0},{kind:"method",key:"render",value:function(){var e,t;return(0,a.dy)(s||(s=p` ${0} <div class="content"> <ha-alert alert-type="error">${0}</ha-alert> <slot> <mwc-button ="${0}"> ${0} </mwc-button> </slot> </div> `),this.toolbar?(0,a.dy)(d||(d=p`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(e=history.state)&&void 0!==e&&e.root?(0,a.dy)(n||(n=p` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,a.dy)(c||(c=p` <ha-icon-button-arrow-prev .hass="${0}" ="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)):"",this.error,this._handleBack,null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,a.iv)(l||(l=p`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box} (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev{pointer-events:auto}.content{color:var(--primary-text-color);height:calc(100% - var(--header-height));display:flex;padding:16px;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}a{color:var(--primary-color)}ha-alert{margin-bottom:16px}`))]}}]}}),a.oi)},71220:function(e,t,i){i.d(t,{Dm:()=>d,jg:()=>o,p4:()=>a,pN:()=>s,xC:()=>r});i(61495),i(23669),i(11740);const r=e=>{let t=e;return"string"==typeof e&&(t=parseInt(e,16)),"0x"+t.toString(16).padStart(4,"0")},a=e=>e.split(":").slice(-4).reverse().join(""),o=(e,t)=>{const i=e.user_given_name?e.user_given_name:e.name,r=t.user_given_name?t.user_given_name:t.name;return i.localeCompare(r)},s=(e,t)=>{const i=e.name,r=t.name;return i.localeCompare(r)},d=e=>`${e.name} (Endpoint id: ${e.endpoint_id}, Id: ${r(e.id)}, Type: ${e.type})`},58914:function(e,t,i){i.a(e,(async function(e,r){try{i.r(t),i.d(t,{ZHAGroupPage:()=>w});var a=i(61701),o=i(72621),s=(i(71695),i(9359),i(56475),i(70104),i(52924),i(40251),i(22139),i(47021),i(31622),i(57243)),d=i(50778),n=i(83523),c=(i(54977),i(17170)),l=(i(23334),i(74794)),p=(i(34515),i(87979),i(98241),i(71220)),h=(i(33718),i(2060),i(7285),e([c]));c=(h.then?(await h)():h)[0];let m,g,u,v,_,f,y,b,x=e=>e;const k="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z";let w=(0,a.Z)([(0,d.Mo)("zha-group-page")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Object})],key:"group",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1,type:Number})],key:"groupId",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1,type:Array})],key:"deviceEndpoints",value(){return[]}},{kind:"field",decorators:[(0,d.SB)()],key:"_processingAdd",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_processingRemove",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_filteredDeviceEndpoints",value(){return[]}},{kind:"field",decorators:[(0,d.SB)()],key:"_selectedDevicesToAdd",value(){return[]}},{kind:"field",decorators:[(0,d.SB)()],key:"_selectedDevicesToRemove",value(){return[]}},{kind:"field",decorators:[(0,d.IO)("#addMembers",!0)],key:"_zhaAddMembersDataTable",value:void 0},{kind:"field",decorators:[(0,d.IO)("#removeMembers")],key:"_zhaRemoveMembersDataTable",value:void 0},{kind:"field",key:"_firstUpdatedCalled",value(){return!1}},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(i,"connectedCallback",this,3)([]),this.hass&&this._firstUpdatedCalled&&this._fetchData()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(i,"disconnectedCallback",this,3)([]),this._processingAdd=!1,this._processingRemove=!1,this._selectedDevicesToRemove=[],this._selectedDevicesToAdd=[],this.deviceEndpoints=[],this._filteredDeviceEndpoints=[]}},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(i,"firstUpdated",this,3)([e]),this.hass&&this._fetchData(),this._firstUpdatedCalled=!0}},{kind:"method",key:"render",value:function(){return this.group?(0,s.dy)(g||(g=x` <hass-subpage .hass="${0}" .narrow="${0}" .header="${0}"> <ha-icon-button slot="toolbar-icon" .path="${0}" ="${0}" .label="${0}"></ha-icon-button> <ha-config-section .isWide="${0}"> <div class="header"> ${0} </div> <p slot="introduction"> ${0} </p> <p><b>Name:</b> ${0}</p> <p><b>Group Id:</b> ${0}</p> <div class="header"> ${0} </div> <ha-card> <mwc-list> ${0} </mwc-list> </ha-card> ${0} <div class="header"> ${0} </div> <zha-device-endpoint-data-table id="addMembers" .hass="${0}" .deviceEndpoints="${0}" .narrow="${0}" selectable -changed="${0}"> </zha-device-endpoint-data-table> <div class="buttons"> <mwc-button .disabled="${0}" ="${0}" class="button"> ${0} ${0}</mwc-button> </div> </ha-config-section> </hass-subpage> `),this.hass,this.narrow,this.group.name,k,this._deleteGroup,this.hass.localize("ui.panel.config.zha.groups.delete"),this.isWide,this.hass.localize("ui.panel.config.zha.groups.group_info"),this.hass.localize("ui.panel.config.zha.groups.group_details"),this.group.name,(0,p.xC)(this.group.group_id),this.hass.localize("ui.panel.config.zha.groups.members"),this.group.members.length?this.group.members.map((e=>(0,s.dy)(u||(u=x`<a href="/config/devices/device/${0}"> <ha-list-item>${0}</ha-list-item> </a>`),e.device.device_reg_id,e.device.user_given_name||e.device.name))):(0,s.dy)(v||(v=x` <ha-list-item> This group has no members </ha-list-item> `)),this.group.members.length?(0,s.dy)(_||(_=x` <div class="header"> ${0} </div> <zha-device-endpoint-data-table id="removeMembers" .hass="${0}" .deviceEndpoints="${0}" .narrow="${0}" selectable -changed="${0}"> </zha-device-endpoint-data-table> <div class="buttons"> <mwc-button .disabled="${0}" ="${0}" class="button"> ${0} ${0}</mwc-button> </div> `),this.hass.localize("ui.panel.config.zha.groups.remove_members"),this.hass,this.group.members,this.narrow,this._handleRemoveSelectionChanged,!this._selectedDevicesToRemove.length||this._processingRemove,this._removeMembersFromGroup,this._processingRemove?(0,s.dy)(f||(f=x`<ha-spinner .ariaLabel="${0}"></ha-spinner>`),this.hass.localize("ui.panel.config.zha.groups.removing_members")):s.Ld,this.hass.localize("ui.panel.config.zha.groups.remove_members")):s.Ld,this.hass.localize("ui.panel.config.zha.groups.add_members"),this.hass,this._filteredDeviceEndpoints,this.narrow,this._handleAddSelectionChanged,!this._selectedDevicesToAdd.length||this._processingAdd,this._addMembersToGroup,this._processingAdd?(0,s.dy)(y||(y=x`<ha-spinner size="small" aria-label="Saving"></ha-spinner>`)):"",this.hass.localize("ui.panel.config.zha.groups.add_members")):(0,s.dy)(m||(m=x` <hass-error-screen .hass="${0}" .error="${0}"></hass-error-screen> `),this.hass,this.hass.localize("ui.panel.config.zha.groups.group_not_found"))}},{kind:"method",key:"_fetchData",value:async function(){null!==this.groupId&&void 0!==this.groupId&&(this.group=await(0,l.yi)(this.hass,this.groupId)),this.deviceEndpoints=await(0,l.pT)(this.hass),this._filterDevices()}},{kind:"method",key:"_filterDevices",value:function(){this._filteredDeviceEndpoints=this.deviceEndpoints.filter((e=>!this.group.members.some((t=>t.device.ieee===e.device.ieee&&t.endpoint_id===e.endpoint_id))))}},{kind:"method",key:"_handleAddSelectionChanged",value:function(e){this._selectedDevicesToAdd=e.detail.value}},{kind:"method",key:"_handleRemoveSelectionChanged",value:function(e){this._selectedDevicesToRemove=e.detail.value}},{kind:"method",key:"_addMembersToGroup",value:async function(){this._processingAdd=!0;const e=this._selectedDevicesToAdd.map((e=>{const t=e.split("_");return{ieee:t[0],endpoint_id:t[1]}}));this.group=await(0,l.dy)(this.hass,this.groupId,e),this._filterDevices(),this._selectedDevicesToAdd=[],this._zhaAddMembersDataTable.clearSelection(),this._processingAdd=!1}},{kind:"method",key:"_removeMembersFromGroup",value:async function(){this._processingRemove=!0;const e=this._selectedDevicesToRemove.map((e=>{const t=e.split("_");return{ieee:t[0],endpoint_id:t[1]}}));this.group=await(0,l.tz)(this.hass,this.groupId,e),this._filterDevices(),this._selectedDevicesToRemove=[],this._zhaRemoveMembersDataTable.clearSelection(),this._processingRemove=!1}},{kind:"method",key:"_deleteGroup",value:async function(){await(0,l.gg)(this.hass,[this.groupId]),(0,n.c)("/config/zha/groups",{replace:!0})}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,s.iv)(b||(b=x`hass-subpage{--app-header-text-color:var(--sidebar-icon-color)}.header{font-family:var(--paper-font-display1_-_font-family);-webkit-font-smoothing:var(--paper-font-display1_-_-webkit-font-smoothing);font-size:var(--paper-font-display1_-_font-size);font-weight:var(--paper-font-display1_-_font-weight);letter-spacing:var(--paper-font-display1_-_letter-spacing);line-height:var(--paper-font-display1_-_line-height);opacity:var(--dark-primary-opacity)}.button{float:right}a{color:var(--primary-color);text-decoration:none}.buttons{align-items:flex-end;padding:8px}.buttons .warning{--mdc-theme-primary:var(--error-color)}`))]}}]}}),s.oi);r()}catch(m){r(m)}}))}}]);
//# sourceMappingURL=62199.fdf60156a23ee2b0.js.map