"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[19366],{79077:function(e,t,o){o.a(e,async function(e,a){try{o.r(t);var i,s=o(28430),r=o(97058),n=o(57567),c=o(25979),l=o(12463),u=o(16472),p=(o(28706),o(74423),o(62062),o(26099),o(21699),o(15697)),h=o(57527),d=o(51209),_=o(90789),f=o(148),y=o(55682),v=o(62705),m=o(13446),b=e([y]);y=(b.then?(await b)():b)[0];var g=function(e){function t(){var e;(0,n.A)(this,t);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(e=(0,u.A)(this,t,[].concat(a)))._schema=(0,_.A)(function(e,t,o){var a=e?(0,v.V7)(e):[],i="hourly"===t;return[{name:"forecast_type",required:!0,disabled:a.length<=1,selector:{select:{mode:"dropdown",options:["daily","twice_daily","hourly"].map(function(e){return{value:e,label:o("ui.panel.lovelace.editor.features.types.precipitation-forecast.forecast_type_options.".concat(e)),disabled:!a.includes(e)}})}}},i?{name:"hours_to_show",default:m.S3,selector:{number:{min:1,mode:"box"}}}:{name:"days_to_show",default:m.qY,selector:{number:{min:1,mode:"box"}}},{name:"precipitation_type",required:!0,selector:{select:{mode:"dropdown",options:[{value:"amount",label:o("ui.panel.lovelace.editor.features.types.precipitation-forecast.precipitation_type_options.amount")},{value:"probability",label:o("ui.panel.lovelace.editor.features.types.precipitation-forecast.precipitation_type_options.probability")}]}}},{name:"color",selector:{ui_color:{default_color:"state",include_state:!0}}},{name:"show_labels",default:!0,selector:{boolean:{}}}]}),e._computeLabelCallback=function(t){switch(t.name){case"forecast_type":return e.hass.localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.forecast_type");case"days_to_show":case"hours_to_show":return e.hass.localize("ui.panel.lovelace.editor.card.generic.".concat(t.name));case"precipitation_type":return e.hass.localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.precipitation_type");case"color":return e.hass.localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.color");case"show_labels":return e.hass.localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.show_labels");default:return""}},e}return(0,l.A)(t,e),(0,c.A)(t,[{key:"setConfig",value:function(e){this._config=e}},{key:"render",value:function(){var e,t,o,a;if(!this.hass||!this._config)return h.s6;var n=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[this.context.entity_id]:void 0,c=(0,m.Sg)(n,this._config.forecast_type)||"daily",l="hourly"===c,u=(0,r.A)((0,r.A)({},this._config),{},{forecast_type:c,precipitation_type:null!==(t=this._config.precipitation_type)&&void 0!==t?t:"amount"},l?{hours_to_show:null!==(o=this._config.hours_to_show)&&void 0!==o?o:m.S3}:{days_to_show:null!==(a=this._config.days_to_show)&&void 0!==a?a:m.qY}),p=this._schema(n,c,this.hass.localize);return(0,h.qy)(i||(i=(0,s.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> "])),this.hass,u,p,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(e){(0,f.r)(this,"config-changed",{config:e.detail.value})}}])}(h.WF);(0,p.Cg)([(0,d.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,p.Cg)([(0,d.MZ)({attribute:!1})],g.prototype,"context",void 0),(0,p.Cg)([(0,d.wk)()],g.prototype,"_config",void 0),g=(0,p.Cg)([(0,d.EM)("hui-precipitation-forecast-card-feature-editor")],g),o.d(t,{HuiPrecipitationForecastCardFeatureEditor:function(){return g}}),a()}catch(w){a(w)}})}}]);
//# sourceMappingURL=19366.4621eb005032ddb1.js.map