window.VT=window.VT||{},VT.TodoCustomList=function(a){function b(){a.dispatchEvent(new CustomEvent("saveList",{detail:{list:f.list,title:j.value.trim()},bubbles:!0})),d({editing:!1})}function c(){h=!1,d({editing:!1})}function d(b){Object.assign(f,b),i.innerText=f.list.title||"...",a.querySelector(".todo-list").todoList.update({items:f.list.items}),a.querySelector(".todo-list > .todo-item-input").dataset.key="todo-item-input"+f.list.id,a.classList.toggle("-editing",f.editing),f.editing&&g&&(j.value=f.list.title,j.focus(),j.select(),g=!1)}var f={list:null,editing:!1},g=!1,h=!0;a.innerHTML="
\n

\n

\n \n \n

\n
\n
";var i=a.querySelector(".title"),j=a.querySelector(".input"),k=a.querySelector(".delete");VT.AppDraggable(i,{dropSelector:".todo-frame.-custom .container"}),VT.TodoList(a.querySelector(".todo-list")),a.querySelectorAll(".app-icon").forEach(VT.AppIcon),i.addEventListener("click",function(){g=!0,d({editing:!0})}),k.addEventListener("touchstart",function(){h=!1}),k.addEventListener("mousedown",function(){h=!1}),j.addEventListener("blur",function(){h&&b(),h=!0}),j.addEventListener("focusOther",function(){f.editing&&b()}),j.addEventListener("keyup",function(a){switch(a.keyCode){case 13:b();break;case 27:c();}}),k.addEventListener("click",function(){0