"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["90742"],{4757:function(e,t,a){a.a(e,async function(e,s){try{a.r(t),a.d(t,{HuiMarkdownCardEditor:function(){return p}});a(27495),a(25440),a(62953);var n=a(40445),o=a(96196),i=a(77845),l=a(22786),c=a(63533),r=a(1087),d=a(52763),h=a(84698),u=e([d]);d=(u.then?(await u)():u)[0];let _,m=e=>e;const g=(0,c.kp)(h.H,(0,c.Ik)({text_only:(0,c.lq)((0,c.zM)()),title:(0,c.lq)((0,c.Yj)()),content:(0,c.Yj)()}));class p 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.text_only?"text-only":"card"}),t=this._schema(this.hass.localize,this._config.text_only||!1);return(0,o.qy)(_||(_=m` <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);"text-only"===t.style?t.text_only=!0:delete t.text_only,delete t.style,(0,r.r)(this,"config-changed",{config:t})}constructor(...e){super(...e),this._schema=(0,l.A)((e,t)=>[{name:"style",required:!0,selector:{select:{mode:"box",options:["card","text-only"].map(t=>({label:e(`ui.panel.lovelace.editor.card.markdown.style_options.${t}`),image:{src:`/static/images/form/markdown_${t.replace("-","_")}.svg`,src_dark:`/static/images/form/markdown_${t.replace("-","_")}_dark.svg`,flip_rtl:!0},value:t}))}}},...t?[]:[{name:"title",selector:{text:{}}}],{name:"content",required:!0,selector:{template:{preview:!1}}}]),this._computeLabelCallback=e=>{switch(e.name){case"style":case"content":return this.hass.localize(`ui.panel.lovelace.editor.card.markdown.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,n.Cg)([(0,i.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,n.Cg)([(0,i.wk)()],p.prototype,"_config",void 0),p=(0,n.Cg)([(0,i.EM)("hui-markdown-card-editor")],p),s()}catch(_){s(_)}})},84698:function(e,t,a){a.d(t,{H:function(){return n}});var s=a(63533);const n=(0,s.Ik)({type:(0,s.Yj)(),view_layout:(0,s.bz)(),layout_options:(0,s.bz)(),grid_options:(0,s.bz)(),visibility:(0,s.bz)(),disabled:(0,s.lq)((0,s.zM)())})}}]);
//# sourceMappingURL=90742.048497589b0278f4.js.map