"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["90143"],{24770:function(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HuiTodoListEditor:function(){return A}});a(18111),a(61701),a(62953);var o=a(40445),s=a(96196),l=a(77845),n=a(22786),c=a(63533),r=a(62134),d=a(36312),h=a(1087),_=a(38962),p=a(52763),u=a(84698),m=a(7382),v=a(65590),b=a(82286),g=e([_,p,r]);[_,p,r]=g.then?(await g)():g;let f,C,y=e=>e;const E="M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5Z",$=[r.ITEM_TAP_ACTION_EDIT,r.ITEM_TAP_ACTION_TOGGLE],z=(0,c.kp)(u.H,(0,c.Ik)({title:(0,c.lq)((0,c.Yj)()),theme:(0,c.lq)((0,c.Yj)()),entity:(0,c.lq)((0,c.Yj)()),hide_completed:(0,c.lq)((0,c.zM)()),hide_create:(0,c.lq)((0,c.zM)()),hide_section_headers:(0,c.lq)((0,c.zM)()),display_order:(0,c.lq)((0,c.Yj)()),item_tap_action:(0,c.lq)((0,c.Yj)())}));class A extends s.WF{setConfig(e){(0,c.vA)(e,z),this._config=e}render(){return this.hass&&this._config?(0,s.qy)(f||(f=y` ${0} <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form> `),(0,d.x)(this.hass,"todo")?"":(0,s.qy)(C||(C=y` <ha-alert alert-type="error"> ${0} </ha-alert> `),this.hass.localize("ui.panel.lovelace.editor.card.shopping-list.integration_not_loaded")),this.hass,this._data(this._config),this._schema(this.hass.localize,this._todoListSupportsFeature(v.Ed.MOVE_TODO_ITEM)),this._computeLabelCallback,this._computeHelperCallback,this._valueChanged):s.s6}_valueChanged(e){const t=Object.assign({},e.detail.value);t.item_tap_action===r.ITEM_TAP_ACTION_EDIT&&delete t.item_tap_action,(0,h.r)(this,"config-changed",{config:t})}_todoListSupportsFeature(e){var t,a;const i=null!==(t=this._config)&&void 0!==t&&t.entity?this.hass.states[null===(a=this._config)||void 0===a?void 0:a.entity]:void 0;return!!i&&(0,b.$)(i,e)}static get styles(){return m.U}constructor(...e){super(...e),this._schema=(0,n.A)((e,t)=>[{name:"title",selector:{text:{}}},{name:"entity",selector:{entity:{domain:"todo"}}},{name:"theme",selector:{theme:{}}},{name:"hide_completed",selector:{boolean:{}}},{name:"hide_create",selector:{boolean:{}}},{name:"hide_section_headers",selector:{boolean:{}}},{name:"display_order",selector:{select:{options:Object.values(v.EE).map(a=>({value:a,label:e(`ui.panel.lovelace.editor.card.todo-list.sort_modes.${a===v.EE.NONE&&t?"manual":a}`)}))}}},{name:"interactions",type:"expandable",flatten:!0,iconPath:E,schema:[{name:"item_tap_action",required:!0,selector:{select:{mode:"dropdown",options:Object.values($).map(t=>({value:t,label:e(`ui.panel.lovelace.editor.card.todo-list.actions.${t}`)}))}}}]}]),this._data=(0,n.A)(e=>Object.assign({display_order:"none",item_tap_action:"edit"},e)),this._computeLabelCallback=e=>{switch(e.name){case"theme":return`${this.hass.localize("ui.panel.lovelace.editor.card.generic.theme")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})`;case"hide_completed":case"hide_create":case"hide_section_headers":case"display_order":case"item_tap_action":return this.hass.localize(`ui.panel.lovelace.editor.card.todo-list.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}},this._computeHelperCallback=e=>{if("hide_section_headers"===e.name)return this.hass.localize(`ui.panel.lovelace.editor.card.todo-list.${e.name}_helper`)}}}(0,o.Cg)([(0,l.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,o.Cg)([(0,l.wk)()],A.prototype,"_config",void 0),A=(0,o.Cg)([(0,l.EM)("hui-todo-list-card-editor")],A),i()}catch(f){i(f)}})},84698:function(e,t,a){a.d(t,{H:function(){return o}});var i=a(63533);const o=(0,i.Ik)({type:(0,i.Yj)(),view_layout:(0,i.bz)(),layout_options:(0,i.bz)(),grid_options:(0,i.bz)(),visibility:(0,i.bz)(),disabled:(0,i.lq)((0,i.zM)())})}}]);
//# sourceMappingURL=90143.a449f950ce1cf750.js.map