"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[59858],{91401:function(e,t,a){a.a(e,async function(e,o){try{a.r(t);var i,n,c=a(28430),l=a(97058),s=a(57567),r=a(25979),d=a(12463),_=a(16472),u=(a(28706),a(62062),a(18111),a(61701),a(26099),a(16034),a(15697)),h=a(57527),p=a(51209),m=a(90789),f=a(49588),v=a(36431),y=a(98295),g=a(148),A=a(88457),C=a(55682),b=a(30013),k=a(13263),E=a(49541),z=a(41107),T=e([A,C,v]);[A,C,v]=T.then?(await T)():T;var q=[v.ITEM_TAP_ACTION_EDIT,v.ITEM_TAP_ACTION_TOGGLE],M=(0,f.kp)(b.H,(0,f.Ik)({title:(0,f.lq)((0,f.Yj)()),theme:(0,f.lq)((0,f.Yj)()),entity:(0,f.lq)((0,f.Yj)()),hide_completed:(0,f.lq)((0,f.zM)()),hide_create:(0,f.lq)((0,f.zM)()),hide_section_headers:(0,f.lq)((0,f.zM)()),display_order:(0,f.lq)((0,f.Yj)()),item_tap_action:(0,f.lq)((0,f.Yj)()),due_date_period:(0,f.lq)((0,f.Ik)())})),I=function(e){function t(){var e;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=(0,_.A)(this,t,[].concat(o)))._schema=(0,m.A)(function(e,t){return[{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(E.EE).map(function(a){return{value:a,label:e("ui.panel.lovelace.editor.card.todo-list.sort_modes.".concat(a===E.EE.NONE&&t?"manual":a))}})}}},{name:"due_date_period",selector:{period:{options:["today","tomorrow","this_week","next_week","this_month","next_month","next_7d","next_30d","none"]}}},{name:"interactions",type:"expandable",flatten:!0,iconPath:"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",schema:[{name:"item_tap_action",required:!0,selector:{select:{mode:"dropdown",options:Object.values(q).map(function(t){return{value:t,label:e("ui.panel.lovelace.editor.card.todo-list.actions.".concat(t))}})}}}]}]}),e._data=(0,m.A)(function(e){return(0,l.A)({display_order:"none",item_tap_action:"edit"},e)}),e._computeLabelCallback=function(t){switch(t.name){case"theme":return"".concat(e.hass.localize("ui.panel.lovelace.editor.card.generic.theme")," (").concat(e.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":case"due_date_period":return e.hass.localize("ui.panel.lovelace.editor.card.todo-list.".concat(t.name));default:return e.hass.localize("ui.panel.lovelace.editor.card.generic.".concat(t.name))}},e._computeHelperCallback=function(t){switch(t.name){case"hide_section_headers":case"due_date_period":return e.hass.localize("ui.panel.lovelace.editor.card.todo-list.".concat(t.name,"_helper"));default:return}},e}return(0,d.A)(t,e),(0,r.A)(t,[{key:"setConfig",value:function(e){(0,f.vA)(e,M),this._config=e}},{key:"render",value:function(){return this.hass&&this._config?(0,h.qy)(i||(i=(0,c.A)([" "," <ha-form .hass="," .data="," .schema="," .computeLabel="," .computeHelper="," @value-changed=","></ha-form> "])),(0,y.x)(this.hass.config,"todo")?"":(0,h.qy)(n||(n=(0,c.A)([' <ha-alert alert-type="error"> '," </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(E.Ed.MOVE_TODO_ITEM)),this._computeLabelCallback,this._computeHelperCallback,this._valueChanged):h.s6}},{key:"_valueChanged",value:function(e){var t=(0,l.A)({},e.detail.value);t.item_tap_action===v.ITEM_TAP_ACTION_EDIT&&delete t.item_tap_action,(0,g.r)(this,"config-changed",{config:t})}},{key:"_todoListSupportsFeature",value:function(e){var t,a,o=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!!o&&(0,z.$)(o,e)}}],[{key:"styles",get:function(){return k.U}}])}(h.WF);(0,u.Cg)([(0,p.MZ)({attribute:!1})],I.prototype,"hass",void 0),(0,u.Cg)([(0,p.wk)()],I.prototype,"_config",void 0),I=(0,u.Cg)([(0,p.EM)("hui-todo-list-card-editor")],I),a.d(t,{HuiTodoListEditor:function(){return I}}),o()}catch(L){o(L)}})},30013:function(e,t,a){var o=a(49588),i=(0,o.Ik)({type:(0,o.Yj)(),view_layout:(0,o.bz)(),layout_options:(0,o.bz)(),grid_options:(0,o.bz)(),visibility:(0,o.bz)(),disabled:(0,o.lq)((0,o.zM)())});a.d(t,{H:function(){return i}})}}]);
//# sourceMappingURL=59858.91e804221e2b092b.js.map