"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[23532],{47412:function(t,i,n){n.a(t,async function(t,s){try{n.r(i);var a,e,r,o=n(36854),h=n(98117),u=n(28430),c=n(57567),f=n(25979),l=n(12463),g=n(16472),p=(n(16280),n(26099),n(3362),n(15697)),y=n(57527),_=n(51209),d=n(98747),v=n(96682),k=n(52699),b=n(72441),w=n(59366),A=n(58178),m=t([d,w,A]);[d,w,A]=m.then?(await m)():m;var C=function(t){function i(){return(0,c.A)(this,i),(0,g.A)(this,i,arguments)}return(0,l.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,b.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)(e||(e=(0,u.A)([" <hui-generic-entity-row .hass="," .config=",'> <ha-button appearance="plain" size="s" @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)(a||(a=(0,u.A)([" <hui-warning .hass=","> "," </hui-warning> "])),this.hass,(0,A.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,k.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("input_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-start:initial;margin-inline-end:-.57em}"]))),(0,p.Cg)([(0,_.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,p.Cg)([(0,_.wk)()],C.prototype,"_config",void 0),C=(0,p.Cg)([(0,_.EM)("hui-input-button-entity-row")],C),s()}catch(z){s(z)}})}}]);
//# sourceMappingURL=23532.b7d6fc4a771c8481.js.map