import { Build, h, } from "@stencil/core";
import { DatabaseService, } from "@fireenjin/sdk";
import { merge } from "lodash";
import { modalController, toastController } from "@ionic/core";
import moveItemInObject from "../../../helpers/moveItemInObject";
import state from "../../../store";
import setByPath from "../../../helpers/setByPath";
export class AppFlow {
  constructor() {
    this.stepInput = {};
    this.flowId = undefined;
    this.renderId = "default";
    this.stepId = undefined;
    this.db = undefined;
    this.flowTemplates = undefined;
    this.reNamePathString = undefined;
    this.flow = {};
    this.step = {};
    this.steps = [];
    this.showCodeInputForStep = {};
    this.tests = undefined;
    this.testId = undefined;
  }
  onSubmit(event) {
    var _a, _b, _c, _d;
    console.log(event);
    if (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.name) === "addPathForm") {
      if (!((_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.steps) === null || _d === void 0 ? void 0 : _d.length)) {
        alert("Steps are required to add a path!");
        return;
      }
      this.addToPath(event.detail.data.path, event.detail.data.steps);
      this.formEl.submit();
    }
  }
  onTrigger(event) {
    var _a;
    if (((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.name) === "closeModal") {
      this.floodteamCloseModal.emit();
    }
  }
  async onSuccess({ detail: { endpoint, data } }) {
    var _a;
    console.log(endpoint);
    if (endpoint === "listSteps") {
      this.steps = (data === null || data === void 0 ? void 0 : data.steps) || [];
    }
    else if (endpoint === "addFlow" && this.flowId === "new") {
      const routerEl = document.querySelector("ion-router");
      this.flowId = ((_a = data === null || data === void 0 ? void 0 : data.addFlow) === null || _a === void 0 ? void 0 : _a.id) || "new";
      if (routerEl)
        routerEl.push(`/flows/${this.flowId}`);
    }
    else if (endpoint === "editStep") {
      this.fetchSteps();
      const toast = await toastController.create({
        message: "Step successfully updated",
        duration: 4000,
      });
      toast.present();
    }
    else if (endpoint === "addStep") {
      this.floodteamCloseModal.emit();
      this.fetchSteps();
      const toast = await toastController.create({
        message: "Step successfully Added",
        duration: 4000,
      });
      toast.present();
    }
    else if (endpoint === "deleteStep") {
      this.floodteamCloseModal.emit();
      this.fetchSteps();
      const toast = await toastController.create({
        message: "Step successfully Deleted",
        duration: 4000,
      });
      toast.present();
    }
    else if (endpoint === "listTests") {
      this.tests = (data === null || data === void 0 ? void 0 : data.tests) || [];
    }
    else if (["addTest", "editTest", "deleteTest"].includes(endpoint)) {
      this.getTests();
    }
    else {
      this.stepsSelectEl.value = null;
    }
    this.flow = { ...(this.flow || {}) };
  }
  async onReorder(event) {
    this.flow.paths[event.target.dataset.path] = moveItemInObject(this.flow.paths[event.target.dataset.path], event.detail.from, event.detail.to, "step-");
    event.detail.complete(false);
    this.formEl.submit();
  }
  async openTestsModal() {
    this.modalEl = await modalController.create({
      cssClass: "modal-flow-test",
      component: "floodteam-modal-flow-test",
      componentProps: {
        flowId: this.flowId,
        tests: this.tests,
      },
    });
    this.modalEl.present();
  }
  async openFlowPreview() {
    var _a, _b, _c;
    const test = this.testId && ((_b = (_a = this.tests) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, test => (test === null || test === void 0 ? void 0 : test.id) === this.testId));
    this.modalEl = await modalController.create({
      cssClass: "modal-flow-rider",
      component: "modal-flow-rider",
      componentProps: {
        headerTitle: ((_c = this.flow) === null || _c === void 0 ? void 0 : _c.name) || "Flow",
        flowId: this.flowId,
        renderId: this.renderId,
        formData: (test === null || test === void 0 ? void 0 : test.formData) || {}
      },
    });
    this.modalEl.present();
  }
  async openStepModal(step, addStep = false) {
    this.modalEl = await modalController.create({
      component: "floodteam-modal-add-step",
      cssClass: "modal-add-step",
      componentProps: {
        steps: this.steps,
        step,
        stepId: step === null || step === void 0 ? void 0 : step.id,
        templates: this.flowTemplates,
        tab: addStep ? "addStep" : "steps",
        db: DatabaseService,
      },
    });
    this.modalEl.present();
  }
  async fetchSteps() {
    this.fireenjinFetch.emit({
      endpoint: "listSteps",
    });
  }
  onChange({ target, detail }) {
    if ((target === null || target === void 0 ? void 0 : target.name) !== "testToRun")
      return;
    this.testId = (detail === null || detail === void 0 ? void 0 : detail.value) || null;
    if (detail === null || detail === void 0 ? void 0 : detail.value) {
      this.openFlowPreview();
    }
    else {
      this.openTestsModal();
    }
  }
  async getData() {
    this.fireenjinTrigger.emit({
      name: "subscribe",
      payload: {
        collection: "flows",
        id: this.flowId,
        callback: ({ data }) => {
          var _a;
          const flow = data;
          for (const path of Object.keys((flow === null || flow === void 0 ? void 0 : flow.paths) || {})) {
            flow.paths[path] = Object.entries(((_a = flow === null || flow === void 0 ? void 0 : flow.paths) === null || _a === void 0 ? void 0 : _a[path]) || {})
              .sort(([stepNumberA], [stepNumberB]) => (stepNumberA < stepNumberB && -1) ||
              (stepNumberA > stepNumberB && 1) ||
              0)
              .reduce((acc, [stepNumber, pathStep]) => {
              acc[stepNumber] = pathStep;
              return acc;
            }, {});
          }
          this.flow = flow;
          this.getTests();
        },
      },
    });
    await this.fetchSteps();
  }
  getTests() {
    this.fireenjinFetch.emit({
      endpoint: "listTests",
      params: {
        data: {
          flowId: this.flowId
        }
      }
    });
  }
  beforeSubmit(data) {
    if (!(data === null || data === void 0 ? void 0 : data.paths)) {
      return;
    }
    else {
      setByPath(this.flow, this.codeEditorFieldName, null);
      this.flow = merge(this.flow, data);
      return this.flow;
    }
  }
  disconnectedCallback() {
    this.fireenjinTrigger.emit({
      name: "unsubscribe",
      payload: {
        collection: "flows",
        id: this.flowId,
      },
    });
  }
  /**
   * Simple object check.
   * @param item
   * @returns {boolean}
   */
  isObject(item) {
    return item && typeof item === "object" && !Array.isArray(item);
  }
  async openCodeEditor(event, name, value = "{}", pageTitle, language = "json", outputObject = true) {
    this.codeEditorFieldName = name;
    const modalEl = await modalController.create({
      component: "fireenjin-mx-modal-code-editor",
      cssClass: "fireenjin-mx-modal-code-editor-wrapper",
      componentProps: {
        name,
        pageTitle: pageTitle || "Edit Step Input",
        value: language === "json" ? JSON.stringify(value) : value,
        language,
        endpoint: "editFlow",
        documentId: this.flowId,
        beforeSubmit: event.target.id === "flowPathLogic"
          ? null
          : (data) => this.beforeSubmit(data),
        outputObject,
      },
    });
    await modalEl.present();
    return modalEl;
  }
  reNamePath(event, pathName) {
    event.stopPropagation();
    const newPathName = prompt(`What do you want to name the path, ${pathName}?`).trim();
    if (!(newPathName === null || newPathName === void 0 ? void 0 : newPathName.length)) {
      alert("Field was empty!");
    }
    else if (newPathName) {
      this.flow.paths[newPathName] = this.flow.paths[pathName];
      delete this.flow.paths[pathName];
      this.flow.defaultPath = null;
      this.flow = { ...this.flow };
      this.formEl.submit();
    }
    else {
      return;
    }
  }
  addToPath(path, steps) {
    var _a;
    if (!this.flow.paths)
      this.flow.paths = {};
    if (!this.flow.paths[path])
      this.flow.paths[path] = {};
    let numberOfStepsInPath = Object.values(this.flow.paths[path]).length;
    for (const stepId of steps) {
      const step = `step-${numberOfStepsInPath}`;
      if (!((_a = this.flow.paths[path]) === null || _a === void 0 ? void 0 : _a[step]))
        this.flow.paths[path][step] = {};
      this.flow.paths[path][step].step = this.db.document("steps", stepId);
      this.flow.paths[path][step].input = {};
      numberOfStepsInPath += 1;
    }
    this.flow = { ...this.flow };
  }
  removeFromPath(pathName, index) {
    var _a, _b;
    if (!confirm(`remove step from ${pathName}?`))
      return;
    this.flow.paths[pathName] = Object.entries(((_b = (_a = this.flow) === null || _a === void 0 ? void 0 : _a.paths) === null || _b === void 0 ? void 0 : _b[pathName]) || {})
      .filter((_s, i) => index !== i)
      .reduce((acc, [_stepName, step], index) => {
      acc[`step-${index}`] = step;
      return acc;
    }, {});
    this.flow = { ...this.flow };
    this.formEl.submit();
  }
  setDefaultPath(event, pathName) {
    event.preventDefault();
    event.stopPropagation();
    this.flow.defaultPath = pathName || "default";
    this.formEl.submit();
  }
  componentDidLoad() {
    if (!(Build === null || Build === void 0 ? void 0 : Build.isBrowser))
      return;
    this.getData();
  }
  render() {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
    const stepOptions = this.steps.map((step) => ({
      label: (step === null || step === void 0 ? void 0 : step.name) || "no name",
      value: step === null || step === void 0 ? void 0 : step.id,
    }));
    this.flowTemplates = ((state === null || state === void 0 ? void 0 : state.templates) || []).filter((template) => ((template === null || template === void 0 ? void 0 : template.tags) || []).includes("flow"));
    return [
      h("ion-content", null, h("floodteam-title-bar", null, h("ion-router-link", { href: "/flows" }, "Flows"), h("div", { slot: "end" }, h("div", { style: {
          color: "var(--ion-text-color)",
          borderRadius: "30px",
          border: "1px solid rgba(var(--ion-text-color-rgb), 0.2)",
          display: "inline-flex",
          gap: "0.5rem",
          alignItems: "center",
          padding: "0.3rem 0.5rem",
          margin: "0.5rem 0 0 0"
        } }, h("ion-select", { interface: "popover", value: "default", name: "testToRun" }, h("ion-select-option", { value: "default" }, "Default"), (_b = (_a = this.tests) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 :
        _b.call(_a, test => h("ion-select-option", { value: test === null || test === void 0 ? void 0 : test.id }, (test === null || test === void 0 ? void 0 : test.name) || "No Name")), h("ion-select-option", { value: null }, "Add New / Edit")), h("ion-button", { fill: "clear", shape: "round", color: "primary", onClick: () => this.openFlowPreview(), style: { "--padding-start": "0.3rem", "--padding-end": "0.3rem" } }, h("ion-icon", { slot: "icon-only", name: "play" }))))), h("ion-grid", null, h("ion-row", null, h("ion-col", null, h("fireenjin-form", { hideControls: true, ref: (el) => (this.formEl = el), endpoint: this.flowId === "new" ? "addFlow" : "editFlow", documentId: this.flowId, formData: this.flow }, h("ion-card", null, h("ion-card-header", null, h("ion-card-title", null, "Basic Info")), h("ion-card-content", null, h("ion-grid", null, h("ion-row", null, h("ion-col", { "size-sm": "9", size: "12" }, h("fireenjin-input", { title: "name of the flow", "data-fill": true, name: "name", label: "Name", "label-position": "stacked", value: (_c = this.flow) === null || _c === void 0 ? void 0 : _c.name })), h("ion-col", { "size-sm": "3", size: "12" }, h("fireenjin-toggle", { title: "Show Progress Bar above steps?", value: (_d = this.flow) === null || _d === void 0 ? void 0 : _d.showProgress, "data-fill": true, color: "primary", lines: "none", label: "Show Progress", labelPosition: "stacked", name: "showProgress" }), h("fireenjin-toggle", { title: "Show Confetti when Completing Flow?", value: (_e = this.flow) === null || _e === void 0 ? void 0 : _e.successConfetti, "data-fill": true, color: "success", lines: "none", label: "Success \uD83C\uDF89", labelPosition: "stacked", name: "successConfetti" }))), h("ion-row", null, h("ion-col", { "size-sm": "6", size: "12" }, h("fireenjin-select-tags", { title: "add tags for the flow", name: "tags", "data-fill": true, labelPosition: "stacked", label: "Tags", value: ((_f = this.flow) === null || _f === void 0 ? void 0 : _f.tags) || [], allowAdding: true, options: [
          {
            label: "Important",
            value: "important",
          },
        ] })), h("ion-col", { "size-sm": "6", size: "12", style: { display: "flex" } }, h("fireenjin-select", { title: "Where the flow gets submitted to", style: { marginTop: "auto", width: "100%" }, name: "endpoint", label: "Endpoint", labelPosition: "stacked", value: (_g = this.flow) === null || _g === void 0 ? void 0 : _g.endpoint, options: [
          {
            label: "Add Company",
            value: "addCompany",
          },
          {
            label: "Add Payment",
            value: "addPayment",
          },
          {
            label: "Add Job",
            value: "addJob",
          },
          {
            label: "Add Dot",
            value: "addDot",
          },
        ] })))))), h("ion-card", { class: { "is-loading": !((_h = this.flowTemplates) === null || _h === void 0 ? void 0 : _h.length) } }, h("ion-card-header", null, h("ion-card-title", null, "Templates")), h("ion-card-content", null, h("ion-grid", null, h("ion-row", null, h("ion-col", { "size-sm": "6", size: "12" }, h("floodteam-select-template", { templates: this.flowTemplates, name: "successTemplateId", label: "Success Template", value: (_k = (_j = this.flow) === null || _j === void 0 ? void 0 : _j.successTemplate) === null || _k === void 0 ? void 0 : _k.id })), h("ion-col", { "size-sm": "6", size: "12" }, h("floodteam-select-template", { templates: this.flowTemplates, name: "errorTemplateId", label: "Error Template", value: (_m = (_l = this.flow) === null || _l === void 0 ? void 0 : _l.errorTemplate) === null || _m === void 0 ? void 0 : _m.id }))))))), h("ion-card", null, h("ion-card-header", null, h("ion-card-title", null, "Paths", h("ion-button", { onClick: () => {
          var _a;
          return this.openCodeEditor(event, "pathLogic", (_a = this.flow) === null || _a === void 0 ? void 0 : _a.pathLogic, "Json Logic for Path", "json", true);
        }, title: "json logic to determine path", id: "flowPathLogic", color: "warning", size: "small", style: { float: "right" } }, "Logic"))), h("ion-grid", null, h("ion-row", null, h("ion-col", null, h("ion-accordion-group", null, Object.entries(((_o = this.flow) === null || _o === void 0 ? void 0 : _o.paths) || {}).map(([pathName, steps]) => {
        var _a;
        return (h("ion-accordion", { title: "selects a path" }, h("ion-item", { slot: "header" }, h("ion-button", { size: "small", title: "Rename Path", onClick: (event) => this.reNamePath(event, pathName) }, h("ion-icon", { slot: "icon-only", name: "pencil" })), h("ion-label", null, pathName || "no name"), h("ion-buttons", { slot: "end" }, (pathName !== ((_a = this.flow) === null || _a === void 0 ? void 0 : _a.defaultPath) && (h("ion-button", { onClick: (event) => this.setDefaultPath(event, pathName) }, "Set Default"))) || h("ion-badge", null, "Default"))), h("ion-reorder-group", { "data-path": pathName, disabled: false, slot: "content" }, Object.values(steps || {}).map(({ step, input }, index) => {
          var _a;
          return (h("ion-item", null, h("ion-buttons", { title: "Edit Step", slot: "start" }, h("ion-button", { onClick: () => this.openStepModal((this.steps || []).find(({ id }) => id === step.id)) }, h("ion-icon", { title: "opens edit step window", slot: "icon-only", name: "create" })), h("ion-button", { onClick: () => this.removeFromPath(pathName, index) }, h("ion-icon", { slot: "icon-only", name: "trash" }))), h("ion-label", { title: "name of step in selected path" }, ((_a = (this.steps || []).find((s) => (s === null || s === void 0 ? void 0 : s.id) === (step === null || step === void 0 ? void 0 : step.id))) === null || _a === void 0 ? void 0 : _a.name) || "no step"), h("div", { slot: "end", style: { display: "flex" } }, h("ion-button", { title: "opens code editor window", fill: (input === null || input === void 0 ? void 0 : input.length) && input !== "{}"
              ? "solid"
              : "outline", onClick: () => this.openCodeEditor(event, `paths.${pathName}.step-${index}.input`, input) }, "Input"), h("ion-reorder", { title: "drag to re-order steps" }))));
        }))));
      }))))), h("ion-item-divider", null, "Add Path"), h("fireenjin-form", { ref: (el) => (this.pathFormEl = el), hideControls: true, name: "addPathForm", disableLoader: true, resetButton: null }, h("ion-grid", null, h("ion-row", null, h("ion-col", { "size-sm": "4", size: "12" }, h("ion-item", { lines: "full" }, h("fireenjin-input", { lines: "none", title: "name of the path", name: "path", "data-fill": true, label: "Name", labelPosition: "stacked", value: ((_p = this.flow) === null || _p === void 0 ? void 0 : _p.defaultPath) || "default" }))), h("ion-col", { "size-sm": "5", size: "9", style: { display: "flex" } }, h("fireenjin-select", { style: { marginTop: "auto" }, placeholder: "Select Steps For Path", lines: "full", ref: (el) => (this.stepsSelectEl = el), title: "steps to add to the path", labelPosition: "stacked", "data-fill": true, multiple: true, name: "steps", label: "Steps", options: stepOptions, required: true }, h("ion-button", { style: {
          marginInlineEnd: "0",
        }, slot: "start", title: "Add a Step", fill: "clear", onClick: () => this.openStepModal({}, true) }, h("ion-icon", { slot: "icon-only", name: "add-circle" })))), h("ion-col", { size: "3", style: { display: "flex" } }, h("ion-button", { style: { margin: "auto" }, title: "Save this Path to the Flow", onClick: () => this.pathFormEl.submit(), color: "primary", size: "small" }, "Add to Path")))))))))),
      h("floodteam-navigation-footer", null, h("floodteam-title-bar", { back: "/flows", disableUnderline: true }, h("ion-breadcrumbs", null, h("ion-breadcrumb", { href: "/flows" }, h("ion-icon", { class: "ft-icon-style", slot: "start", name: "layers-outline" }), "Flows"), h("ion-breadcrumb", { href: "/flows", onClick: () => {
          var _a;
          return this.fireenjinTrigger.emit({
            name: "pin",
            payload: {
              icon: "layers-outline",
              href: `/flows/${this.flowId}`,
              name: ((_a = this === null || this === void 0 ? void 0 : this.flow) === null || _a === void 0 ? void 0 : _a.name) || "New Flow",
            },
          });
        } }, h("ion-icon", { color: ((_q = ((state === null || state === void 0 ? void 0 : state.pins) || [])
          .map((pin) => pin === null || pin === void 0 ? void 0 : pin.href)) === null || _q === void 0 ? void 0 : _q.includes(`/flows/${this.flowId}`))
          ? "primary"
          : null, slot: "start", name: "pin" }), ((_r = this === null || this === void 0 ? void 0 : this.flow) === null || _r === void 0 ? void 0 : _r.name) || "???")), h("ion-buttons", { slot: "end" }, h("ion-button", { style: { paddingRight: "15px" }, fill: "solid", color: "primary", onClick: () => this.formEl.submit() }, "Save"), h("ion-button", { color: "primary", fill: "solid", onClick: () => this.openStepModal(undefined, true) }, "Steps")))),
    ];
  }
  static get is() { return "app-flow"; }
  static get originalStyleUrls() {
    return {
      "$": ["app-flow.css"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["app-flow.css"]
    };
  }
  static get properties() {
    return {
      "flowId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "flow-id",
        "reflect": false
      },
      "renderId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "render-id",
        "reflect": false,
        "defaultValue": "\"default\""
      },
      "stepId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "step-id",
        "reflect": false
      },
      "db": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "DatabaseService",
          "resolved": "DatabaseService",
          "references": {
            "DatabaseService": {
              "location": "import",
              "path": "@fireenjin/sdk"
            }
          }
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        }
      },
      "flowTemplates": {
        "type": "unknown",
        "mutable": true,
        "complexType": {
          "original": "Template[]",
          "resolved": "Template[]",
          "references": {
            "Template": {
              "location": "import",
              "path": "../../../sdk"
            }
          }
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": ""
        }
      },
      "reNamePathString": {
        "type": "string",
        "mutable": true,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "re-name-path-string",
        "reflect": false
      }
    };
  }
  static get states() {
    return {
      "flow": {},
      "step": {},
      "steps": {},
      "showCodeInputForStep": {},
      "tests": {},
      "testId": {}
    };
  }
  static get events() {
    return [{
        "method": "fireenjinFetch",
        "name": "fireenjinFetch",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": ""
        },
        "complexType": {
          "original": "FireEnjinFetchEvent",
          "resolved": "FireEnjinFetchEvent",
          "references": {
            "FireEnjinFetchEvent": {
              "location": "import",
              "path": "@fireenjin/sdk"
            }
          }
        }
      }, {
        "method": "fireenjinSubmit",
        "name": "fireenjinSubmit",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": ""
        },
        "complexType": {
          "original": "FireEnjinSubmitEvent",
          "resolved": "FireEnjinSubmitEvent",
          "references": {
            "FireEnjinSubmitEvent": {
              "location": "import",
              "path": "@fireenjin/sdk"
            }
          }
        }
      }, {
        "method": "fireenjinTrigger",
        "name": "fireenjinTrigger",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": ""
        },
        "complexType": {
          "original": "FireEnjinTriggerInput",
          "resolved": "FireEnjinTriggerInput<any>",
          "references": {
            "FireEnjinTriggerInput": {
              "location": "import",
              "path": "@fireenjin/sdk"
            }
          }
        }
      }, {
        "method": "floodteamCloseModal",
        "name": "floodteamCloseModal",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": ""
        },
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        }
      }];
  }
  static get listeners() {
    return [{
        "name": "fireenjinSubmit",
        "method": "onSubmit",
        "target": undefined,
        "capture": false,
        "passive": false
      }, {
        "name": "fireenjinTrigger",
        "method": "onTrigger",
        "target": "document",
        "capture": false,
        "passive": false
      }, {
        "name": "fireenjinSuccess",
        "method": "onSuccess",
        "target": "document",
        "capture": false,
        "passive": false
      }, {
        "name": "ionItemReorder",
        "method": "onReorder",
        "target": undefined,
        "capture": false,
        "passive": false
      }, {
        "name": "ionChange",
        "method": "onChange",
        "target": undefined,
        "capture": false,
        "passive": false
      }, {
        "name": "ionRouteDidChange",
        "method": "getData",
        "target": undefined,
        "capture": false,
        "passive": false
      }];
  }
}
