UNPKG

iobroker.lovelace

Version:

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

32 lines 35.9 kB
/*! For license information please see 61331.d0029a224c2bc3fc.js.LICENSE.txt */ export const __rspack_esm_id=61331;export const __rspack_esm_ids=[61331];export const __webpack_modules__={32656(e,t,i){i.a(e,async function(e,t){try{i(74423);var a=i(62826),o=i(5124),s=i(22441),r=i(63672),l=i(1087),n=i(57237),d=i(26300),h=(i(3449),i(606)),p=i(91485),c=e([d,h,p]);[d,h,p]=c.then?(await c)():c;const m="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";class u extends o.WF{reportValidity(){const e=this._inputs;return!e||[...e].every(e=>e.reportValidity())}render(){return o.qy` ${this.label?o.qy`<label>${this.label}${this.required?" *":""}</label>`:o.s6} <div class="time-input-wrap-wrap"> <div class="time-input-wrap"> ${this.enableDay?o.qy` <ha-input id="day" type="number" inputmode="numeric" .value="${this.days.toFixed()}" .label="${this.placeholderLabels?"":this.dayLabel}" .placeholder="${this.placeholderLabels?this.dayLabel:""}" name="days" @change="${this._valueChanged}" @focusin="${this._onFocus}" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" min="0" .disabled="${this.disabled}"> </ha-input> <div class="time-separator">:</div> `:o.s6} <ha-input id="hour" type="number" inputmode="numeric" .value="${this.hours.toFixed()}" .label="${this.placeholderLabels?"":this.hourLabel}" .placeholder="${this.placeholderLabels?this.hourLabel:""}" name="hours" @change="${this._valueChanged}" @focusin="${this._onFocus}" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" maxlength="2" max="${(0,r.J)(this._hourMax)}" min="0" .disabled="${this.disabled}"> </ha-input> <div class="time-separator">:</div> <ha-input id="min" type="number" inputmode="numeric" .value="${this._formatValue(this.minutes)}" .label="${this.placeholderLabels?"":this.minLabel}" .placeholder="${this.placeholderLabels?this.minLabel:""}" @change="${this._valueChanged}" @focusin="${this._onFocus}" name="minutes" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" maxlength="2" max="59" min="0" .disabled="${this.disabled}"> </ha-input> ${this.enableSecond?o.qy`<div class="time-separator">:</div>`:o.s6} ${this.enableSecond?o.qy`<ha-input id="sec" type="number" inputmode="decimal" step="any" .value="${this._formatValue(this.seconds)}" .label="${this.placeholderLabels?"":this.secLabel}" .placeholder="${this.placeholderLabels?this.secLabel:""}" @change="${this._valueChanged}" @focusin="${this._onFocus}" name="seconds" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" max="59" min="0" .disabled="${this.disabled}"> </ha-input> ${this.enableMillisecond?o.qy`<div class="time-separator">:</div>`:o.s6}`:o.s6} ${this.enableMillisecond?o.qy`<ha-input id="millisec" type="number" .value="${this._formatValue(this.milliseconds,3)}" .label="${this.placeholderLabels?"":this.millisecLabel}" .placeholder="${this.placeholderLabels?this.millisecLabel:""}" @change="${this._valueChanged}" @focusin="${this._onFocus}" name="milliseconds" without-spin-buttons .required="${this.required}" .autoValidate="${this.autoValidate}" maxlength="3" max="999" min="0" .disabled="${this.disabled}"> </ha-input>`:o.s6} ${24===this.format?o.s6:o.qy`<ha-select .required="${this.required}" .value="${this.amPm}" .disabled="${this.disabled}" .name="${"amPm"}" @selected="${this._valueChanged}" @wa-after-hide="${n.d}" @wa-hide="${n.d}" .options="${["AM","PM"]}"> </ha-select>`} ${!this.clearable||this.required||this.disabled?o.s6:o.qy`<ha-icon-button label="clear" @click="${this._clearValue}" .path="${m}"></ha-icon-button>`} </div> </div> ${this.helper?o.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:o.s6} `}_clearValue(){(0,l.r)(this,"value-changed")}_valueChanged(e){const t=e.currentTarget;this[t.name||""]="amPm"===t.name?e.detail.value:Number(t.value);const i={hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds};this.enableDay&&(i.days=this.days),12===this.format&&(i.amPm=this.amPm),(0,l.r)(this,"value-changed",{value:i})}_onFocus(e){e.currentTarget.select()}_formatValue(e,t=2){const i=e.toString();return i.includes(".")?i:i.padStart(t,"0")}get _hourMax(){if(!this.noHoursLimit)return 12===this.format?12:23}constructor(...e){super(...e),this.autoValidate=!1,this.required=!1,this.format=12,this.disabled=!1,this.days=0,this.hours=0,this.minutes=0,this.seconds=0,this.milliseconds=0,this.dayLabel="",this.hourLabel="",this.minLabel="",this.secLabel="",this.millisecLabel="",this.enableSecond=!1,this.enableMillisecond=!1,this.enableDay=!1,this.noHoursLimit=!1,this.amPm="AM",this.placeholderLabels=!1}}u.shadowRootOptions={...o.WF.shadowRootOptions,delegatesFocus:!0},u.styles=o.AH`:host([clearable]){position:relative}.time-input-wrap-wrap{display:flex}.time-input-wrap{display:flex;flex:var(--time-input-flex,unset);border-radius:var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--ha-border-radius-square) var(--ha-border-radius-square);overflow:hidden;position:relative;direction:ltr;padding-right:3px}ha-input{height:56px;padding:0;width:60px;flex-grow:1}ha-input:first-child{--text-field-border-top-left-radius:var(--mdc-shape-medium)}ha-input:last-child{--text-field-border-top-right-radius:var(--mdc-shape-medium)}ha-input::part(wa-base){padding:var(--ha-space-1)}ha-input:first-child::part(wa-base){padding-inline-start:var(--ha-space-4)}ha-input:last-child::part(wa-base){padding-inline-end:var(--ha-space-4)}ha-input::part(wa-hint){height:0}ha-input::part(wa-input){text-align:center}.time-separator,ha-icon-button{background-color:var(--ha-color-form-background);color:var(--ha-color-text-secondary);border-bottom:1px solid var(--ha-color-border-neutral-loud);box-sizing:border-box;height:56px;margin-inline-start:calc(var(--ha-space-1) * -1)}.time-separator{width:12px;margin-inline-end:calc(var(--ha-space-1) * -1);display:flex;align-items:center;justify-content:center}:host([clearable]) .mdc-select__anchor{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:relative;--ha-icon-button-size:36px;border-start-end-radius:var(--ha-border-radius-sm);--mdc-icon-size:20px;direction:var(--direction);display:flex;align-items:center}ha-select{margin-inline:calc(var(--ha-space-1) * -1)}label{-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);-webkit-font-smoothing:var(--ha-font-smoothing);font-family:var( --mdc-typography-body2-font-family, var(--mdc-typography-font-family, var(--ha-font-family-body)) );font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));line-height:var( --mdc-typography-body2-line-height, var(--ha-line-height-condensed) );font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));letter-spacing:var( --mdc-typography-body2-letter-spacing, .0178571429em );text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:var(--mdc-typography-body2-text-transform,inherit);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));padding-left:4px;padding-inline-start:4px;padding-inline-end:initial}ha-input-helper-text{padding-top:8px;line-height:var(--ha-line-height-condensed)}`,(0,a.Cg)([(0,s.MZ)()],u.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)()],u.prototype,"helper",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"auto-validate",type:Boolean})],u.prototype,"autoValidate",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"required",void 0),(0,a.Cg)([(0,s.MZ)({type:Number})],u.prototype,"format",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Number})],u.prototype,"days",void 0),(0,a.Cg)([(0,s.MZ)({type:Number})],u.prototype,"hours",void 0),(0,a.Cg)([(0,s.MZ)({type:Number})],u.prototype,"minutes",void 0),(0,a.Cg)([(0,s.MZ)({type:Number})],u.prototype,"seconds",void 0),(0,a.Cg)([(0,s.MZ)({type:Number})],u.prototype,"milliseconds",void 0),(0,a.Cg)([(0,s.MZ)({type:String,attribute:"day-label"})],u.prototype,"dayLabel",void 0),(0,a.Cg)([(0,s.MZ)({type:String,attribute:"hour-label"})],u.prototype,"hourLabel",void 0),(0,a.Cg)([(0,s.MZ)({type:String,attribute:"min-label"})],u.prototype,"minLabel",void 0),(0,a.Cg)([(0,s.MZ)({type:String,attribute:"sec-label"})],u.prototype,"secLabel",void 0),(0,a.Cg)([(0,s.MZ)({type:String,attribute:"ms-label"})],u.prototype,"millisecLabel",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"enable-second",type:Boolean})],u.prototype,"enableSecond",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"enable-millisecond",type:Boolean})],u.prototype,"enableMillisecond",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"enable-day",type:Boolean})],u.prototype,"enableDay",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"no-hours-limit",type:Boolean})],u.prototype,"noHoursLimit",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"amPm",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],u.prototype,"clearable",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"placeholder-labels",type:Boolean})],u.prototype,"placeholderLabels",void 0),(0,a.Cg)([(0,s.YG)("ha-input")],u.prototype,"_inputs",void 0),u=(0,a.Cg)([(0,s.EM)("ha-base-time-input")],u),t()}catch(e){t(e)}})},75064(e,t,i){var a=i(62826),o=i(5124),s=i(22441),r=i(2846);class l extends r.G{constructor(...e){super(...e),this.borderTop=!1}}l.styles=[...r.J,o.AH`:host{--md-list-item-one-line-container-height:48px;--md-list-item-two-line-container-height:64px}:host([border-top]) md-item{border-top:1px solid var(--divider-color)}[slot=start]{--state-icon-color:var(--secondary-text-color)}[slot=overline]{line-height:1.15rem;font-size:calc(var(--mdc-typography-subtitle1-font-size, 1rem) * .75);font-weight:var(--mdc-typography-subtitle1-font-weight,400);font-family:var( --mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family) );color:var(--mdc-select-label-ink-color,rgba(0,0,0,.6))}[slot=headline]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-m);white-space:nowrap}[slot=supporting-text]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-s);white-space:nowrap}::slotted(img),::slotted(state-badge){width:32px;height:32px}::slotted(.code){font-family:var(--ha-font-family-code);font-size:var(--ha-font-size-xs)}::slotted(.domain){font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);align-self:flex-end;max-width:30%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}`],(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"border-top"})],l.prototype,"borderTop",void 0),l=(0,a.Cg)([(0,s.EM)("ha-combo-box-item")],l)},19463(e,t,i){i.a(e,async function(e,t){try{i(74423);var a=i(62826),o=i(5124),s=i(22441),r=i(380),l=i(72487),n=i(1087),d=i(46927),h=(i(67094),i(91485)),p=e([h,l]);[h,l]=p.then?(await p)():p;const c="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",m=()=>Promise.all([i.e(80827),i.e(17481),i.e(90923)]).then(i.bind(i,64080)),u=(e,t)=>{(0,n.r)(e,"show-dialog",{dialogTag:"ha-dialog-date-picker",dialogImport:m,dialogParams:t})};class y extends o.WF{reportValidity(){return this._input?.reportValidity()??!0}render(){return o.qy`<ha-input .label="${this.label??""}" .hint="${this.helper??""}" .disabled="${this.disabled}" readonly="readonly" @click="${this._openDialog}" @keydown="${this._keyDown}" .value="${this.value?(0,l.zB)(new Date(`${this.value.split("T")[0]}T00:00:00`),{...this.locale,time_zone:d.Wj.local},{}):""}" .required="${this.required}"> <ha-svg-icon slot="end" .path="${c}"></ha-svg-icon> </ha-input>`}_openDialog(){this.disabled||u(this,{min:this.min||"1970-01-01",max:this.max,value:this.value,canClear:this.canClear,onChange:e=>this._valueChanged(e),locale:this.locale.language,firstWeekday:(0,r.P)(this.locale)})}_keyDown(e){if(["Space","Enter"].includes(e.code))return e.preventDefault(),e.stopPropagation(),void this._openDialog();this.canClear&&["Backspace","Delete"].includes(e.key)&&this._valueChanged(void 0)}_valueChanged(e){this.value!==e&&(this.value=e,(0,n.r)(this,"change"),(0,n.r)(this,"value-changed",{value:e}))}constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.canClear=!1}}y.styles=o.AH`:host{min-width:0px}ha-svg-icon{color:var(--secondary-text-color)}`,(0,a.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"locale",void 0),(0,a.Cg)([(0,s.MZ)()],y.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)()],y.prototype,"min",void 0),(0,a.Cg)([(0,s.MZ)()],y.prototype,"max",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"required",void 0),(0,a.Cg)([(0,s.MZ)()],y.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)()],y.prototype,"helper",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"can-clear",type:Boolean})],y.prototype,"canClear",void 0),(0,a.Cg)([(0,s.P)("ha-input",!0)],y.prototype,"_input",void 0),y=(0,a.Cg)([(0,s.EM)("ha-date-input")],y),t()}catch(e){t(e)}})},3449(e,t,i){var a=i(62826),o=i(5124),s=i(22441);class r extends o.WF{render(){return o.qy`<slot></slot>`}constructor(...e){super(...e),this.disabled=!1}}r.styles=o.AH`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var( --mdc-typography-caption-letter-spacing, .0333333333em );line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`,(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0),r=(0,a.Cg)([(0,s.EM)("ha-input-helper-text")],r)},2846(e,t,i){i.d(t,{G:()=>d,J:()=>n});var a=i(62826),o=i(58168),s=i(82553),r=i(5124),l=i(22441);i(54276);const n=[s.R,r.AH`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center);gap:var(--ha-md-list-item-gap,16px)}`];class d extends o.n{renderRipple(){return"text"===this.type?r.s6:r.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled&&"link"!==this.type}"></ha-ripple>`}}d.styles=n,d=(0,a.Cg)([(0,l.EM)("ha-md-list-item")],d)},88285(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),o=i(35211),s=i(5124),r=i(22441),l=i(63672),n=i(1087),d=i(22792),h=i(17894),p=(i(75064),i(47680),i(26300)),c=e([p]);p=(c.then?(await c)():c)[0];const m="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",u="M7,10L12,15L17,10H7Z";class y extends((0,h.c)(s.WF)){async focus(){await this.updateComplete,await(this.item?.focus())}render(){const e=!!this.value,t=!(!this.value||this.required||this.disabled||this.hideClearIcon),i=this.placeholder??this.label,a=this.label&&e?s.qy`<span slot="overline">${this.label}${this.required?" *":""}</span>`:s.s6,o=e?this.valueRenderer?this.valueRenderer(this.value??""):s.qy`<span slot="headline">${this.value}</span>`:i?s.qy`<span slot="headline" class="placeholder"> ${i}${this.required?" *":""} </span>`:s.s6;return s.qy` <ha-combo-box-item aria-label="${(0,l.J)(this.label||this.placeholder)}" .disabled="${this.disabled}" type="button" compact="compact"> ${this.image?s.qy`<img alt="${this.label??""}" slot="start" .src="${this.image}" crossorigin="anonymous" referrerpolicy="no-referrer">`:this.icon?s.qy`<ha-icon slot="start" .icon="${this.icon}"></ha-icon>`:s.qy`<slot name="start"></slot>`} ${a}${o} ${this.unknown?s.qy`<div slot="supporting-text" class="unknown"> ${this.unknownItemText||this._i18n?.localize("ui.components.combo-box.unknown_item")} </div>`:s.s6} ${t?s.qy` <ha-icon-button class="clear" slot="end" @click="${this._clear}" .path="${m}"></ha-icon-button> `:s.s6} <ha-svg-icon class="arrow" slot="end" .path="${u}"></ha-svg-icon> </ha-combo-box-item> `}_clear(e){e.stopPropagation(),(0,n.r)(this,"clear")}static get styles(){return[s.AH`ha-combo-box-item[disabled]{background-color:var(--ha-color-form-background-disabled);--md-list-item-disabled-opacity:0.5;opacity:.5;cursor:not-allowed}ha-combo-box-item{position:relative;background-color:var(--ha-color-form-background);border-radius:var(--ha-border-radius-sm);border-end-end-radius:0;border-end-start-radius:0;--md-list-item-one-line-container-height:56px;--md-list-item-two-line-container-height:56px;--md-list-item-top-space:0px;--md-list-item-bottom-space:0px;--md-list-item-leading-space:var(--ha-space-4);--md-list-item-trailing-space:var(--ha-space-2);--ha-md-list-item-gap:var(--ha-space-2);--md-focus-ring-width:0px;--md-focus-ring-duration:0s}ha-combo-box-item:after{display:block;content:"";position:absolute;pointer-events:none;bottom:0;left:0;right:0;height:1px;width:100%;background-color:var(--ha-color-border-neutral-loud);transform:height 180ms ease-in-out,background-color 180ms ease-in-out}ha-combo-box-item:focus:after{height:2px;background-color:var(--mdc-theme-primary)}:host([unknown]) ha-combo-box-item{background-color:var(--ha-color-fill-warning-quiet-resting)}:host([invalid]) ha-combo-box-item:after{height:2px;background-color:var(--mdc-theme-error,var(--error-color,#b00020))}.clear{margin:0 -8px;--ha-icon-button-size:32px;--ha-icon-button-padding-inline:var(--ha-space-1)}.arrow{--mdc-icon-size:20px;width:32px}.placeholder{color:var(--secondary-text-color)}:host([invalid]) .placeholder{color:var(--mdc-theme-error,var(--error-color,#b00020))}.unknown{color:var(--ha-color-on-warning-normal)}`]}constructor(...e){super(...e),this.invalid=!1}}(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],y.prototype,"invalid",void 0),(0,a.Cg)([(0,r.P)("ha-combo-box-item",!0)],y.prototype,"item",void 0),(0,a.Cg)([(0,r.wk)(),(0,o.Fg)({context:d.D5,subscribe:!0})],y.prototype,"_i18n",void 0),y=(0,a.Cg)([(0,r.EM)("ha-picker-field")],y),t()}catch(e){t(e)}})},606(e,t,i){i.a(e,async function(e,t){try{i(74423),i(18111),i(61701);var a=i(62826),o=i(5124),s=i(22441),r=i(63672),l=i(22786),n=i(1087),d=i(29823),h=(i(70947),i(3449),i(88285)),p=(i(67094),e([d,h]));[d,h]=p.then?(await p)():p;class c extends o.WF{render(){return this.disabled?o.qy`${this._renderField()}${this._renderHelper()}`:o.qy` <ha-dropdown placement="bottom" @wa-select="${this._handleSelect}" @wa-show="${this._handleShow}" @wa-hide="${this._handleHide}"> ${this._renderField()} ${this.options?this.options.map(e=>{const t=["string","number"].includes(typeof e);return o.qy` <ha-dropdown-item .value="${t?e:e.value}" .disabled="${!t&&(e.disabled??!1)}" .selected="${this.value===(t?e:e.value)}"> ${e.iconPath?o.qy`<ha-svg-icon slot="icon" .path="${e.iconPath}"></ha-svg-icon>`:o.s6} <div class="content"> ${t?e:e.label||e.value} ${e.secondary?o.qy`<div class="secondary">${e.secondary}</div>`:o.s6} </div> </ha-dropdown-item> `}):o.qy`<slot></slot>`} </ha-dropdown> ${this._renderHelper()} `}_renderField(){const e=this._getValueLabel(this.options,this.value);return o.qy` <ha-picker-field slot="trigger" type="button" class="${this._opened?"opened":""}" compact="compact" aria-label="${(0,r.J)(this.label)}" @clear="${this._clearValue}" .label="${this.label}" .value="${e}" .required="${this.required}" .disabled="${this.disabled}" .hideClearIcon="${!this.clearable||this.required||this.disabled||!String(this.value)}"> </ha-picker-field> `}_renderHelper(){return this.helper?o.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:o.s6}_handleSelect(e){e.stopPropagation();const t=e.detail.item.value;t!==this.value&&(0,n.r)(this,"selected",{value:t})}_clearValue(){!this.disabled&&this.value&&(0,n.r)(this,"selected",{value:void 0})}_handleShow(){this.style.setProperty("--select-menu-width",`${this._triggerField.offsetWidth}px`),this._opened=!0}_handleHide(){this._opened=!1}constructor(...e){super(...e),this.clearable=!1,this.required=!1,this.disabled=!1,this._opened=!1,this._getValueLabel=(0,l.A)((e,t)=>{const i=void 0!==t?String(t):void 0;if(!e||!i)return i;for(const t of e){const e=["string","number"].includes(typeof t);if(e&&t===i||!e&&String(t.value)===i)return e?t:t.label||t.value}return i})}}c.styles=o.AH`:host{position:relative}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}ha-dropdown-item .content{display:flex;gap:var(--ha-space-1);flex-direction:column}ha-dropdown-item .secondary{font-size:var(--ha-font-size-s);color:var(--ha-color-text-secondary)}ha-dropdown::part(menu){min-width:var(--select-menu-width)}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}`,(0,a.Cg)([(0,s.MZ)({type:Boolean})],c.prototype,"clearable",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"options",void 0),(0,a.Cg)([(0,s.MZ)()],c.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)()],c.prototype,"helper",void 0),(0,a.Cg)([(0,s.MZ)()],c.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],c.prototype,"required",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],c.prototype,"disabled",void 0),(0,a.Cg)([(0,s.wk)()],c.prototype,"_opened",void 0),(0,a.Cg)([(0,s.P)("ha-picker-field")],c.prototype,"_triggerField",void 0),c=(0,a.Cg)([(0,s.EM)("ha-select")],c),t()}catch(e){t(e)}})},50286(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),o=i(5124),s=i(22441),r=i(69543),l=i(1087),n=i(32656),d=e([n]);n=(d.then?(await d)():d)[0];class h extends o.WF{reportValidity(){return this._input?.reportValidity()??!0}render(){const e=(0,r.J)(this.locale);let t=NaN,i=NaN,a=NaN,s=0;if(this.value){const o=this.value?.split(":")||[];i=o[1]?Number(o[1]):0,a=o[2]?Number(o[2]):0,t=o[0]?Number(o[0]):0,s=t,s&&e&&s>12&&s<24&&(t=s-12),e&&0===s&&(t=12)}return o.qy` <ha-base-time-input .label="${this.label}" .hours="${t}" .minutes="${i}" .seconds="${a}" .format="${e?12:24}" .amPm="${e&&s>=12?"PM":"AM"}" .disabled="${this.disabled}" @value-changed="${this._timeChanged}" .enableSecond="${this.enableSecond}" .required="${this.required}" .clearable="${this.clearable&&void 0!==this.value}" .helper="${this.helper}" .placeholderLabels="${this.placeholderLabels}" .autoValidate="${this.autoValidate}" day-label="dd" hour-label="hh" min-label="mm" sec-label="ss" ms-label="ms"></ha-base-time-input> `}_timeChanged(e){e.stopPropagation();const t=e.detail.value,i=(0,r.J)(this.locale);let a,o=0;if(!(void 0===t||isNaN(t.hours)&&isNaN(t.minutes)&&isNaN(t.seconds))){let e=t.hours||0;t&&i&&(o=e>=12&&e<24?e-12:0===e?12:0,"PM"===t.amPm&&e<12&&(e+=12),"AM"===t.amPm&&12===e&&(e=0)),a=`${e.toString().padStart(2,"0")}:${t.minutes?t.minutes.toString().padStart(2,"0"):"00"}:${t.seconds?t.seconds.toString().padStart(2,"0"):"00"}`}o&&this.updateComplete.then(()=>{const e=this._input;e&&(e.hours=o)}),a!==this.value&&(this.value=a,(0,l.r)(this,"change"),(0,l.r)(this,"value-changed",{value:a}))}constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.autoValidate=!1,this.enableSecond=!1,this.placeholderLabels=!1}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"locale",void 0),(0,a.Cg)([(0,s.MZ)()],h.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)()],h.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)()],h.prototype,"helper",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],h.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],h.prototype,"required",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"auto-validate",type:Boolean})],h.prototype,"autoValidate",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"enable-second"})],h.prototype,"enableSecond",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],h.prototype,"clearable",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"placeholder-labels",type:Boolean})],h.prototype,"placeholderLabels",void 0),(0,a.Cg)([(0,s.P)("ha-base-time-input")],h.prototype,"_input",void 0),h=(0,a.Cg)([(0,s.EM)("ha-time-input")],h),t()}catch(e){t(e)}})},20311(e,t,i){i.d(t,{$:()=>a});const a=(e,t,i=void 0)=>{const a={entity_id:t,time:i};e.callService("time","set_value",a)}},17894(e,t,i){i.d(t,{c:()=>s});var a=i(62826),o=i(22441);const s=e=>{class t extends e{constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.unknown=!1,this.hideClearIcon=!1}}return(0,a.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"required",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"icon",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"image",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"label",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"placeholder",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"helper",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],t.prototype,"unknown",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"unknown-item-text"})],t.prototype,"unknownItemText",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-clear-icon",type:Boolean})],t.prototype,"hideClearIcon",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],t.prototype,"valueRenderer",void 0),t}},87550(e,t,i){i.a(e,async function(e,a){try{i.r(t);var o=i(62826),s=i(5124),r=i(22441),l=i(19463),n=i(50286),d=i(22675),h=i(20311),p=i(784),c=i(79757),m=i(85979),u=e([l,n,c,m]);[l,n,c,m]=u.then?(await u)():u;class y extends s.WF{setConfig(e){if(!e)throw new Error("Invalid configuration");this._config=e}shouldUpdate(e){return(0,p.LX)(this,e)}render(){if(!this._config||!this.hass)return s.s6;const e=this.hass.states[this._config.entity];if(!e)return s.qy` <hui-warning .hass="${this.hass}"> ${(0,m.j)(this.hass,this._config.entity)} </hui-warning> `;const t=e.state===d.Hh;return s.qy` <hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> <ha-time-input .value="${e.state===d.Hh||e.state===d.HV?void 0:e.state}" .locale="${this.hass.locale}" .disabled="${t}" @value-changed="${this._timeChanged}" @click="${this._stopEventPropagation}"></ha-time-input> </hui-generic-entity-row> `}_stopEventPropagation(e){e.stopPropagation()}_timeChanged(e){if(e.detail.value){const t=this.hass.states[this._config.entity];(0,h.$)(this.hass,t.entity_id,e.detail.value)}}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,o.Cg)([(0,r.wk)()],y.prototype,"_config",void 0),y=(0,o.Cg)([(0,r.EM)("hui-time-entity-row")],y),a()}catch(e){a(e)}})},82553(e,t,i){i.d(t,{R:()=>a});const a=i(5124).AH`:host{display:flex;-webkit-tap-highlight-color:transparent;--md-ripple-hover-color:var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity:var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color:var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity:var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape:8px}a,button,li{background:0 0;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:0;-webkit-tap-highlight-color:transparent;width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, .3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color,var(--md-sys-color-on-surface,#1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight,var(--md-sys-typescale-body-large-weight,var(--md-ref-typeface-weight-regular,400)));min-height:var(--md-list-item-one-line-container-height,56px);padding-top:var(--md-list-item-top-space,12px);padding-bottom:var(--md-list-item-bottom-space,12px);padding-inline-start:var(--md-list-item-leading-space,16px);padding-inline-end:var(--md-list-item-trailing-space,16px)}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height,72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, .875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight,var(--md-sys-typescale-body-medium-weight,var(--md-ref-typeface-weight-regular,400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, .6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight,var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color,var(--md-sys-color-on-surface-variant,#49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color,var(--md-sys-color-on-surface-variant,#49454f))}@media(forced-colors:active){.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}}`},58168(e,t,i){i.d(t,{n:()=>y});var a=i(62826),o=(i(75275),i(22441)),s=i(5124);class r extends s.WF{render(){return s.qy` <slot name="container"></slot> <slot class="non-text" name="start"></slot> <div class="text"> <slot name="overline" @slotchange="${this.handleTextSlotChange}"></slot> <slot class="default-slot" @slotchange="${this.handleTextSlotChange}"></slot> <slot name="headline" @slotchange="${this.handleTextSlotChange}"></slot> <slot name="supporting-text" @slotchange="${this.handleTextSlotChange}"></slot> </div> <slot class="non-text" name="trailing-supporting-text"></slot> <slot class="non-text" name="end"></slot> `}handleTextSlotChange(){let e=!1,t=0;for(const i of this.textSlots)if(l(i)&&(t+=1),t>1){e=!0;break}this.multiline=e}constructor(){super(...arguments),this.multiline=!1}}function l(e){for(const t of e.assignedNodes({flatten:!0})){const e=t.nodeType===Node.ELEMENT_NODE,i=t.nodeType===Node.TEXT_NODE&&t.textContent?.match(/\S/);if(e||i)return!0}return!1}(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],r.prototype,"multiline",void 0),(0,a.Cg)([(0,o.YG)(".text slot")],r.prototype,"textSlots",void 0);const n=s.AH`:host{color:var(--md-sys-color-on-surface,#1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight,var(--md-ref-typeface-weight-regular,400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, .6875rem);font-weight:var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, .875rem);font-weight:var(--md-sys-typescale-body-medium-weight,var(--md-ref-typeface-weight-regular,400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, .6875rem);font-weight:var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden}`;let d=class extends r{};d.styles=[n],d=(0,a.Cg)([(0,o.EM)("md-item")],d);i(71970);var h=i(6412),p=i(7872),c=i(1024),m=i(27525);const u=(0,c.n)(s.WF);class y extends u{get isDisabled(){return this.disabled&&"link"!==this.type}willUpdate(e){this.href&&(this.type="link"),super.willUpdate(e)}render(){return this.renderListItem(s.qy` <md-item> <div slot="container"> ${this.renderRipple()} ${this.renderFocusRing()} </div> <slot name="start" slot="start"></slot> <slot name="end" slot="end"></slot> ${this.renderBody()} </md-item> `)}renderListItem(e){const t="link"===this.type;let i;switch(this.type){case"link":i=p.eu`a`;break;case"button":i=p.eu`button`;break;default:i=p.eu`li`}const a="text"!==this.type,o=t&&this.target?this.target:s.s6;return p.qy` <${i} id="item" tabindex="${this.isDisabled||!a?-1:0}" ?disabled=${this.isDisabled} role="listitem" aria-selected=${this.ariaSelected||s.s6} aria-checked=${this.ariaChecked||s.s6} aria-expanded=${this.ariaExpanded||s.s6} aria-haspopup=${this.ariaHasPopup||s.s6} class="list-item ${(0,h.H)(this.getRenderClasses())}" href=${this.href||s.s6} target=${o} @focus=${this.onFocus} >${e}</${i}> `}renderRipple(){return"text"===this.type?s.s6:s.qy` <md-ripple part="ripple" for="item" ?disabled="${this.isDisabled}"></md-ripple>`}renderFocusRing(){return"text"===this.type?s.s6:s.qy` <md-focus-ring @visibility-changed="${this.onFocusRingVisibilityChanged}" part="focus-ring" for="item" inward></md-focus-ring>`}onFocusRingVisibilityChanged(e){}getRenderClasses(){return{disabled:this.isDisabled}}renderBody(){return s.qy` <slot></slot> <slot name="overline" slot="overline"></slot> <slot name="headline" slot="headline"></slot> <slot name="supporting-text" slot="supporting-text"></slot> <slot name="trailing-supporting-text" slot="trailing-supporting-text"></slot> `}onFocus(){-1===this.tabIndex&&this.dispatchEvent((0,m.cG)())}focus(){this.listItemRoot?.focus()}click(){this.listItemRoot?this.listItemRoot.click():super.click()}constructor(){super(...arguments),this.disabled=!1,this.type="text",this.isListItem=!0,this.href="",this.target=""}}y.shadowRootOptions={...s.WF.shadowRootOptions,delegatesFocus:!0},(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],y.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({reflect:!0})],y.prototype,"type",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"md-list-item",reflect:!0})],y.prototype,"isListItem",void 0),(0,a.Cg)([(0,o.MZ)()],y.prototype,"href",void 0),(0,a.Cg)([(0,o.MZ)()],y.prototype,"target",void 0),(0,a.Cg)([(0,o.P)(".list-item")],y.prototype,"listItemRoot",void 0)}};