export const __rspack_esm_id=19366;export const __rspack_esm_ids=[19366];export const __webpack_modules__={79077(e,t,o){o.a(e,async function(e,a){try{o.r(t);o(74423);var i=o(15697),s=o(57527),r=o(79224),c=o(90789),l=o(148),n=o(55682),p=o(62705),_=o(13446),h=e([n]);n=(h.then?(await h)():h)[0];class u extends s.WF{setConfig(e){this._config=e}render(){if(!this.hass||!this._config)return s.s6;const e=this.context?.entity_id?this.hass.states[this.context.entity_id]:void 0,t=(0,_.Sg)(e,this._config.forecast_type)||"daily",o="hourly"===t,a={...this._config,forecast_type:t,precipitation_type:this._config.precipitation_type??"amount",...o?{hours_to_show:this._config.hours_to_show??24}:{days_to_show:this._config.days_to_show??7}},i=this._schema(e,t,this.hass.localize);return s.qy` <ha-form .hass=${this.hass} .data=${a} .schema=${i} .computeLabel=${this._computeLabelCallback} @value-changed=${this._valueChanged}></ha-form> `}_valueChanged(e){(0,l.r)(this,"config-changed",{config:e.detail.value})}constructor(...e){super(...e),this._schema=(0,c.A)((e,t,o)=>{const a=e?(0,p.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(e=>({value:e,label:o(`ui.panel.lovelace.editor.features.types.precipitation-forecast.forecast_type_options.${e}`),disabled:!a.includes(e)}))}}},i?{name:"hours_to_show",default:24,selector:{number:{min:1,mode:"box"}}}:{name:"days_to_show",default:7,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:{}}}]}),this._computeLabelCallback=e=>{switch(e.name){case"forecast_type":return this.hass.localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.forecast_type");case"days_to_show":case"hours_to_show":return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`);case"precipitation_type":return this.hass.localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.precipitation_type");case"color":return this.hass.localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.color");case"show_labels":return this.hass.localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.show_labels");default:return""}}}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"context",void 0),(0,i.Cg)([(0,r.wk)()],u.prototype,"_config",void 0),u=(0,i.Cg)([(0,r.EM)("hui-precipitation-forecast-card-feature-editor")],u),o.d(t,{HuiPrecipitationForecastCardFeatureEditor:()=>u}),a()}catch(e){a(e)}})}};
//# sourceMappingURL=19366.f36c1116be9d67a9.js.map