"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["15718"],{8293:function(e,t,a){a.a(e,async function(e,n){try{a.r(t),a.d(t,{HuiEmptyStateCardEditor:function(){return v}});a(62953);var l=a(40445),o=a(96196),s=a(77845),i=a(22786),c=a(63533),r=a(1087),u=a(52763),d=a(91408),h=a(84698),m=e([u]);u=(m.then?(await m)():m)[0];let p,_=e=>e;const b=(0,c.Ik)({text:(0,c.Yj)(),icon:(0,c.lq)((0,c.Yj)()),appearance:(0,c.lq)((0,c.vP)(["accent","filled","outlined","plain"])),variant:(0,c.lq)((0,c.vP)(["brand","neutral","success","warning","danger"])),tap_action:d.kn}),g=(0,c.kp)(h.H,(0,c.Ik)({content_only:(0,c.lq)((0,c.zM)()),icon:(0,c.lq)((0,c.Yj)()),icon_color:(0,c.lq)((0,c.Yj)()),title:(0,c.lq)((0,c.Yj)()),content:(0,c.lq)((0,c.Yj)()),buttons:(0,c.lq)((0,c.YO)(b))}));class v extends o.WF{setConfig(e){(0,c.vA)(e,g),this._config=e}render(){if(!this.hass||!this._config)return o.s6;const e=Object.assign(Object.assign({},this._config),{},{style:this._config.content_only?"content-only":"card"}),t=this._schema(this.hass.localize);return(0,o.qy)(p||(p=_` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> `),this.hass,e,t,this._computeLabelCallback,this._valueChanged)}_valueChanged(e){const t=Object.assign({},e.detail.value);"content-only"===t.style?t.content_only=!0:delete t.content_only,delete t.style,(0,r.r)(this,"config-changed",{config:t})}constructor(...e){super(...e),this._schema=(0,i.A)(e=>[{name:"style",selector:{select:{mode:"box",options:[{value:"card",image:"card"},{value:"content-only",image:"text_only"}].map(t=>({label:e(`ui.panel.lovelace.editor.card.empty_state.style_options.${t.value}`),image:{src:`/static/images/form/markdown_${t.image}.svg`,src_dark:`/static/images/form/markdown_${t.image}_dark.svg`,flip_rtl:!0},value:t.value}))}}},{name:"icon",selector:{icon:{}}},{name:"icon_color",selector:{ui_color:{}}},{name:"title",selector:{text:{}}},{name:"content",selector:{text:{multiline:!0}}},{name:"buttons",selector:{object:{multiple:!0,label_field:"text",fields:{text:{selector:{text:{}},required:!0},icon:{selector:{icon:{}}},appearance:{selector:{select:{options:[{value:"accent",label:"Accent"},{value:"filled",label:"Filled"},{value:"outlined",label:"Outlined"},{value:"plain",label:"Plain"}],mode:"dropdown"}}},variant:{selector:{select:{options:[{value:"brand",label:"Brand"},{value:"neutral",label:"Neutral"},{value:"success",label:"Success"},{value:"warning",label:"Warning"},{value:"danger",label:"Danger"}],mode:"dropdown"}}},tap_action:{selector:{ui_action:{default_action:"none"}},required:!0}}}}}]),this._computeLabelCallback=e=>{switch(e.name){case"style":case"content":case"buttons":return this.hass.localize(`ui.panel.lovelace.editor.card.empty_state.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,l.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,l.Cg)([(0,s.wk)()],v.prototype,"_config",void 0),v=(0,l.Cg)([(0,s.EM)("hui-empty-state-card-editor")],v),n()}catch(p){n(p)}})},84698:function(e,t,a){a.d(t,{H:function(){return l}});var n=a(63533);const l=(0,n.Ik)({type:(0,n.Yj)(),view_layout:(0,n.bz)(),layout_options:(0,n.bz)(),grid_options:(0,n.bz)(),visibility:(0,n.bz)(),disabled:(0,n.lq)((0,n.zM)())})}}]);
//# sourceMappingURL=15718.03aafe6beaa99391.js.map