import{r as i,h as o}from"./p-03169580.js";import{F as l}from"./p-4d314fbd.js";import{s as n}from"./p-46225039.js";import"./p-59c95c5f.js";import"./p-c9699503.js";const t="";let d=class{constructor(o){i(this,o)}async search(i){var o,t;const d=(o=i===null||i===void 0?void 0:i.target)===null||o===void 0?void 0:o.value;if(!((t=n.templates)===null||t===void 0?void 0:t.length)||!(d===null||d===void 0?void 0:d.length)){this.searchResults=null;return}const r=new l(n.templates,{keys:["subject","description"]});this.searchResults=await r.search(d).map((i=>i===null||i===void 0?void 0:i.item))}async cancel(){this.searchResults=null}render(){const i=this.searchResults||n.templates||[];return[o("ion-content",{class:"ion-padding"},o("floodteam-title-bar",null,o("ion-router-link",{href:"/templates"},"Templates"),o("ion-buttons",{slot:"end"},o("ion-button",{fill:"solid",color:"primary",href:"/templates/new"},"Add"))),o("fireenjin-search-bar",{ref:i=>this.filterBarEl=i,paginationEl:this.paginationEl,filters:[{name:"tags",label:"Tags",icon:"pricetags",multiple:true,options:[{label:"Imported",value:"imported"}]}]}),o("ion-card",null,o("ion-list",{class:"ion-no-padding"},i.sort((function(i,o){var l,n,t,d;var r=((n=(l=i===null||i===void 0?void 0:i.subject)===null||l===void 0?void 0:l.toUpperCase)===null||n===void 0?void 0:n.call(l))||"";var e=((d=(t=o===null||o===void 0?void 0:o.subject)===null||t===void 0?void 0:t.toUpperCase)===null||d===void 0?void 0:d.call(t))||"";if(r<e){return-1}if(r>e){return 1}return 0})).sort((function(i,o){var l,n,t,d;var r=((n=(l=i===null||i===void 0?void 0:i.type)===null||l===void 0?void 0:l.toUpperCase)===null||n===void 0?void 0:n.call(l))||"";var e=((d=(t=o===null||o===void 0?void 0:o.type)===null||t===void 0?void 0:t.toUpperCase)===null||d===void 0?void 0:d.call(t))||"";if(r<e){return-1}if(r>e){return 1}return 0})).map(((l,n)=>{var t;return[((t=i===null||i===void 0?void 0:i[n-1])===null||t===void 0?void 0:t.type)!==(l===null||l===void 0?void 0:l.type)&&o("ion-item-divider",null,l.type),o("ion-item",{href:`/templates/${l===null||l===void 0?void 0:l.id}`,detail:true},o("ion-label",null,o("h2",null,(l===null||l===void 0?void 0:l.subject)||""),o("p",null,(l===null||l===void 0?void 0:l.description)||"No Description on File...")))]}))))),o("floodteam-navigation-footer",null)]}};d.style=t;export{d as app_template_list};
//# sourceMappingURL=p-0ced20d8.entry.js.map