import { Component, Event, Prop, h, } from "@stencil/core";
import state from "../../../store";
export class ModalFlow {
  constructor() {
    this.headerTitle = "Flow";
    /**
     * The data from the form being filled out
     */
    this.formData = {};
    /**
     * The next button for the slider
     */
    this.nextButton = {
      label: "Next",
      color: "primary",
      fill: "clear",
      icon: "chevron-forward-circle-outline",
    };
    /**
     * The prev button for the slider
     */
    this.prevButton = {
      label: "Back",
      color: "medium",
      fill: "clear",
      icon: "chevron-back-circle-outline",
    };
    /**
     * The save button for the flow
     */
    this.saveButton = {
      label: "Save",
      fill: "solid",
      color: "primary",
      icon: "checkmark-circle-outline",
    };
    /**
     * Should the form controls be hidden?
     */
    this.hideControls = false;
    /**
     * The data to exclude from the form submit event
     */
    this.excludeData = [];
    /**
     * Should the form disable the loader on submit
     */
    this.disableLoader = false;
    /**
     * Is the component currently loading
     */
    this.loading = false;
    /**
     * Should the enter button binding be disabled
     */
    this.disableEnterButton = false;
    /**
     * Confirm leaving the page when the form is filled
     */
    this.confirmExit = false;
    /**
     * Has the form fields been changed
     */
    this.hasChanged = false;
    /**
     * The HTTP method to use when submitting the form
     */
    this.method = "post";
    /**
     * A list of options for SwiperJS
     * @link https://swiperjs.com/swiper-api#parameters
     */
    this.slidesOptions = { autoHeight: true, allowTouchMove: false };
    this.pager = false;
    this.scrollbar = false;
    this.steps = [];
    this.askConfirmation = false;
  }
  render() {
    var _a, _b, _c, _d;
    return [
      h("ion-header", null,
        h("ion-toolbar", null,
          h("ion-title", null, this.headerTitle),
          h("ion-buttons", { slot: "end" },
            h("ion-button", { onClick: () => this.floodteamCloseModal.emit() },
              h("ion-icon", { slot: "icon-only", name: "close-circle-outline" }))))),
      h("ion-content", null,
        h("fireenjin-flow", { name: this.name, formData: this.formData, nextButton: this.nextButton, saveButton: this.saveButton, prevButton: this.prevButton, hideControls: this.hideControls, endpoint: this.endpoint, documentId: this.documentId, excludeData: this.excludeData, beforeSubmit: this.beforeSubmit, disableLoader: this.disableLoader, loading: this.loading, disableEnterButton: this.disableEnterButton, confirmExit: this.confirmExit, hasChanged: this.hasChanged, method: this.method, action: this.action, fetch: this.fetch, fetchDataMap: this.fetchDataMap, fetchParams: this.fetchParams, slidesOptions: this.slidesOptions || { autoHeight: true }, pager: this.pager, scrollbar: this.scrollbar, steps: this.steps, googleMapsKey: this.googleMapsKey || ((_b = (_a = state === null || state === void 0 ? void 0 : state.config) === null || _a === void 0 ? void 0 : _a.firebase) === null || _b === void 0 ? void 0 : _b.apiKey), stripeKey: this.stripeKey || ((_d = (_c = state === null || state === void 0 ? void 0 : state.config) === null || _c === void 0 ? void 0 : _c.stripe) === null || _d === void 0 ? void 0 : _d.key), stripeElements: this.stripeElements })),
    ];
  }
  static get is() { return "modal-flow"; }
  static get originalStyleUrls() { return {
    "$": ["modal-flow.css"]
  }; }
  static get styleUrls() { return {
    "$": ["modal-flow.css"]
  }; }
  static get properties() { return {
    "headerTitle": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "header-title",
      "reflect": false,
      "defaultValue": "\"Flow\""
    },
    "name": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The name of the form used for ID and name"
      },
      "attribute": "name",
      "reflect": false
    },
    "formData": {
      "type": "any",
      "mutable": true,
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The data from the form being filled out"
      },
      "attribute": "form-data",
      "reflect": false,
      "defaultValue": "{}"
    },
    "nextButton": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "{\n    expand?: \"block\" | \"full\";\n    label?: string;\n    color?: Color;\n    fill?: \"clear\" | \"outline\" | \"solid\" | \"default\";\n    icon?: string;\n    iconSlot?: string;\n    onClick?: (event) => void;\n    disabled?: boolean;\n    shape?: \"round\";\n  }",
        "resolved": "{ expand?: \"block\" | \"full\"; label?: string; color?: string; fill?: \"default\" | \"clear\" | \"outline\" | \"solid\"; icon?: string; iconSlot?: string; onClick?: (event: any) => void; disabled?: boolean; shape?: \"round\"; }",
        "references": {
          "Color": {
            "location": "import",
            "path": "@ionic/core"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The next button for the slider"
      },
      "defaultValue": "{\n    label: \"Next\",\n    color: \"primary\",\n    fill: \"clear\",\n    icon: \"chevron-forward-circle-outline\",\n  }"
    },
    "prevButton": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "{\n    expand?: \"block\" | \"full\";\n    label?: string;\n    color?: Color;\n    fill?: \"clear\" | \"outline\" | \"solid\" | \"default\";\n    icon?: string;\n    iconSlot?: string;\n    onClick?: (event) => void;\n    disabled?: boolean;\n    shape?: \"round\";\n  }",
        "resolved": "{ expand?: \"block\" | \"full\"; label?: string; color?: string; fill?: \"default\" | \"clear\" | \"outline\" | \"solid\"; icon?: string; iconSlot?: string; onClick?: (event: any) => void; disabled?: boolean; shape?: \"round\"; }",
        "references": {
          "Color": {
            "location": "import",
            "path": "@ionic/core"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The prev button for the slider"
      },
      "defaultValue": "{\n    label: \"Back\",\n    color: \"medium\",\n    fill: \"clear\",\n    icon: \"chevron-back-circle-outline\",\n  }"
    },
    "saveButton": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "{\n    expand?: \"block\" | \"full\";\n    label?: string;\n    color?: Color;\n    fill?: \"clear\" | \"outline\" | \"solid\" | \"default\";\n    icon?: string;\n    iconSlot?: string;\n    onClick?: (event) => void;\n    disabled?: boolean;\n    shape?: \"round\";\n  }",
        "resolved": "{ expand?: \"block\" | \"full\"; label?: string; color?: string; fill?: \"default\" | \"clear\" | \"outline\" | \"solid\"; icon?: string; iconSlot?: string; onClick?: (event: any) => void; disabled?: boolean; shape?: \"round\"; }",
        "references": {
          "Color": {
            "location": "import",
            "path": "@ionic/core"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The save button for the flow"
      },
      "defaultValue": "{\n    label: \"Save\",\n    fill: \"solid\",\n    color: \"primary\",\n    icon: \"checkmark-circle-outline\",\n  }"
    },
    "hideControls": {
      "type": "boolean",
      "mutable": true,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Should the form controls be hidden?"
      },
      "attribute": "hide-controls",
      "reflect": false,
      "defaultValue": "false"
    },
    "endpoint": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The endpoint that form submission should link to"
      },
      "attribute": "endpoint",
      "reflect": false
    },
    "documentId": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The id of the document being edited"
      },
      "attribute": "document-id",
      "reflect": false
    },
    "excludeData": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "string[]",
        "resolved": "string[]",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The data to exclude from the form submit event"
      },
      "defaultValue": "[]"
    },
    "beforeSubmit": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "(data: any, options?: any) => Promise<any>",
        "resolved": "(data: any, options?: any) => Promise<any>",
        "references": {
          "Promise": {
            "location": "global"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "A method that runs before form submission to allow editing of formData"
      }
    },
    "disableLoader": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Should the form disable the loader on submit"
      },
      "attribute": "disable-loader",
      "reflect": false,
      "defaultValue": "false"
    },
    "loading": {
      "type": "boolean",
      "mutable": true,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Is the component currently loading"
      },
      "attribute": "loading",
      "reflect": false,
      "defaultValue": "false"
    },
    "disableEnterButton": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Should the enter button binding be disabled"
      },
      "attribute": "disable-enter-button",
      "reflect": false,
      "defaultValue": "false"
    },
    "confirmExit": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Confirm leaving the page when the form is filled"
      },
      "attribute": "confirm-exit",
      "reflect": false,
      "defaultValue": "false"
    },
    "hasChanged": {
      "type": "boolean",
      "mutable": true,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Has the form fields been changed"
      },
      "attribute": "has-changed",
      "reflect": false,
      "defaultValue": "false"
    },
    "method": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The HTTP method to use when submitting the form"
      },
      "attribute": "method",
      "reflect": false,
      "defaultValue": "\"post\""
    },
    "action": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The action to use for the form"
      },
      "attribute": "action",
      "reflect": false
    },
    "fetch": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "string | boolean",
        "resolved": "boolean | string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Emit the fetch event emitted when component loads"
      },
      "attribute": "fetch",
      "reflect": false
    },
    "fetchParams": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The fetch params"
      },
      "attribute": "fetch-params",
      "reflect": false
    },
    "fetchDataMap": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The map to bind data from fetch response to form data"
      },
      "attribute": "fetch-data-map",
      "reflect": false
    },
    "slidesOptions": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "link",
            "text": "https://swiperjs.com/swiper-api#parameters"
          }],
        "text": "A list of options for SwiperJS"
      },
      "attribute": "slides-options",
      "reflect": false,
      "defaultValue": "{ autoHeight: true, allowTouchMove: false }"
    },
    "pager": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "pager",
      "reflect": false,
      "defaultValue": "false"
    },
    "scrollbar": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "scrollbar",
      "reflect": false,
      "defaultValue": "false"
    },
    "steps": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "{\n    beforeHTML?: string;\n    fields?: Field[];\n    afterHTML?: string;\n  }[]",
        "resolved": "{ beforeHTML?: string; fields?: Field[]; afterHTML?: string; }[]",
        "references": {
          "Field": {
            "location": "import",
            "path": "@fireenjin/components/dist/types/typings"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "defaultValue": "[]"
    },
    "googleMapsKey": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "google-maps-key",
      "reflect": false
    },
    "stripeKey": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "stripe-key",
      "reflect": false
    },
    "stripeElements": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "stripe-elements",
      "reflect": false
    },
    "askConfirmation": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "ask-confirmation",
      "reflect": false,
      "defaultValue": "false"
    }
  }; }
  static get events() { return [{
      "method": "floodteamCloseModal",
      "name": "floodteamCloseModal",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }]; }
}
//# sourceMappingURL=modal-flow.js.map