import { h, } from "@stencil/core";
export class AppImport {
  constructor() {
    this.importId = undefined;
    this.results = [];
    this.query = undefined;
  }
  onSuccess(event) {
    var _a, _b, _c, _d;
    console.log(event);
    if (((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.endpoint) !== "importer")
      return;
    this.results = ((_d = (_c = (_b = event === null || event === void 0 ? void 0 : event.detail) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.importer) === null || _d === void 0 ? void 0 : _d.results) || [];
  }
  onChange(event) {
    var _a, _b;
    console.log(event);
    const targetEl = event === null || event === void 0 ? void 0 : event.target;
    if ((targetEl === null || targetEl === void 0 ? void 0 : targetEl.tagName) === "ION-SEARCHBAR") {
      this.query = ((_b = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.length) > 0 ? event.target.value : null;
    }
  }
  render() {
    return [
      h("ion-content", { class: "ion-padding" }, h("floodteam-flow-rider", { flowId: "oHXf1zKn1ebCGNK4M7Zt" })),
      h("floodteam-navigation-footer", null),
    ];
  }
  static get is() { return "app-import"; }
  static get originalStyleUrls() {
    return {
      "$": ["app-import.css"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["app-import.css"]
    };
  }
  static get properties() {
    return {
      "importId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "import-id",
        "reflect": false
      }
    };
  }
  static get states() {
    return {
      "results": {},
      "query": {}
    };
  }
  static get listeners() {
    return [{
        "name": "fireenjinSuccess",
        "method": "onSuccess",
        "target": undefined,
        "capture": false,
        "passive": false
      }, {
        "name": "ionChange",
        "method": "onChange",
        "target": undefined,
        "capture": false,
        "passive": false
      }];
  }
}
