"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[66766],{92957:function(e,t,a){a.a(e,async function(e,i){try{a.r(t);var n,c,o=a(97058),r=a(28430),l=a(57567),s=a(25979),u=a(12463),v=a(16472),h=(a(28706),a(15697)),d=a(57527),g=a(51209),f=a(90789),_=a(49588),m=a(148),p=a(55682),b=a(47872),y=e([p,b]);[p,b]=y.then?(await y)():y;var A=(0,_.Ik)({type:(0,_.vP)(["service-button","action-button"]),style:(0,_.lq)((0,_.bz)()),title:(0,_.lq)((0,_.Yj)()),action:(0,_.lq)((0,_.Yj)()),service:(0,_.lq)((0,_.Yj)()),service_data:(0,_.lq)((0,_.bz)()),data:(0,_.lq)((0,_.bz)()),target:(0,_.lq)((0,_.bz)())}),k=[{name:"title",required:!0,selector:{text:{}}},{name:"style",selector:{object:{}}}],C=function(e){function t(){var e;(0,l.A)(this,t);for(var a=arguments.length,i=new Array(a),n=0;n<a;n++)i[n]=arguments[n];return(e=(0,v.A)(this,t,[].concat(i)))._serviceData=(0,f.A)(function(e){var t,a;return{action:null!==(t=null==e?void 0:e.action)&&void 0!==t?t:null==e?void 0:e.service,data:null!==(a=null==e?void 0:e.data)&&void 0!==a?a:null==e?void 0:e.service_data,target:null==e?void 0:e.target}}),e._computeLabelCallback=function(t){return e.hass.localize("ui.panel.lovelace.editor.card.generic.".concat(t.name))||e.hass.localize("ui.panel.lovelace.editor.elements.".concat(t.name))||t.name},e}return(0,u.A)(t,e),(0,s.A)(t,[{key:"setConfig",value:function(e){(0,_.vA)(e,A),this._config=e}},{key:"render",value:function(){return this.hass&&this._config?(0,d.qy)(n||(n=(0,r.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> <ha-service-control .hass="," .value="," narrow @value-changed=","></ha-service-control> "])),this.hass,this._config,k,this._computeLabelCallback,this._valueChanged,this.hass,this._serviceData(this._config),this._serviceDataChanged):d.s6}},{key:"_valueChanged",value:function(e){(0,m.r)(this,"config-changed",{config:(0,o.A)((0,o.A)({},this._config),e.detail.value)})}},{key:"_serviceDataChanged",value:function(e){var t=(0,o.A)((0,o.A)({},this._config),{},{action:e.detail.value.action,data:e.detail.value.data,target:e.detail.value.target});"service"in t&&delete t.service,"service_data"in t&&delete t.service_data,(0,m.r)(this,"config-changed",{config:t})}}])}(d.WF);C.styles=(0,d.AH)(c||(c=(0,r.A)(["ha-service-control{--service-control-padding:0;margin-top:16px;display:block}"]))),(0,h.Cg)([(0,g.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,h.Cg)([(0,g.wk)()],C.prototype,"_config",void 0),C=(0,h.Cg)([(0,g.EM)("hui-service-button-element-editor")],C),a.d(t,{HuiServiceButtonElementEditor:function(){return C}}),i()}catch(q){i(q)}})}}]);
//# sourceMappingURL=66766.d5416fb581cd73d8.js.map