export const __rspack_esm_id="17600";export const __rspack_esm_ids=["17600"];export const __webpack_modules__={12284(t,e,s){s.d(e,{BJ:()=>r,KY:()=>i,MG:()=>a,d_:()=>d,m4:()=>n});const i=(t,e,s)=>t.callService(e.split(".",1)[0],"set_value",{value:s,entity_id:e}),a=t=>t.callWS({type:"input_text/list"}),n=(t,e)=>t.callWS({type:"input_text/create",...e}),r=(t,e,s)=>t.callWS({type:"input_text/update",input_text_id:e,...s}),d=(t,e)=>t.callWS({type:"input_text/delete",input_text_id:e})},58723(t,e,s){s.a(t,async function(t,i){try{s.r(e);var a=s(62826),n=s(96196),r=s(97735),d=s(9899),h=s(70759),l=(s(75709),s(22675)),c=s(12284),o=s(784),u=s(79757),_=s(85979),p=t([h,u,_]);[h,u,_]=p.then?(await p)():p;class b extends n.WF{setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}connectedCallback(){super.connectedCallback(),this._updated&&!this._loaded&&this._initialLoad(),this._attachObserver()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect()}firstUpdated(){this._updated=!0,this.isConnected&&!this._loaded&&this._initialLoad(),this._attachObserver()}shouldUpdate(t){return(0,o.LX)(this,t)}render(){if(!this._config||!this.hass)return n.s6;const t=this.hass.states[this._config.entity];return t?n.qy` <hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> ${"slider"===t.attributes.mode?n.qy` <div class="flex"> <ha-slider labeled .disabled="${(0,l.g0)(t.state)}" .step="${Number(t.attributes.step)}" .min="${Number(t.attributes.min)}" .max="${Number(t.attributes.max)}" .value="${t.state}" @change="${this._selectedValueChanged}"></ha-slider> <span class="state"> ${this.hass.formatEntityState(t)} </span> </div> `:n.qy` <div class="flex state"> <ha-textfield .disabled="${(0,l.g0)(t.state)}" pattern="[0-9]+([\\.][0-9]+)?" .step="${Number(t.attributes.step)}" .min="${Number(t.attributes.min)}" .max="${Number(t.attributes.max)}" .value="${Number(t.state).toString()}" .suffix="${t.attributes.unit_of_measurement||""}" type="number" @change="${this._selectedValueChanged}"> </ha-textfield> </div> `} </hui-generic-entity-row> `:n.qy` <hui-warning .hass="${this.hass}"> ${(0,_.j)(this.hass,this._config.entity)} </hui-warning> `}async _initialLoad(){this._loaded=!0,await this.updateComplete,this._measureCard()}_measureCard(){if(!this.isConnected)return;const t=this.shadowRoot.querySelector(".state");t&&(t.hidden=this.clientWidth<=300)}async _attachObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver((0,d.s)(()=>this._measureCard(),250,!1))),this.isConnected&&this._resizeObserver.observe(this)}_selectedValueChanged(t){const e=this.hass.states[this._config.entity];t.target.value!==e.state&&(0,c.KY)(this.hass,e.entity_id,t.target.value)}}b.styles=n.AH`:host{display:block}.flex{display:flex;align-items:center;justify-content:flex-end;flex-grow:2}.state{min-width:45px;text-align:end}ha-textfield{text-align:end}ha-slider{width:100%;max-width:200px}`,(0,a.Cg)([(0,r.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,a.Cg)([(0,r.wk)()],b.prototype,"_config",void 0),b=(0,a.Cg)([(0,r.EM)("hui-input-number-entity-row")],b),i()}catch(t){i(t)}})}};
//# sourceMappingURL=17600.433ab369dddb327b.js.map