'use strict';

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

const index = require('./index-cba1c3ae.js');
const hardwareBackButton = require('./overlays-7ec575fc.js');
const store = require('./store-140a5df9.js');
const index$2 = require('./index-eadee04c.js');
const ionicGlobal = require('./ionic-global-01cd0200.js');
const helpers = require('./helpers-c2496722.js');
const index$1 = require('./index-0d7f7a8b.js');
const theme = require('./theme-b0b295c1.js');
const menuToggleUtil = require('./menu-toggle-util-3bc82e90.js');
require('./getHandlebarsHelpers-7b2b1728.js');
require('./_commonjsHelpers-a5111d61.js');
require('./logic-d8c34975.js');
require('./index-1f381af8.js');
require('./localforage-af1b8c0e.js');
require('./animation-ee586546.js');

const chipBarCss = "fireenjin-chip-bar{display:block;padding:3px;height:46px;width:100%;overflow:hidden;overflow-x:auto !important;white-space:nowrap}ion-chip ion-icon.ft-icon-style{height:14px !important;width:14px !important;padding:4px !important}fireenjin-chip-bar ion-router-link:hover ion-icon{color:var(--ion-color-secondary)}fireenjin-chip-bar::-webkit-scrollbar{width:0;height:5px}fireenjin-chip-bar::-webkit-scrollbar-thumb{background:rgba(var(--ion-text-color-rgb), 0.6);border-radius:2px}";

const ChipBar = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  render() {
    return (index.h(index.Host, null, index.h("slot", null)));
  }
};
ChipBar.style = chipBarCss;

const navigationFooterCss = "floodteam-navigation-footer fireenjin-chip-bar{padding-right:80px}floodteam-navigation-footer floodteam-title-bar{display:block;width:100%}floodteam-navigation-footer floodteam-title-bar ion-breadcrumb:first-of-type::part(native){padding-left:0}floodteam-navigation-footer floodteam-title-bar ion-breadcrumb ion-icon{color:var(--ion-text-color)}floodteam-navigation-footer floodteam-title-bar h1.ion-margin-vertical{margin:0}floodteam-navigation-footer .showing-pins fireenjin-chip-bar{padding-right:50px}floodteam-navigation-footer .menu-buttons{background:-moz-linear-gradient(\n    left,\n    rgba(var(--ion-nav-color-rgb), 0) 0%,\n    rgba(var(--ion-nav-color-rgb), 1) 30%\n  );background:-webkit-linear-gradient(\n    left,\n    rgba(var(--ion-nav-color-rgb), 0) 0%,\n    rgba(var(--ion-nav-color-rgb), 1) 30%\n  );background:linear-gradient(\n    to right,\n    rgba(var(--ion-nav-color-rgb), 0) 0%,\n    rgba(var(--ion-nav-color-rgb), 1) 30%\n  );filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#007db9e8', endColorstr='#1e5799',GradientType=1 );position:absolute;top:0;bottom:0;right:0;width:80px;index:9}floodteam-navigation-footer .showing-pins .menu-buttons{width:55px}floodteam-navigation-footer ion-menu-button{display:block;width:55px;position:absolute;right:0;bottom:6px}";

const NavigationFooter = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  render() {
    return (index.h("ion-header", { class: "showing-pins" }, index.h("ion-toolbar", null, index.h("div", { class: "header-content", style: { display: "flex", "flex-wrap": "wrap" } }, index.h("slot", null), index.h("floodteam-pin-bar", { style: {
        display: "flex",
        "justify-content": "flex-end",
      } })), index.h("div", { class: "menu-buttons" }, index.h("ion-menu-button", { autoHide: false }, index.h("ion-icon", { src: "/assets/icon/icon.svg", "aria-hidden": "true", style: {
        height: "55px",
        width: "60px",
        margin: "auto",
        textDecoration: "none",
        color: "var(--ion-text-color)",
      } }))))));
  }
};
NavigationFooter.style = navigationFooterCss;

const pinBarCss = "floodteam-pin-bar{padding:3px;height:46px;width:100%;overflow:hidden;overflow-x:auto !important;white-space:nowrap}floodteam-pin-bar ion-router-link:hover ion-icon{color:var(--ion-color-secondary)}floodteam-pin-bar::-webkit-scrollbar{width:0;height:5px}floodteam-pin-bar::-webkit-scrollbar-thumb{background:rgba(var(--ion-text-color-rgb), 0.6);border-radius:2px}";

const AppHeader = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.fireenjinTrigger = index.createEvent(this, "fireenjinTrigger", 7);
    this.reorder = false;
    this.isDragging = false;
  }
  dragOver(event) {
    event.preventDefault();
    // const cardEl: HTMLElement = event.target.closest("ion-card");
    // cardEl.style.opacity = "1";
  }
  dragLeave(event) {
    event.preventDefault();
    // const cardEl: HTMLElement = event.target.closest("ion-card");
    // cardEl.style.opacity = "0.6";
  }
  drag(event) {
    console.log(event);
    this.isDragging = true;
  }
  async drop(event) {
    event.preventDefault();
    // var data = ev.dataTransfer.getData('text');
    // ev.target.closest('ion-list').appendChild(document.getElementById(data));
    this.isDragging = false;
  }
  async openSupportModal(event) {
    this.modal = await hardwareBackButton.modalController.create({
      cssClass: "modal-support",
      component: "modal-support",
      componentProps: {
        user: (store.state === null || store.state === void 0 ? void 0 : store.state.profile) || null,
      },
      backdropDismiss: false,
    });
    this.modal.present();
    return event;
  }
  render() {
    var _a, _b;
    return (index.h(index.Host, null, index.h("fireenjin-chip-bar", { ref: (el) => (this.chipBarEl = el), onDrop: (event) => this.drop(event), onDragOver: (event) => this.dragOver(event), onDragLeave: (event) => this.dragLeave(event) }, index.h("ion-router-link", { title: "Home", href: "/dashboard" }, index.h("ion-chip", { title: "Home" }, index.h("ion-icon", { "aria-hidden": "true", name: "home", class: {
        "ft-icon-style": true,
      } }), index.h("ion-label", null, "Home"))), (_b = (_a = ((store.state === null || store.state === void 0 ? void 0 : store.state.pins) || [])).map) === null || _b === void 0 ? void 0 :
      _b.call(_a, (pin) => (index.h("ion-router-link", { title: pin === null || pin === void 0 ? void 0 : pin.name, href: (pin === null || pin === void 0 ? void 0 : pin.href) || "#", onClick: (event) => (pin === null || pin === void 0 ? void 0 : pin.trigger)
          ? this.fireenjinTrigger.emit({
            event,
            payload: (pin === null || pin === void 0 ? void 0 : pin.payload) || null,
            name: pin.trigger,
          })
          : null }, index.h("ion-chip", { title: pin.name, draggable: this.reorder, onDragStart: (event) => this.drag(event) }, index.h("ion-icon", { "aria-hidden": "true", name: pin.icon, class: {
          "ft-icon-style": true,
        } }), (pin === null || pin === void 0 ? void 0 : pin.name) && index.h("ion-label", null, pin.name))))), index.h("ion-router-link", { title: "Get Help", href: "#support", onClick: (event) => this.openSupportModal(event) }, index.h("ion-chip", { color: "warning" }, index.h("ion-icon", { "aria-hidden": "true", color: "warning", name: "help-circle", style: {
        "--ft-icon-primary": "var(--ion-color-warning)",
      }, class: {
        "ft-icon-style": true,
      } }), index.h("ion-label", null, "Get Help"))))));
  }
};
AppHeader.style = pinBarCss;

const menuButtonIosCss = ":host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;user-select:none;z-index:0;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar:not(.in-toolbar-color)){color:var(--ion-toolbar-color, var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.1;--border-radius:4px;--color:var(--ion-color-primary, #3880ff);--padding-start:5px;--padding-end:5px;height:32px;font-size:31px}:host(.ion-activated){opacity:0.4}@media (any-hover: hover){:host(:hover){opacity:0.6}}";

const menuButtonMdCss = ":host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;user-select:none;z-index:0;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar:not(.in-toolbar-color)){color:var(--ion-toolbar-color, var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.12;--background-hover:currentColor;--background-hover-opacity:.04;--border-radius:50%;--color:initial;--padding-start:8px;--padding-end:8px;width:48px;height:48px;font-size:24px}:host(.ion-color.ion-focused)::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.ion-color:hover) .button-native::after{background:var(--ion-color-base)}}";

const MenuButton = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.inheritedAttributes = {};
    this.visible = false;
    /**
     * If `true`, the user cannot interact with the menu button.
     */
    this.disabled = false;
    /**
     * Automatically hides the menu button when the corresponding menu is not active
     */
    this.autoHide = true;
    /**
     * The type of the button.
     */
    this.type = 'button';
    this.onClick = async () => {
      return index$1.menuController.toggle(this.menu);
    };
  }
  componentWillLoad() {
    this.inheritedAttributes = helpers.inheritAriaAttributes(this.el);
  }
  componentDidLoad() {
    this.visibilityChanged();
  }
  async visibilityChanged() {
    this.visible = await menuToggleUtil.updateVisibility(this.menu);
  }
  render() {
    const { color, disabled, inheritedAttributes } = this;
    const mode = ionicGlobal.getIonMode(this);
    const menuIcon = ionicGlobal.config.get('menuIcon', mode === 'ios' ? index$2.menuOutline : index$2.menuSharp);
    const hidden = this.autoHide && !this.visible;
    const attrs = {
      type: this.type,
    };
    const ariaLabel = inheritedAttributes['aria-label'] || 'menu';
    return (index.h(index.Host, { onClick: this.onClick, "aria-disabled": disabled ? 'true' : null, "aria-hidden": hidden ? 'true' : null, class: theme.createColorClasses(color, {
        [mode]: true,
        button: true,
        'menu-button-hidden': hidden,
        'menu-button-disabled': disabled,
        'in-toolbar': theme.hostContext('ion-toolbar', this.el),
        'in-toolbar-color': theme.hostContext('ion-toolbar[color]', this.el),
        'ion-activatable': true,
        'ion-focusable': true,
      }) }, index.h("button", Object.assign({}, attrs, { disabled: disabled, class: "button-native", part: "native", "aria-label": ariaLabel }), index.h("span", { class: "button-inner" }, index.h("slot", null, index.h("ion-icon", { part: "icon", icon: menuIcon, mode: mode, lazy: false, "aria-hidden": "true" }))), mode === 'md' && index.h("ion-ripple-effect", { type: "unbounded" }))));
  }
  get el() { return index.getElement(this); }
};
MenuButton.style = {
  ios: menuButtonIosCss,
  md: menuButtonMdCss
};

const routerLinkCss = ":host{--background:transparent;--color:var(--ion-color-primary, #3880ff);background:var(--background);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}a{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit}";

const RouterLink = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    /**
     * When using a router, it specifies the transition direction when navigating to
     * another page using `href`.
     */
    this.routerDirection = 'forward';
    this.onClick = (ev) => {
      theme.openURL(this.href, ev, this.routerDirection, this.routerAnimation);
    };
  }
  render() {
    const mode = ionicGlobal.getIonMode(this);
    const attrs = {
      href: this.href,
      rel: this.rel,
      target: this.target,
    };
    return (index.h(index.Host, { onClick: this.onClick, class: theme.createColorClasses(this.color, {
        [mode]: true,
        'ion-activatable': true,
      }) }, index.h("a", Object.assign({}, attrs), index.h("slot", null))));
  }
};
RouterLink.style = routerLinkCss;

exports.fireenjin_chip_bar = ChipBar;
exports.floodteam_navigation_footer = NavigationFooter;
exports.floodteam_pin_bar = AppHeader;
exports.ion_menu_button = MenuButton;
exports.ion_router_link = RouterLink;
