"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[28928],{40882:function(t,e,i){var n=function(t,e,i){return t.callService("text","set_value",{value:i},{entity_id:e})};i.d(e,{K:function(){return n}})},96803:function(t,e,i){i.a(t,async function(t,n){try{i.r(e);var a,s,r,h=i(28430),u=i(57567),o=i(25979),c=i(12463),l=i(16472),f=(i(16280),i(15697)),g=i(57527),y=i(51209),d=i(57406),v=i(96682),p=i(40882),_=i(72441),m=i(59366),w=i(58178),b=t([d,m,w]);[d,m,w]=b.then?(await b)():b;var k=function(t){function e(){return(0,u.A)(this,e),(0,l.A)(this,e,arguments)}return(0,c.A)(e,t),(0,o.A)(e,[{key:"setConfig",value:function(t){if(!t)throw new Error("Invalid configuration");this._config=t}},{key:"shouldUpdate",value:function(t){return(0,_.LX)(this,t)}},{key:"render",value:function(){if(!this._config||!this.hass)return g.s6;var t=this.hass.states[this._config.entity];if(!t)return(0,g.qy)(a||(a=(0,h.A)([" <hui-warning .hass=","> "," </hui-warning> "])),this.hass,(0,w.j)(this.hass,this._config.entity));var e=this.hass.formatEntityName(t,this._config.name);return(0,g.qy)(s||(s=(0,h.A)([" <hui-generic-entity-row .hass="," .config="," hide-name> <ha-input .label="," .disabled="," .value="," .minlength="," .maxlength="," .autoValidate="," .pattern="," .type="," @change="," .placeholder=","></ha-input> </hui-generic-entity-row> "])),this.hass,this._config,e,t.state===v.Hh,t.state,t.attributes.min,t.attributes.max,t.attributes.pattern,t.attributes.pattern,t.attributes.mode,this._valueChanged,this.hass.localize("ui.card.text.empty_value"))}},{key:"_valueChanged",value:function(t){var e,i=this.hass.states[this._config.entity],n=t.target,a=null!==(e=n.value)&&void 0!==e?e:"";!a||a!==v.Hh&&a!==v.HV?(a!==i.state&&(0,p.K)(this.hass,i.entity_id,a),n.blur()):n.value=i.state}}])}(g.WF);k.styles=(0,g.AH)(r||(r=(0,h.A)(["hui-generic-entity-row{align-items:center;display:flex}ha-input{width:100%}"]))),(0,f.Cg)([(0,y.MZ)({attribute:!1})],k.prototype,"hass",void 0),(0,f.Cg)([(0,y.wk)()],k.prototype,"_config",void 0),k=(0,f.Cg)([(0,y.EM)("hui-text-entity-row")],k),n()}catch(A){n(A)}})}}]);
//# sourceMappingURL=28928.66eb63232294fe62.js.map