"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["26846"],{21869:function(t,i,s){s.a(t,async function(t,n){try{s.r(i);s(16280),s(3362);var a=s(40445),e=s(96196),h=s(77845),o=s(18350),r=s(22675),c=s(99936),u=s(784),l=s(79757),g=s(85979),f=t([o,l,g]);[o,l,g]=f.then?(await f)():f;let p,d,_,y=t=>t;class w extends e.WF{setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}shouldUpdate(t){return(0,u.LX)(this,t)}render(){if(!this._config||!this.hass)return e.s6;const t=this.hass.states[this._config.entity];return t?(0,e.qy)(d||(d=y` <hui-generic-entity-row .hass="${0}" .config="${0}"> <ha-button appearance="plain" size="small" @click="${0}" .disabled="${0}"> ${0} </ha-button> </hui-generic-entity-row> `),this.hass,this._config,this._pressButton,t.state===r.Hh,this.hass.localize("ui.card.button.press")):(0,e.qy)(p||(p=y` <hui-warning .hass="${0}"> ${0} </hui-warning> `),this.hass,(0,g.j)(this.hass,this._config.entity))}async _pressButton(t){var i;t.stopPropagation(),null!==(i=this._config)&&void 0!==i&&i.confirmation&&!(await(0,c.f)(this,this.hass,this._config.confirmation,this.hass.localize("ui.card.button.press")))||this.hass.callService("button","press",{entity_id:this._config.entity})}}w.styles=(0,e.AH)(_||(_=y`ha-button:last-child{margin-right:-.57em;margin-inline-end:-.57em;margin-inline-start:initial}`)),(0,a.Cg)([(0,h.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,a.Cg)([(0,h.wk)()],w.prototype,"_config",void 0),w=(0,a.Cg)([(0,h.EM)("hui-button-entity-row")],w),n()}catch(p){n(p)}})}}]);
//# sourceMappingURL=26846.1e9710a6dd56222e.js.map