"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["26846"],{21869:function(t,i,n){n.a(t,async function(t,s){try{n.r(i);var e,a,r,o=n(61397),h=n(50264),u=n(72153),c=n(44734),f=n(43080),l=n(69683),g=n(6454),p=(n(16280),n(40445)),y=n(96196),d=n(77845),_=n(18350),v=n(22675),b=n(99936),w=n(784),k=n(79757),m=n(85979),A=t([_,k]);[_,k]=A.then?(await A)():A;var C=function(t){function i(){return(0,c.A)(this,i),(0,l.A)(this,i,arguments)}return(0,g.A)(i,t),(0,f.A)(i,[{key:"setConfig",value:function(t){if(!t)throw new Error("Invalid configuration");this._config=t}},{key:"shouldUpdate",value:function(t){return(0,w.LX)(this,t)}},{key:"render",value:function(){if(!this._config||!this.hass)return y.s6;var t=this.hass.states[this._config.entity];return t?(0,y.qy)(a||(a=(0,u.A)([' <hui-generic-entity-row .hass="','" .config="','"> <ha-button appearance="plain" size="small" @click="','" .disabled="','"> '," </ha-button> </hui-generic-entity-row> "])),this.hass,this._config,this._pressButton,t.state===v.Hh,this.hass.localize("ui.card.button.press")):(0,y.qy)(e||(e=(0,u.A)([' <hui-warning .hass="','"> '," </hui-warning> "])),this.hass,(0,m.j)(this.hass,this._config.entity))}},{key:"_pressButton",value:(n=(0,h.A)((0,o.A)().m(function t(i){var n,s;return(0,o.A)().w(function(t){for(;;)switch(t.n){case 0:if(i.stopPropagation(),s=!(null!==(n=this._config)&&void 0!==n&&n.confirmation)){t.n=2;break}return t.n=1,(0,b.f)(this,this.hass,this._config.confirmation,this.hass.localize("ui.card.button.press"));case 1:s=t.v;case 2:if(!s){t.n=3;break}this.hass.callService("button","press",{entity_id:this._config.entity});case 3:return t.a(2)}},t,this)})),function(t){return n.apply(this,arguments)})}]);var n}(y.WF);C.styles=(0,y.AH)(r||(r=(0,u.A)(["ha-button:last-child{margin-right:-.57em;margin-inline-end:-.57em;margin-inline-start:initial}"]))),(0,p.Cg)([(0,d.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,p.Cg)([(0,d.wk)()],C.prototype,"_config",void 0),C=(0,p.Cg)([(0,d.EM)("hui-button-entity-row")],C),s()}catch(z){s(z)}})}}]);
//# sourceMappingURL=26846.45939e5964b6f7af.js.map