'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-ee190ee0.js');
const store = require('./store-27073b3b.js');
require('./index-4901314f.js');
require('./getHandlebarsHelpers-8ef28401.js');
require('./_commonjsHelpers-a5111d61.js');
require('./index-ba857994.js');
require('./localforage-af1b8c0e.js');

const appMaterialListCss = "";

const AppMaterial = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.fireenjinTrigger = index.createEvent(this, "fireenjinTrigger", 7);
    this.fireenjinSubmit = index.createEvent(this, "fireenjinSubmit", 7);
    this.eventIconMap = {
      alert: "notifications",
      notion: "./assets/svg/notion.svg",
    };
    this.query = undefined;
  }
  onSearchInput(event) {
    this.query = event.target.value;
  }
  componentDidLoad() {
    if (!(index.Build === null || index.Build === void 0 ? void 0 : index.Build.isBrowser))
      return;
    // Get Data
  }
  render() {
    var _a;
    return [
      index.h("ion-content", { class: "ion-padding" }, index.h("div", { class: "ion-padding" }, index.h("fireenjin-search-bar", { ref: (el) => (this.filterBarEl = el), paginationEl: this.paginationEl }), index.h("fireenjin-pagination", { ref: (el) => (this.paginationEl = el), name: "materials", resultsKey: "materials", disableVirtualScroll: true, removeDuplicates: true, listEl: ({ result: material }) => (index.h("ion-item", { href: `/materials/${material.id}`, detail: true, lines: "full" }, index.h("ion-grid", null, index.h("ion-row", { class: "ion-align-items-center ion-justify-content-between" }, index.h("ion-col", null, index.h("ion-label", null, index.h("h2", null, material.name))))))), display: "list", endpoint: "listMaterials", limit: 20, query: this.query }))),
      index.h("floodteam-navigation-footer", null, index.h("floodteam-title-bar", { back: "/dashboard" }, index.h("ion-breadcrumbs", null, index.h("ion-breadcrumb", { onClick: () => this.fireenjinTrigger.emit({
          name: "pin",
          payload: {
            icon: "flash",
            href: `/materials`,
            name: "Materials",
          },
        }) }, index.h("ion-icon", { color: ((_a = ((store.state === null || store.state === void 0 ? void 0 : store.state.pins) || [])
          .map((pin) => pin === null || pin === void 0 ? void 0 : pin.href)) === null || _a === void 0 ? void 0 : _a.includes(`/materials`))
          ? "primary"
          : null, slot: "start", name: "pin" }), "Materials")), index.h("ion-buttons", { slot: "end" }, index.h("ion-button", { fill: "solid", color: "primary", href: "/materials/new" }, "Add")))),
    ];
  }
};
AppMaterial.style = appMaterialListCss;

exports.app_material_list = AppMaterial;
