"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[8511],{28383:function(t,e,n){var i=n(97058),a=function(t,e,n){return t.callService(e.split(".",1)[0],"set_value",{value:n,entity_id:e})},s=function(t){return t.callWS({type:"input_text/list"})},r=function(t,e){return t.callWS((0,i.A)({type:"input_text/create"},e))},u=function(t,e,n){return t.callWS((0,i.A)({type:"input_text/update",input_text_id:e},n))},h=function(t,e){return t.callWS({type:"input_text/delete",input_text_id:e})};n.d(e,{BJ:function(){return u},KY:function(){return a},MG:function(){return s},d_:function(){return h},m4:function(){return r}})},62562:function(t,e,n){n.a(t,async function(t,i){try{n.r(e);var a,s,r,u=n(28430),h=n(57567),o=n(25979),c=n(12463),l=n(16472),f=(n(16280),n(15697)),p=n(57527),d=n(51209),y=n(57406),_=n(96682),g=n(28383),v=n(72441),m=n(59366),w=n(58178),x=t([y,m,w]);[y,m,w]=x.then?(await x)():x;var A=function(t){function e(){return(0,h.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,v.LX)(this,t)}},{key:"render",value:function(){if(!this._config||!this.hass)return p.s6;var t=this.hass.states[this._config.entity];if(!t)return(0,p.qy)(a||(a=(0,u.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,p.qy)(s||(s=(0,u.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===_.Hh,t.state,t.attributes.min,t.attributes.max,t.attributes.pattern,t.attributes.pattern,t.attributes.mode,this._selectedValueChanged,this.hass.localize("ui.card.text.empty_value"))}},{key:"_selectedValueChanged",value:function(t){var e,n=this.hass.states[this._config.entity],i=t.target,a=null!==(e=i.value)&&void 0!==e?e:"";!a||a!==_.Hh&&a!==_.HV?(a!==n.state&&(0,g.KY)(this.hass,n.entity_id,a),i.blur()):i.value=n.state}}])}(p.WF);A.styles=(0,p.AH)(r||(r=(0,u.A)(["hui-generic-entity-row{align-items:center;display:flex}ha-input{width:100%}"]))),(0,f.Cg)([(0,d.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,f.Cg)([(0,d.wk)()],A.prototype,"_config",void 0),A=(0,f.Cg)([(0,d.EM)("hui-input-text-entity-row")],A),i()}catch(b){i(b)}})}}]);
//# sourceMappingURL=8511.96126f8e3ad62f02.js.map