{"ast":null,"code":"import React, { useContext, useRef, useEffect, Fragment, useMemo, useState } from 'react';\nimport { defineCustomElements } from '@ionic/core/loader';\nimport { addIcons } from 'ionicons';\nimport { arrowBackSharp, caretBackSharp, chevronBack, chevronForward, close, closeCircle, closeSharp, menuOutline, menuSharp, reorderTwoSharp, reorderThreeOutline, searchOutline, searchSharp } from 'ionicons/icons';\nimport { isPlatform as isPlatform$1, getPlatforms as getPlatforms$1, alertController, loadingController, toastController as toastController$1, pickerController, actionSheetController as actionSheetController$1, modalController, popoverController, createAnimation } from '@ionic/core';\nexport { IonicSafeString, createAnimation, createGesture, iosTransitionAnimation, mdTransitionAnimation, setupConfig } from '@ionic/core';\nimport { __rest } from 'tslib';\nimport ReactDOM from 'react-dom';\nconst IonLifeCycleContext = /*@__PURE__*/React.createContext({\n  onIonViewWillEnter: () => {\n    return;\n  },\n  ionViewWillEnter: () => {\n    return;\n  },\n  onIonViewDidEnter: () => {\n    return;\n  },\n  ionViewDidEnter: () => {\n    return;\n  },\n  onIonViewWillLeave: () => {\n    return;\n  },\n  ionViewWillLeave: () => {\n    return;\n  },\n  onIonViewDidLeave: () => {\n    return;\n  },\n  ionViewDidLeave: () => {\n    return;\n  }\n});\nconst DefaultIonLifeCycleContext = class {\n  constructor() {\n    this.ionViewWillEnterCallbacks = [];\n    this.ionViewDidEnterCallbacks = [];\n    this.ionViewWillLeaveCallbacks = [];\n    this.ionViewDidLeaveCallbacks = [];\n  }\n\n  onIonViewWillEnter(callback) {\n    if (callback.id) {\n      const index = this.ionViewWillEnterCallbacks.findIndex(x => x.id === callback.id);\n\n      if (index > -1) {\n        this.ionViewWillEnterCallbacks[index] = callback;\n      } else {\n        this.ionViewWillEnterCallbacks.push(callback);\n      }\n    } else {\n      this.ionViewWillEnterCallbacks.push(callback);\n    }\n  }\n\n  ionViewWillEnter() {\n    this.ionViewWillEnterCallbacks.forEach(cb => cb());\n  }\n\n  onIonViewDidEnter(callback) {\n    if (callback.id) {\n      const index = this.ionViewDidEnterCallbacks.findIndex(x => x.id === callback.id);\n\n      if (index > -1) {\n        this.ionViewDidEnterCallbacks[index] = callback;\n      } else {\n        this.ionViewDidEnterCallbacks.push(callback);\n      }\n    } else {\n      this.ionViewDidEnterCallbacks.push(callback);\n    }\n  }\n\n  ionViewDidEnter() {\n    this.ionViewDidEnterCallbacks.forEach(cb => cb());\n  }\n\n  onIonViewWillLeave(callback) {\n    if (callback.id) {\n      const index = this.ionViewWillLeaveCallbacks.findIndex(x => x.id === callback.id);\n\n      if (index > -1) {\n        this.ionViewWillLeaveCallbacks[index] = callback;\n      } else {\n        this.ionViewWillLeaveCallbacks.push(callback);\n      }\n    } else {\n      this.ionViewWillLeaveCallbacks.push(callback);\n    }\n  }\n\n  ionViewWillLeave() {\n    this.ionViewWillLeaveCallbacks.forEach(cb => cb());\n  }\n\n  onIonViewDidLeave(callback) {\n    if (callback.id) {\n      const index = this.ionViewDidLeaveCallbacks.findIndex(x => x.id === callback.id);\n\n      if (index > -1) {\n        this.ionViewDidLeaveCallbacks[index] = callback;\n      } else {\n        this.ionViewDidLeaveCallbacks.push(callback);\n      }\n    } else {\n      this.ionViewDidLeaveCallbacks.push(callback);\n    }\n  }\n\n  ionViewDidLeave() {\n    this.ionViewDidLeaveCallbacks.forEach(cb => cb());\n    this.componentCanBeDestroyed();\n  }\n\n  onComponentCanBeDestroyed(callback) {\n    this.componentCanBeDestroyedCallback = callback;\n  }\n\n  componentCanBeDestroyed() {\n    if (this.componentCanBeDestroyedCallback) {\n      this.componentCanBeDestroyedCallback();\n    }\n  }\n\n};\n\nconst withIonLifeCycle = WrappedComponent => {\n  return class IonLifeCycle extends React.Component {\n    constructor(props) {\n      super(props);\n      this.componentRef = React.createRef();\n    }\n\n    componentDidMount() {\n      const element = this.componentRef.current;\n      this.context.onIonViewWillEnter(() => {\n        if (element && element.ionViewWillEnter) {\n          element.ionViewWillEnter();\n        }\n      });\n      this.context.onIonViewDidEnter(() => {\n        if (element && element.ionViewDidEnter) {\n          element.ionViewDidEnter();\n        }\n      });\n      this.context.onIonViewWillLeave(() => {\n        if (element && element.ionViewWillLeave) {\n          element.ionViewWillLeave();\n        }\n      });\n      this.context.onIonViewDidLeave(() => {\n        if (element && element.ionViewDidLeave) {\n          element.ionViewDidLeave();\n        }\n      });\n    }\n\n    render() {\n      return React.createElement(IonLifeCycleContext.Consumer, null, context => {\n        this.context = context;\n        return React.createElement(WrappedComponent, Object.assign({\n          ref: this.componentRef\n        }, this.props));\n      });\n    }\n\n  };\n};\n\nconst useIonViewWillEnter = (callback, deps = []) => {\n  const context = useContext(IonLifeCycleContext);\n  const id = useRef();\n  id.current = id.current || Math.floor(Math.random() * 1000000);\n  useEffect(() => {\n    callback.id = id.current;\n    context.onIonViewWillEnter(callback);\n  }, deps);\n};\n\nconst useIonViewDidEnter = (callback, deps = []) => {\n  const context = useContext(IonLifeCycleContext);\n  const id = useRef();\n  id.current = id.current || Math.floor(Math.random() * 1000000);\n  useEffect(() => {\n    callback.id = id.current;\n    context.onIonViewDidEnter(callback);\n  }, deps);\n};\n\nconst useIonViewWillLeave = (callback, deps = []) => {\n  const context = useContext(IonLifeCycleContext);\n  const id = useRef();\n  id.current = id.current || Math.floor(Math.random() * 1000000);\n  useEffect(() => {\n    callback.id = id.current;\n    context.onIonViewWillLeave(callback);\n  }, deps);\n};\n\nconst useIonViewDidLeave = (callback, deps = []) => {\n  const context = useContext(IonLifeCycleContext);\n  const id = useRef();\n  id.current = id.current || Math.floor(Math.random() * 1000000);\n  useEffect(() => {\n    callback.id = id.current;\n    context.onIonViewDidLeave(callback);\n  }, deps);\n};\n\nconst NavContext = /*@__PURE__*/React.createContext({\n  getIonRedirect: () => undefined,\n  getIonRoute: () => undefined,\n  getPageManager: () => undefined,\n  getStackManager: () => undefined,\n  goBack: route => {\n    if (typeof window !== 'undefined') {\n      if (typeof route === 'string') {\n        window.location.pathname = route;\n      } else {\n        window.history.back();\n      }\n    }\n  },\n  navigate: path => {\n    if (typeof window !== 'undefined') {\n      window.location.pathname = path;\n    }\n  },\n  hasIonicRouter: () => false,\n  routeInfo: undefined,\n  setCurrentTab: () => undefined,\n  changeTab: (_tab, path) => {\n    if (typeof window !== 'undefined') {\n      window.location.pathname = path;\n    }\n  },\n  resetTab: (_tab, path) => {\n    if (typeof window !== 'undefined') {\n      window.location.pathname = path;\n    }\n  }\n});\n\nconst dashToPascalCase = str => str.toLowerCase().split('-').map(segment => segment.charAt(0).toUpperCase() + segment.slice(1)).join('');\n\nconst camelToDashCase = str => str.replace(/([A-Z])/g, m => `-${m[0].toLowerCase()}`);\n\nconst attachProps = (node, newProps, oldProps = {}) => {\n  // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n  if (node instanceof Element) {\n    // add any classes in className to the class list\n    const className = getClassName(node.classList, newProps, oldProps);\n\n    if (className !== '') {\n      node.className = className;\n    }\n\n    Object.keys(newProps).forEach(name => {\n      if (name === 'children' || name === 'style' || name === 'ref' || name === 'class' || name === 'className' || name === 'forwardedRef') {\n        return;\n      }\n\n      if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n        const eventName = name.substring(2);\n        const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n        if (!isCoveredByReact(eventNameLc)) {\n          syncEvent(node, eventNameLc, newProps[name]);\n        }\n      } else {\n        const propType = typeof newProps[name];\n\n        if (propType === 'string') {\n          node.setAttribute(camelToDashCase(name), newProps[name]);\n        } else {\n          node[name] = newProps[name];\n        }\n      }\n    });\n  }\n};\n\nconst getClassName = (classList, newProps, oldProps) => {\n  const newClassProp = newProps.className || newProps.class;\n  const oldClassProp = oldProps.className || oldProps.class; // map the classes to Maps for performance\n\n  const currentClasses = arrayToMap(classList);\n  const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n  const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n  const finalClassNames = []; // loop through each of the current classes on the component\n  // to see if it should be a part of the classNames added\n\n  currentClasses.forEach(currentClass => {\n    if (incomingPropClasses.has(currentClass)) {\n      // add it as its already included in classnames coming in from newProps\n      finalClassNames.push(currentClass);\n      incomingPropClasses.delete(currentClass);\n    } else if (!oldPropClasses.has(currentClass)) {\n      // add it as it has NOT been removed by user\n      finalClassNames.push(currentClass);\n    }\n  });\n  incomingPropClasses.forEach(s => finalClassNames.push(s));\n  return finalClassNames.join(' ');\n};\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\n\n\nconst isCoveredByReact = eventNameSuffix => {\n  if (typeof document === 'undefined') {\n    return true;\n  } else {\n    const eventName = 'on' + eventNameSuffix;\n    let isSupported = (eventName in document);\n\n    if (!isSupported) {\n      const element = document.createElement('div');\n      element.setAttribute(eventName, 'return;');\n      isSupported = typeof element[eventName] === 'function';\n    }\n\n    return isSupported;\n  }\n};\n\nconst syncEvent = (node, eventName, newEventHandler) => {\n  const eventStore = node.__events || (node.__events = {});\n  const oldEventHandler = eventStore[eventName]; // Remove old listener so they don't double up.\n\n  if (oldEventHandler) {\n    node.removeEventListener(eventName, oldEventHandler);\n  } // Bind new listener.\n\n\n  node.addEventListener(eventName, eventStore[eventName] = function handler(e) {\n    if (newEventHandler) {\n      newEventHandler.call(this, e);\n    }\n  });\n};\n\nconst arrayToMap = arr => {\n  const map = new Map();\n  arr.forEach(s => map.set(s, s));\n  return map;\n};\n\nconst createForwardRef = (ReactComponent, displayName) => {\n  const forwardRef = (props, ref) => {\n    return React.createElement(ReactComponent, Object.assign({}, props, {\n      forwardedRef: ref\n    }));\n  };\n\n  forwardRef.displayName = displayName;\n  return React.forwardRef(forwardRef);\n};\n\nconst setRef = (ref, value) => {\n  if (typeof ref === 'function') {\n    ref(value);\n  } else if (ref != null) {\n    // Cast as a MutableRef so we can assign current\n    ref.current = value;\n  }\n};\n\nconst mergeRefs = (...refs) => {\n  return value => {\n    refs.forEach(ref => {\n      setRef(ref, value);\n    });\n  };\n};\n\nconst isPlatform = platform => {\n  return isPlatform$1(window, platform);\n};\n\nconst getPlatforms = () => {\n  return getPlatforms$1(window);\n};\n\nconst getConfig = () => {\n  if (typeof window !== 'undefined') {\n    const Ionic = window.Ionic;\n\n    if (Ionic && Ionic.config) {\n      return Ionic.config;\n    }\n  }\n\n  return null;\n};\n\nconst createReactComponent = (tagName, routerLinkComponent = false) => {\n  const displayName = dashToPascalCase(tagName);\n  const ReactComponent = class extends React.Component {\n    constructor(props) {\n      super(props);\n\n      this.handleClick = e => {\n        const {\n          routerLink,\n          routerDirection,\n          routerOptions,\n          routerAnimation\n        } = this.props;\n\n        if (routerLink !== undefined) {\n          e.preventDefault();\n          this.context.navigate(routerLink, routerDirection, undefined, routerAnimation, routerOptions);\n        }\n      }; // Create a local ref to to attach props to the wrapped element.\n\n\n      this.ref = React.createRef(); // React refs must be stable (not created inline).\n\n      this.stableMergedRefs = mergeRefs(this.ref, this.props.forwardedRef);\n    }\n\n    componentDidMount() {\n      this.componentDidUpdate(this.props);\n    }\n\n    componentDidUpdate(prevProps) {\n      const node = this.ref.current;\n      attachProps(node, this.props, prevProps);\n    }\n\n    render() {\n      const _a = this.props,\n            {\n        children,\n        forwardedRef,\n        style,\n        className,\n        ref\n      } = _a,\n            cProps = __rest(_a, [\"children\", \"forwardedRef\", \"style\", \"className\", \"ref\"]);\n\n      const propsToPass = Object.keys(cProps).reduce((acc, name) => {\n        if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n          const eventName = name.substring(2).toLowerCase();\n\n          if (isCoveredByReact(eventName)) {\n            acc[name] = cProps[name];\n          }\n        } else if (['string', 'boolean', 'number'].includes(typeof cProps[name])) {\n          acc[camelToDashCase(name)] = cProps[name];\n        }\n\n        return acc;\n      }, {});\n      const newProps = Object.assign(Object.assign({}, propsToPass), {\n        ref: this.stableMergedRefs,\n        style\n      });\n\n      if (routerLinkComponent) {\n        if (this.props.routerLink && !this.props.href) {\n          newProps.href = this.props.routerLink;\n        }\n\n        if (newProps.onClick) {\n          const oldClick = newProps.onClick;\n\n          newProps.onClick = e => {\n            oldClick(e);\n\n            if (!e.defaultPrevented) {\n              this.handleClick(e);\n            }\n          };\n        } else {\n          newProps.onClick = this.handleClick;\n        }\n      }\n\n      return React.createElement(tagName, newProps, children);\n    }\n\n    static get displayName() {\n      return displayName;\n    }\n\n    static get contextType() {\n      return NavContext;\n    }\n\n  };\n  return createForwardRef(ReactComponent, displayName);\n}; // ionic/core\n\n\nconst IonApp = /*@__PURE__*/createReactComponent('ion-app');\nconst IonTab = /*@__PURE__*/createReactComponent('ion-tab');\nconst IonRouterLink = /*@__PURE__*/createReactComponent('ion-router-link', true);\nconst IonAvatar = /*@__PURE__*/createReactComponent('ion-avatar');\nconst IonBackdrop = /*@__PURE__*/createReactComponent('ion-backdrop');\nconst IonBadge = /*@__PURE__*/createReactComponent('ion-badge');\nconst IonButton = /*@__PURE__*/createReactComponent('ion-button', true);\nconst IonButtons = /*@__PURE__*/createReactComponent('ion-buttons');\nconst IonCard = /*@__PURE__*/createReactComponent('ion-card', true);\nconst IonCardContent = /*@__PURE__*/createReactComponent('ion-card-content');\nconst IonCardHeader = /*@__PURE__*/createReactComponent('ion-card-header');\nconst IonCardSubtitle = /*@__PURE__*/createReactComponent('ion-card-subtitle');\nconst IonCardTitle = /*@__PURE__*/createReactComponent('ion-card-title');\nconst IonCheckbox = /*@__PURE__*/createReactComponent('ion-checkbox');\nconst IonCol = /*@__PURE__*/createReactComponent('ion-col');\nconst IonContent = /*@__PURE__*/createReactComponent('ion-content');\nconst IonChip = /*@__PURE__*/createReactComponent('ion-chip');\nconst IonDatetime = /*@__PURE__*/createReactComponent('ion-datetime');\nconst IonFab = /*@__PURE__*/createReactComponent('ion-fab');\nconst IonFabButton = /*@__PURE__*/createReactComponent('ion-fab-button', true);\nconst IonFabList = /*@__PURE__*/createReactComponent('ion-fab-list');\nconst IonFooter = /*@__PURE__*/createReactComponent('ion-footer');\nconst IonGrid = /*@__PURE__*/createReactComponent('ion-grid');\nconst IonHeader = /*@__PURE__*/createReactComponent('ion-header');\nconst IonImg = /*@__PURE__*/createReactComponent('ion-img');\nconst IonInfiniteScroll = /*@__PURE__*/createReactComponent('ion-infinite-scroll');\nconst IonInfiniteScrollContent = /*@__PURE__*/createReactComponent('ion-infinite-scroll-content');\nconst IonInput = /*@__PURE__*/createReactComponent('ion-input');\nconst IonItem = /*@__PURE__*/createReactComponent('ion-item', true);\nconst IonItemDivider = /*@__PURE__*/createReactComponent('ion-item-divider');\nconst IonItemGroup = /*@__PURE__*/createReactComponent('ion-item-group');\nconst IonItemOption = /*@__PURE__*/createReactComponent('ion-item-option', true);\nconst IonItemOptions = /*@__PURE__*/createReactComponent('ion-item-options');\nconst IonItemSliding = /*@__PURE__*/createReactComponent('ion-item-sliding');\nconst IonLabel = /*@__PURE__*/createReactComponent('ion-label');\nconst IonList = /*@__PURE__*/createReactComponent('ion-list');\nconst IonListHeader = /*@__PURE__*/createReactComponent('ion-list-header');\nconst IonMenu = /*@__PURE__*/createReactComponent('ion-menu');\nconst IonMenuButton = /*@__PURE__*/createReactComponent('ion-menu-button');\nconst IonMenuToggle = /*@__PURE__*/createReactComponent('ion-menu-toggle');\nconst IonNote = /*@__PURE__*/createReactComponent('ion-note');\nconst IonPickerColumn = /*@__PURE__*/createReactComponent('ion-picker-column');\nconst IonNav = /*@__PURE__*/createReactComponent('ion-nav');\nconst IonProgressBar = /*@__PURE__*/createReactComponent('ion-progress-bar');\nconst IonRadio = /*@__PURE__*/createReactComponent('ion-radio');\nconst IonRadioGroup = /*@__PURE__*/createReactComponent('ion-radio-group');\nconst IonRange = /*@__PURE__*/createReactComponent('ion-range');\nconst IonRefresher = /*@__PURE__*/createReactComponent('ion-refresher');\nconst IonRefresherContent = /*@__PURE__*/createReactComponent('ion-refresher-content');\nconst IonReorder = /*@__PURE__*/createReactComponent('ion-reorder');\nconst IonReorderGroup = /*@__PURE__*/createReactComponent('ion-reorder-group');\nconst IonRippleEffect = /*@__PURE__*/createReactComponent('ion-ripple-effect');\nconst IonRow = /*@__PURE__*/createReactComponent('ion-row');\nconst IonSearchbar = /*@__PURE__*/createReactComponent('ion-searchbar');\nconst IonSegment = /*@__PURE__*/createReactComponent('ion-segment');\nconst IonSegmentButton = /*@__PURE__*/createReactComponent('ion-segment-button');\nconst IonSelect = /*@__PURE__*/createReactComponent('ion-select');\nconst IonSelectOption = /*@__PURE__*/createReactComponent('ion-select-option');\nconst IonSelectPopover = /*@__PURE__*/createReactComponent('ion-select-popover');\nconst IonSkeletonText = /*@__PURE__*/createReactComponent('ion-skeleton-text');\nconst IonSlide = /*@__PURE__*/createReactComponent('ion-slide');\nconst IonSlides = /*@__PURE__*/createReactComponent('ion-slides');\nconst IonSpinner = /*@__PURE__*/createReactComponent('ion-spinner');\nconst IonSplitPane = /*@__PURE__*/createReactComponent('ion-split-pane');\nconst IonText = /*@__PURE__*/createReactComponent('ion-text');\nconst IonTextarea = /*@__PURE__*/createReactComponent('ion-textarea');\nconst IonThumbnail = /*@__PURE__*/createReactComponent('ion-thumbnail');\nconst IonTitle = /*@__PURE__*/createReactComponent('ion-title');\nconst IonToggle = /*@__PURE__*/createReactComponent('ion-toggle');\nconst IonToolbar = /*@__PURE__*/createReactComponent('ion-toolbar');\nconst IonVirtualScroll = /*@__PURE__*/createReactComponent('ion-virtual-scroll');\n\nconst createControllerComponent = (displayName, controller) => {\n  const didDismissEventName = `on${displayName}DidDismiss`;\n  const didPresentEventName = `on${displayName}DidPresent`;\n  const willDismissEventName = `on${displayName}WillDismiss`;\n  const willPresentEventName = `on${displayName}WillPresent`;\n\n  class Overlay extends React.Component {\n    constructor(props) {\n      super(props);\n      this.isUnmounted = false;\n      this.handleDismiss = this.handleDismiss.bind(this);\n    }\n\n    static get displayName() {\n      return displayName;\n    }\n\n    async componentDidMount() {\n      const {\n        isOpen\n      } = this.props;\n\n      if (isOpen) {\n        this.present();\n      }\n    }\n\n    componentWillUnmount() {\n      this.isUnmounted = true;\n\n      if (this.overlay) {\n        this.overlay.dismiss();\n      }\n    }\n\n    async componentDidUpdate(prevProps) {\n      if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {\n        this.present(prevProps);\n      }\n\n      if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {\n        await this.overlay.dismiss();\n      }\n    }\n\n    handleDismiss(event) {\n      if (this.props.onDidDismiss) {\n        this.props.onDidDismiss(event);\n      }\n\n      setRef(this.props.forwardedRef, null);\n    }\n\n    async present(prevProps) {\n      const _a = this.props,\n            cProps = __rest(_a, [\"isOpen\", \"onDidDismiss\", \"onDidPresent\", \"onWillDismiss\", \"onWillPresent\"]);\n\n      this.overlay = await controller.create(Object.assign({}, cProps));\n      attachProps(this.overlay, {\n        [didDismissEventName]: this.handleDismiss,\n        [didPresentEventName]: e => this.props.onDidPresent && this.props.onDidPresent(e),\n        [willDismissEventName]: e => this.props.onWillDismiss && this.props.onWillDismiss(e),\n        [willPresentEventName]: e => this.props.onWillPresent && this.props.onWillPresent(e)\n      }, prevProps); // Check isOpen again since the value could have changed during the async call to controller.create\n      // It's also possible for the component to have become unmounted.\n\n      if (this.props.isOpen === true && this.isUnmounted === false) {\n        setRef(this.props.forwardedRef, this.overlay);\n        await this.overlay.present();\n      }\n    }\n\n    render() {\n      return null;\n    }\n\n  }\n\n  return React.forwardRef((props, ref) => {\n    return React.createElement(Overlay, Object.assign({}, props, {\n      forwardedRef: ref\n    }));\n  });\n};\n\nconst IonAlert = /*@__PURE__*/createControllerComponent('IonAlert', alertController);\nconst IonLoading = /*@__PURE__*/createControllerComponent('IonLoading', loadingController);\nconst toastController = {\n  create: options => toastController$1.create(options),\n  dismiss: (data, role, id) => toastController$1.dismiss(data, role, id),\n  getTop: () => toastController$1.getTop()\n};\nconst IonToast = /*@__PURE__*/createControllerComponent('IonToast', toastController);\nconst IonPicker = /*@__PURE__*/createControllerComponent('IonPicker', pickerController);\n\nconst createOverlayComponent = (displayName, controller) => {\n  const didDismissEventName = `on${displayName}DidDismiss`;\n  const didPresentEventName = `on${displayName}DidPresent`;\n  const willDismissEventName = `on${displayName}WillDismiss`;\n  const willPresentEventName = `on${displayName}WillPresent`;\n  let isDismissing = false;\n\n  class Overlay extends React.Component {\n    constructor(props) {\n      super(props);\n\n      if (typeof document !== 'undefined') {\n        this.el = document.createElement('div');\n      }\n\n      this.handleDismiss = this.handleDismiss.bind(this);\n    }\n\n    static get displayName() {\n      return displayName;\n    }\n\n    componentDidMount() {\n      if (this.props.isOpen) {\n        this.present();\n      }\n    }\n\n    componentWillUnmount() {\n      if (this.overlay) {\n        this.overlay.dismiss();\n      }\n    }\n\n    handleDismiss(event) {\n      if (this.props.onDidDismiss) {\n        this.props.onDidDismiss(event);\n      }\n\n      setRef(this.props.forwardedRef, null);\n    }\n\n    shouldComponentUpdate(nextProps) {\n      // Check if the overlay component is about to dismiss\n      if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {\n        isDismissing = true;\n      }\n\n      return true;\n    }\n\n    async componentDidUpdate(prevProps) {\n      if (this.overlay) {\n        attachProps(this.overlay, this.props, prevProps);\n      }\n\n      if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {\n        this.present(prevProps);\n      }\n\n      if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {\n        await this.overlay.dismiss();\n        isDismissing = false;\n        /**\n         * Now that the overlay is dismissed\n         * we need to render again so that any\n         * inner components will be unmounted\n         */\n\n        this.forceUpdate();\n      }\n    }\n\n    async present(prevProps) {\n      const _a = this.props,\n            cProps = __rest(_a, [\"children\", \"isOpen\", \"onDidDismiss\", \"onDidPresent\", \"onWillDismiss\", \"onWillPresent\"]);\n\n      const elementProps = Object.assign(Object.assign({}, cProps), {\n        ref: this.props.forwardedRef,\n        [didDismissEventName]: this.handleDismiss,\n        [didPresentEventName]: e => this.props.onDidPresent && this.props.onDidPresent(e),\n        [willDismissEventName]: e => this.props.onWillDismiss && this.props.onWillDismiss(e),\n        [willPresentEventName]: e => this.props.onWillPresent && this.props.onWillPresent(e)\n      });\n      this.overlay = await controller.create(Object.assign(Object.assign({}, elementProps), {\n        component: this.el,\n        componentProps: {}\n      }));\n      setRef(this.props.forwardedRef, this.overlay);\n      attachProps(this.overlay, elementProps, prevProps);\n      await this.overlay.present();\n    }\n\n    render() {\n      /**\n       * Continue to render the component even when\n       * overlay is dismissing otherwise component\n       * will be hidden before animation is done.\n       */\n      return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);\n    }\n\n  }\n\n  return React.forwardRef((props, ref) => {\n    return React.createElement(Overlay, Object.assign({}, props, {\n      forwardedRef: ref\n    }));\n  });\n};\n\nconst actionSheetController = {\n  create: options => actionSheetController$1.create(options),\n  dismiss: (data, role, id) => actionSheetController$1.dismiss(data, role, id),\n  getTop: () => actionSheetController$1.getTop()\n};\nconst IonActionSheet = /*@__PURE__*/createOverlayComponent('IonActionSheet', actionSheetController);\nconst IonModal = /*@__PURE__*/createOverlayComponent('IonModal', modalController);\nconst IonPopover = /*@__PURE__*/createOverlayComponent('IonPopover', popoverController);\nconst StackContext = React.createContext({\n  registerIonPage: () => undefined,\n  isInOutlet: () => false\n});\n\nclass PageManager extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.ionPageElementRef = React.createRef(); // React refs must be stable (not created inline).\n\n    this.stableMergedRefs = mergeRefs(this.ionPageElementRef, this.props.forwardedRef);\n  }\n\n  componentDidMount() {\n    if (this.ionPageElementRef.current) {\n      if (this.context.isInOutlet()) {\n        this.ionPageElementRef.current.classList.add('ion-page-invisible');\n      }\n\n      this.context.registerIonPage(this.ionPageElementRef.current, this.props.routeInfo);\n      this.ionPageElementRef.current.addEventListener('ionViewWillEnter', this.ionViewWillEnterHandler.bind(this));\n      this.ionPageElementRef.current.addEventListener('ionViewDidEnter', this.ionViewDidEnterHandler.bind(this));\n      this.ionPageElementRef.current.addEventListener('ionViewWillLeave', this.ionViewWillLeaveHandler.bind(this));\n      this.ionPageElementRef.current.addEventListener('ionViewDidLeave', this.ionViewDidLeaveHandler.bind(this));\n    }\n  }\n\n  componentWillUnmount() {\n    if (this.ionPageElementRef.current) {\n      this.ionPageElementRef.current.removeEventListener('ionViewWillEnter', this.ionViewWillEnterHandler.bind(this));\n      this.ionPageElementRef.current.removeEventListener('ionViewDidEnter', this.ionViewDidEnterHandler.bind(this));\n      this.ionPageElementRef.current.removeEventListener('ionViewWillLeave', this.ionViewWillLeaveHandler.bind(this));\n      this.ionPageElementRef.current.removeEventListener('ionViewDidLeave', this.ionViewDidLeaveHandler.bind(this));\n    }\n  }\n\n  ionViewWillEnterHandler() {\n    this.ionLifeCycleContext.ionViewWillEnter();\n  }\n\n  ionViewDidEnterHandler() {\n    this.ionLifeCycleContext.ionViewDidEnter();\n  }\n\n  ionViewWillLeaveHandler() {\n    this.ionLifeCycleContext.ionViewWillLeave();\n  }\n\n  ionViewDidLeaveHandler() {\n    this.ionLifeCycleContext.ionViewDidLeave();\n  }\n\n  render() {\n    const _a = this.props,\n          {\n      className,\n      children,\n      routeInfo,\n      forwardedRef\n    } = _a,\n          props = __rest(_a, [\"className\", \"children\", \"routeInfo\", \"forwardedRef\"]);\n\n    return React.createElement(IonLifeCycleContext.Consumer, null, context => {\n      this.ionLifeCycleContext = context;\n      return React.createElement(\"div\", Object.assign({\n        className: className ? `${className} ion-page` : `ion-page`,\n        ref: this.stableMergedRefs\n      }, props), children);\n    });\n  }\n\n  static get contextType() {\n    return StackContext;\n  }\n\n}\n\nclass IonPageInternal extends React.Component {\n  constructor(props) {\n    super(props);\n  }\n\n  render() {\n    const _a = this.props,\n          {\n      className,\n      children,\n      forwardedRef\n    } = _a,\n          props = __rest(_a, [\"className\", \"children\", \"forwardedRef\"]);\n\n    return this.context.hasIonicRouter() ? React.createElement(PageManager, Object.assign({\n      className: className ? `${className}` : '',\n      routeInfo: this.context.routeInfo,\n      forwardedRef: forwardedRef\n    }, props), children) : React.createElement(\"div\", Object.assign({\n      className: className ? `ion-page ${className}` : 'ion-page',\n      ref: forwardedRef\n    }, props), children);\n  }\n\n  static get displayName() {\n    return 'IonPage';\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n\n}\n\nconst IonPage = createForwardRef(IonPageInternal, 'IonPage');\nconst IonTabsContext = React.createContext({\n  activeTab: undefined,\n  selectTab: () => false\n});\nconst IonTabButtonInner = /*@__PURE__*/createReactComponent('ion-tab-button');\nconst IonTabBarInner = /*@__PURE__*/createReactComponent('ion-tab-bar');\nconst IonBackButtonInner = /*@__PURE__*/createReactComponent('ion-back-button');\nconst IonRouterOutletInner = /*@__PURE__*/createReactComponent('ion-router-outlet'); // ionicons\n\nconst IonIconInner = /*@__PURE__*/createReactComponent('ion-icon');\n\nclass OutletPageManager extends React.Component {\n  constructor(props) {\n    super(props);\n  }\n\n  componentDidMount() {\n    if (this.ionRouterOutlet) {\n      setTimeout(() => {\n        this.context.registerIonPage(this.ionRouterOutlet, this.props.routeInfo);\n      }, 25);\n      this.ionRouterOutlet.addEventListener('ionViewWillEnter', this.ionViewWillEnterHandler.bind(this));\n      this.ionRouterOutlet.addEventListener('ionViewDidEnter', this.ionViewDidEnterHandler.bind(this));\n      this.ionRouterOutlet.addEventListener('ionViewWillLeave', this.ionViewWillLeaveHandler.bind(this));\n      this.ionRouterOutlet.addEventListener('ionViewDidLeave', this.ionViewDidLeaveHandler.bind(this));\n    }\n  }\n\n  componentWillUnmount() {\n    if (this.ionRouterOutlet) {\n      this.ionRouterOutlet.removeEventListener('ionViewWillEnter', this.ionViewWillEnterHandler.bind(this));\n      this.ionRouterOutlet.removeEventListener('ionViewDidEnter', this.ionViewDidEnterHandler.bind(this));\n      this.ionRouterOutlet.removeEventListener('ionViewWillLeave', this.ionViewWillLeaveHandler.bind(this));\n      this.ionRouterOutlet.removeEventListener('ionViewDidLeave', this.ionViewDidLeaveHandler.bind(this));\n    }\n  }\n\n  ionViewWillEnterHandler() {\n    this.ionLifeCycleContext.ionViewWillEnter();\n  }\n\n  ionViewDidEnterHandler() {\n    this.ionLifeCycleContext.ionViewDidEnter();\n  }\n\n  ionViewWillLeaveHandler() {\n    this.ionLifeCycleContext.ionViewWillLeave();\n  }\n\n  ionViewDidLeaveHandler() {\n    this.ionLifeCycleContext.ionViewDidLeave();\n  }\n\n  render() {\n    const _a = this.props,\n          {\n      StackManager,\n      children,\n      routeInfo\n    } = _a,\n          props = __rest(_a, [\"StackManager\", \"children\", \"routeInfo\"]);\n\n    return React.createElement(IonLifeCycleContext.Consumer, null, context => {\n      this.ionLifeCycleContext = context;\n      return React.createElement(StackManager, {\n        routeInfo: routeInfo\n      }, React.createElement(IonRouterOutletInner, Object.assign({\n        setRef: val => this.ionRouterOutlet = val\n      }, props), children));\n    });\n  }\n\n  static get contextType() {\n    return StackContext;\n  }\n\n}\n\nclass IonRouterOutletContainer extends React.Component {\n  constructor(props) {\n    super(props);\n  }\n\n  render() {\n    const StackManager = this.context.getStackManager();\n\n    const _a = this.props,\n          {\n      children,\n      forwardedRef\n    } = _a,\n          props = __rest(_a, [\"children\", \"forwardedRef\"]);\n\n    return this.context.hasIonicRouter() ? props.ionPage ? React.createElement(OutletPageManager, Object.assign({\n      StackManager: StackManager,\n      routeInfo: this.context.routeInfo\n    }, props), children) : React.createElement(StackManager, {\n      routeInfo: this.context.routeInfo\n    }, React.createElement(IonRouterOutletInner, Object.assign({}, props, {\n      forwardedRef: forwardedRef\n    }), children)) : React.createElement(IonRouterOutletInner, Object.assign({\n      ref: forwardedRef\n    }, this.props), this.props.children);\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n\n}\n\nconst IonRouterOutlet = createForwardRef(IonRouterOutletContainer, 'IonRouterOutlet');\n\nclass IonTabButton extends React.Component {\n  constructor(props) {\n    super(props);\n    this.handleIonTabButtonClick = this.handleIonTabButtonClick.bind(this);\n  }\n\n  handleIonTabButtonClick() {\n    if (this.props.onClick) {\n      this.props.onClick(new CustomEvent('ionTabButtonClick', {\n        detail: {\n          tab: this.props.tab,\n          href: this.props.href,\n          routeOptions: this.props.routerOptions\n        }\n      }));\n    }\n  }\n\n  render() {\n    const _a = this.props,\n          rest = __rest(_a, [\"onClick\"]);\n\n    return React.createElement(IonTabButtonInner, Object.assign({\n      onIonTabButtonClick: this.handleIonTabButtonClick\n    }, rest));\n  }\n\n  static get displayName() {\n    return 'IonTabButton';\n  }\n\n}\n\nclass IonTabBarUnwrapped extends React.PureComponent {\n  constructor(props) {\n    super(props);\n\n    this.setActiveTabOnContext = _tab => {};\n\n    const tabs = {};\n    React.Children.forEach(props.children, child => {\n      var _a, _b, _c, _d;\n\n      if (child != null && typeof child === 'object' && child.props && (child.type === IonTabButton || child.type.isTabButton)) {\n        tabs[child.props.tab] = {\n          originalHref: child.props.href,\n          currentHref: child.props.href,\n          originalRouteOptions: child.props.href === ((_a = props.routeInfo) === null || _a === void 0 ? void 0 : _a.pathname) ? (_b = props.routeInfo) === null || _b === void 0 ? void 0 : _b.routeOptions : undefined,\n          currentRouteOptions: child.props.href === ((_c = props.routeInfo) === null || _c === void 0 ? void 0 : _c.pathname) ? (_d = props.routeInfo) === null || _d === void 0 ? void 0 : _d.routeOptions : undefined\n        };\n      }\n    });\n    this.state = {\n      tabs\n    };\n    this.onTabButtonClick = this.onTabButtonClick.bind(this);\n    this.renderTabButton = this.renderTabButton.bind(this);\n    this.setActiveTabOnContext = this.setActiveTabOnContext.bind(this);\n    this.selectTab = this.selectTab.bind(this);\n  }\n\n  componentDidMount() {\n    const tabs = this.state.tabs;\n    const tabKeys = Object.keys(tabs);\n    const activeTab = tabKeys.find(key => {\n      const href = tabs[key].originalHref;\n      return this.props.routeInfo.pathname.startsWith(href);\n    });\n\n    if (activeTab) {\n      this.setState({\n        activeTab\n      });\n    }\n  }\n\n  componentDidUpdate() {\n    if (this.state.activeTab) {\n      this.setActiveTabOnContext(this.state.activeTab);\n    }\n  }\n\n  selectTab(tab) {\n    const tabUrl = this.state.tabs[tab];\n\n    if (tabUrl) {\n      this.onTabButtonClick(new CustomEvent('ionTabButtonClick', {\n        detail: {\n          href: tabUrl.currentHref,\n          tab,\n          selected: tab === this.state.activeTab,\n          routeOptions: undefined\n        }\n      }));\n      return true;\n    }\n\n    return false;\n  }\n\n  static getDerivedStateFromProps(props, state) {\n    var _a, _b, _c;\n\n    const tabs = Object.assign({}, state.tabs);\n    const tabKeys = Object.keys(state.tabs);\n    const activeTab = tabKeys.find(key => {\n      const href = state.tabs[key].originalHref;\n      return props.routeInfo.pathname.startsWith(href);\n    }); // Check to see if the tab button href has changed, and if so, update it in the tabs state\n\n    React.Children.forEach(props.children, child => {\n      if (child != null && typeof child === 'object' && child.props && (child.type === IonTabButton || child.type.isTabButton)) {\n        const tab = tabs[child.props.tab];\n\n        if (!tab || tab.originalHref !== child.props.href) {\n          tabs[child.props.tab] = {\n            originalHref: child.props.href,\n            currentHref: child.props.href,\n            originalRouteOptions: child.props.routeOptions,\n            currentRouteOptions: child.props.routeOptions\n          };\n        }\n      }\n    });\n    const {\n      activeTab: prevActiveTab\n    } = state;\n\n    if (activeTab && prevActiveTab) {\n      const prevHref = state.tabs[prevActiveTab].currentHref;\n      const prevRouteOptions = state.tabs[prevActiveTab].currentRouteOptions;\n\n      if (activeTab !== prevActiveTab || prevHref !== ((_a = props.routeInfo) === null || _a === void 0 ? void 0 : _a.pathname) || prevRouteOptions !== ((_b = props.routeInfo) === null || _b === void 0 ? void 0 : _b.routeOptions)) {\n        tabs[activeTab] = {\n          originalHref: tabs[activeTab].originalHref,\n          currentHref: props.routeInfo.pathname + (props.routeInfo.search || ''),\n          originalRouteOptions: tabs[activeTab].originalRouteOptions,\n          currentRouteOptions: (_c = props.routeInfo) === null || _c === void 0 ? void 0 : _c.routeOptions\n        };\n\n        if (props.routeInfo.routeAction === 'pop' && activeTab !== prevActiveTab) {\n          // If navigating back and the tabs change, set the prev tab back to its original href\n          tabs[prevActiveTab] = {\n            originalHref: tabs[prevActiveTab].originalHref,\n            currentHref: tabs[prevActiveTab].originalHref,\n            originalRouteOptions: tabs[prevActiveTab].originalRouteOptions,\n            currentRouteOptions: tabs[prevActiveTab].currentRouteOptions\n          };\n        }\n      }\n    }\n\n    activeTab && props.onSetCurrentTab(activeTab, props.routeInfo);\n    return {\n      activeTab,\n      tabs\n    };\n  }\n\n  onTabButtonClick(e) {\n    const tappedTab = this.state.tabs[e.detail.tab];\n    const originalHref = tappedTab.originalHref;\n    const currentHref = e.detail.href;\n    const {\n      activeTab: prevActiveTab\n    } = this.state; // this.props.onSetCurrentTab(e.detail.tab, this.props.routeInfo);\n    // Clicking the current tab will bring you back to the original href\n\n    if (prevActiveTab === e.detail.tab) {\n      if (originalHref !== currentHref) {\n        this.context.resetTab(e.detail.tab, originalHref, tappedTab.originalRouteOptions);\n      }\n    } else {\n      if (this.props.onIonTabsWillChange) {\n        this.props.onIonTabsWillChange(new CustomEvent('ionTabWillChange', {\n          detail: {\n            tab: e.detail.tab\n          }\n        }));\n      }\n\n      if (this.props.onIonTabsDidChange) {\n        this.props.onIonTabsDidChange(new CustomEvent('ionTabDidChange', {\n          detail: {\n            tab: e.detail.tab\n          }\n        }));\n      }\n\n      this.setActiveTabOnContext(e.detail.tab);\n      this.context.changeTab(e.detail.tab, currentHref, e.detail.routeOptions);\n    }\n  }\n\n  renderTabButton(activeTab) {\n    return child => {\n      var _a, _b;\n\n      if (child != null && child.props && (child.type === IonTabButton || child.type.isTabButton)) {\n        const href = child.props.tab === activeTab ? (_a = this.props.routeInfo) === null || _a === void 0 ? void 0 : _a.pathname : this.state.tabs[child.props.tab].currentHref;\n        const routeOptions = child.props.tab === activeTab ? (_b = this.props.routeInfo) === null || _b === void 0 ? void 0 : _b.routeOptions : this.state.tabs[child.props.tab].currentRouteOptions;\n        return React.cloneElement(child, {\n          href,\n          routeOptions,\n          onClick: this.onTabButtonClick\n        });\n      }\n\n      return null;\n    };\n  }\n\n  render() {\n    const {\n      activeTab\n    } = this.state;\n    return React.createElement(IonTabBarInner, Object.assign({}, this.props, {\n      selectedTab: activeTab\n    }), React.Children.map(this.props.children, this.renderTabButton(activeTab)));\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n\n}\n\nconst IonTabBarContainer = React.memo(_a => {\n  var {\n    forwardedRef\n  } = _a,\n      props = __rest(_a, [\"forwardedRef\"]);\n\n  const context = useContext(NavContext);\n  return React.createElement(IonTabBarUnwrapped, Object.assign({\n    ref: forwardedRef\n  }, props, {\n    routeInfo: props.routeInfo || context.routeInfo || {\n      pathname: window.location.pathname\n    },\n    onSetCurrentTab: context.setCurrentTab\n  }), props.children);\n});\nconst IonTabBar = createForwardRef(IonTabBarContainer, 'IonTabBar');\n\nclass IonTabsElement extends HTMLElement {\n  constructor() {\n    super();\n  }\n\n}\n\nif (window && window.customElements) {\n  const element = customElements.get('ion-tabs');\n\n  if (!element) {\n    customElements.define('ion-tabs', IonTabsElement);\n  }\n}\n\nconst hostStyles = {\n  display: 'flex',\n  position: 'absolute',\n  top: '0',\n  left: '0',\n  right: '0',\n  bottom: '0',\n  flexDirection: 'column',\n  width: '100%',\n  height: '100%',\n  contain: 'layout size style'\n};\nconst tabsInner = {\n  position: 'relative',\n  flex: 1,\n  contain: 'layout size style'\n};\n\nclass IonTabs extends React.Component {\n  constructor(props) {\n    super(props);\n    this.routerOutletRef = React.createRef();\n    this.tabBarRef = React.createRef();\n    this.ionTabContextState = {\n      activeTab: undefined,\n      selectTab: () => false\n    };\n  }\n\n  componentDidMount() {\n    if (this.tabBarRef.current) {\n      // Grab initial value\n      this.ionTabContextState.activeTab = this.tabBarRef.current.state.activeTab; // Override method\n\n      this.tabBarRef.current.setActiveTabOnContext = tab => {\n        this.ionTabContextState.activeTab = tab;\n      };\n\n      this.ionTabContextState.selectTab = this.tabBarRef.current.selectTab;\n    }\n  }\n\n  render() {\n    let outlet;\n    let tabBar;\n\n    const _a = this.props,\n          {\n      className,\n      onIonTabsDidChange,\n      onIonTabsWillChange\n    } = _a,\n          props = __rest(_a, [\"className\", \"onIonTabsDidChange\", \"onIonTabsWillChange\"]);\n\n    const children = typeof this.props.children === 'function' ? this.props.children(this.ionTabContextState) : this.props.children;\n    React.Children.forEach(children, child => {\n      if (child == null || typeof child !== 'object' || !child.hasOwnProperty('type')) {\n        return;\n      }\n\n      if (child.type === IonRouterOutlet || child.type.isRouterOutlet) {\n        outlet = React.cloneElement(child, {\n          tabs: true\n        });\n      } else if (child.type === Fragment && child.props.children[0].type === IonRouterOutlet) {\n        outlet = child.props.children[0];\n      }\n\n      let childProps = {\n        ref: this.tabBarRef\n      };\n      /**\n       * Only pass these props\n       * down from IonTabs to IonTabBar\n       * if they are defined, otherwise\n       * if you have a handler set on\n       * IonTabBar it will be overridden.\n       */\n\n      if (onIonTabsDidChange !== undefined) {\n        childProps = Object.assign(Object.assign({}, childProps), {\n          onIonTabsDidChange\n        });\n      }\n\n      if (onIonTabsWillChange !== undefined) {\n        childProps = Object.assign(Object.assign({}, childProps), {\n          onIonTabsWillChange\n        });\n      }\n\n      if (child.type === IonTabBar || child.type.isTabBar) {\n        tabBar = React.cloneElement(child, childProps);\n      } else if (child.type === Fragment && (child.props.children[1].type === IonTabBar || child.props.children[1].type.isTabBar)) {\n        tabBar = React.cloneElement(child.props.children[1], childProps);\n      }\n    });\n\n    if (!outlet) {\n      throw new Error('IonTabs must contain an IonRouterOutlet');\n    }\n\n    if (!tabBar) {\n      throw new Error('IonTabs needs a IonTabBar');\n    }\n\n    return React.createElement(IonTabsContext.Provider, {\n      value: this.ionTabContextState\n    }, this.context.hasIonicRouter() ? React.createElement(PageManager, Object.assign({\n      className: className ? `${className}` : '',\n      routeInfo: this.context.routeInfo\n    }, props), React.createElement(\"ion-tabs\", {\n      className: \"ion-tabs\",\n      style: hostStyles\n    }, tabBar.props.slot === 'top' ? tabBar : null, React.createElement(\"div\", {\n      style: tabsInner,\n      className: \"tabs-inner\"\n    }, outlet), tabBar.props.slot === 'bottom' ? tabBar : null)) : React.createElement(\"div\", Object.assign({\n      className: className ? `${className}` : 'ion-tabs'\n    }, props, {\n      style: hostStyles\n    }), tabBar.props.slot === 'top' ? tabBar : null, React.createElement(\"div\", {\n      style: tabsInner,\n      className: \"tabs-inner\"\n    }, outlet), tabBar.props.slot === 'bottom' ? tabBar : null));\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n\n}\n\nconst IonBackButton = /*@__PURE__*/(() => class extends React.Component {\n  constructor() {\n    super(...arguments);\n\n    this.clickButton = e => {\n      const {\n        defaultHref,\n        routerAnimation\n      } = this.props;\n\n      if (this.context.hasIonicRouter()) {\n        e.stopPropagation();\n        this.context.goBack(defaultHref, routerAnimation);\n      } else if (defaultHref !== undefined) {\n        window.location.href = defaultHref;\n      }\n    };\n  }\n\n  render() {\n    return React.createElement(IonBackButtonInner, Object.assign({\n      onClick: this.clickButton\n    }, this.props));\n  }\n\n  static get displayName() {\n    return 'IonBackButton';\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n\n})();\n\nconst isDevMode = () => {\n  return process && process.env && process.env.NODE_ENV === 'development';\n};\n\nconst warnings = {};\n\nconst deprecationWarning = (key, message) => {\n  if (isDevMode()) {\n    if (!warnings[key]) {\n      console.warn(message);\n      warnings[key] = true;\n    }\n  }\n};\n\nclass IonIconContainer extends React.PureComponent {\n  constructor(props) {\n    super(props);\n\n    if (this.props.name) {\n      deprecationWarning('icon-name', 'In Ionic React, you import icons from \"ionicons/icons\" and set the icon you imported to the \"icon\" property. Setting the \"name\" property has no effect.');\n    }\n  }\n\n  render() {\n    var _a, _b;\n\n    const _c = this.props,\n          {\n      icon,\n      ios,\n      md\n    } = _c,\n          rest = __rest(_c, [\"icon\", \"ios\", \"md\"]);\n\n    let iconToUse;\n\n    if (ios || md) {\n      if (isPlatform('ios')) {\n        iconToUse = (_a = ios !== null && ios !== void 0 ? ios : md) !== null && _a !== void 0 ? _a : icon;\n      } else {\n        iconToUse = (_b = md !== null && md !== void 0 ? md : ios) !== null && _b !== void 0 ? _b : icon;\n      }\n    } else {\n      iconToUse = icon;\n    }\n\n    return React.createElement(IonIconInner, Object.assign({\n      ref: this.props.forwardedRef,\n      icon: iconToUse\n    }, rest), this.props.children);\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n\n}\n\nconst IonIcon = createForwardRef(IonIconContainer, 'IonIcon');\n\nclass IonRoute extends React.PureComponent {\n  render() {\n    const IonRouteInner = this.context.getIonRoute();\n\n    if (!this.context.hasIonicRouter() || !IonRoute) {\n      console.error('You either do not have an Ionic Router package, or your router does not support using <IonRoute>');\n      return null;\n    }\n\n    return React.createElement(IonRouteInner, Object.assign({}, this.props));\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n\n}\n\nclass IonRedirect extends React.PureComponent {\n  render() {\n    const IonRedirectInner = this.context.getIonRedirect();\n\n    if (!this.context.hasIonicRouter() || !IonRedirect) {\n      console.error('You either do not have an Ionic Router package, or your router does not support using <IonRedirect>');\n      return null;\n    }\n\n    return React.createElement(IonRedirectInner, Object.assign({}, this.props));\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n\n}\n\nconst IonRouterContext = React.createContext({\n  routeInfo: undefined,\n  push: () => {\n    throw new Error('An Ionic Router is required for IonRouterContext');\n  },\n  back: () => {\n    throw new Error('An Ionic Router is required for IonRouterContext');\n  },\n  canGoBack: () => {\n    throw new Error('An Ionic Router is required for IonRouterContext');\n  },\n  nativeBack: () => {\n    throw new Error('An Ionic Router is required for IonRouterContext');\n  }\n});\n/**\n * A hook for more direct control over routing in an Ionic React applicaiton. Allows you to pass additional meta-data to the router before the call to the native router.\n */\n\nfunction useIonRouter() {\n  const context = useContext(IonRouterContext);\n  return {\n    back: context.back,\n    push: context.push,\n    goBack: context.back,\n    canGoBack: context.canGoBack,\n    routeInfo: context.routeInfo\n  };\n}\n\nclass CreateAnimation extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.nodes = new Map();\n    this.animation = createAnimation(props.id);\n  }\n\n  setupAnimation(props) {\n    const animation = this.animation;\n\n    if (this.nodes.size > 0) {\n      animation.addElement(Array.from(this.nodes.values()));\n    }\n\n    checkConfig(animation, props);\n    checkPlayback(animation, props);\n  }\n\n  componentDidMount() {\n    const props = this.props;\n    this.setupAnimation(props);\n  }\n\n  componentDidUpdate(prevProps) {\n    const animation = this.animation;\n    const props = this.props;\n    checkConfig(animation, props, prevProps);\n    checkProgress(animation, props, prevProps);\n    checkPlayback(animation, props, prevProps);\n  }\n\n  render() {\n    const {\n      children\n    } = this.props;\n    return React.createElement(React.Fragment, null, React.Children.map(children, (child, id) => React.cloneElement(child, {\n      ref: el => this.nodes.set(id, el)\n    })));\n  }\n\n}\n\nconst checkConfig = (animation, currentProps = {}, prevProps = {}) => {\n  const reservedProps = ['children', 'progressStart', 'progressStep', 'progressEnd', 'pause', 'stop', 'destroy', 'play', 'from', 'to', 'fromTo', 'onFinish'];\n\n  for (const key in currentProps) {\n    if (currentProps.hasOwnProperty(key) && !reservedProps.includes(key) && currentProps[key] !== prevProps[key]) {\n      animation[key](currentProps[key]);\n    }\n  }\n\n  const fromValues = currentProps.from;\n\n  if (fromValues && fromValues !== prevProps.from) {\n    const values = Array.isArray(fromValues) ? fromValues : [fromValues];\n    values.forEach(val => animation.from(val.property, val.value));\n  }\n\n  const toValues = currentProps.to;\n\n  if (toValues && toValues !== prevProps.to) {\n    const values = Array.isArray(toValues) ? toValues : [toValues];\n    values.forEach(val => animation.to(val.property, val.value));\n  }\n\n  const fromToValues = currentProps.fromTo;\n\n  if (fromToValues && fromToValues !== prevProps.fromTo) {\n    const values = Array.isArray(fromToValues) ? fromToValues : [fromToValues];\n    values.forEach(val => animation.fromTo(val.property, val.fromValue, val.toValue));\n  }\n\n  const onFinishValues = currentProps.onFinish;\n\n  if (onFinishValues && onFinishValues !== prevProps.onFinish) {\n    const values = Array.isArray(onFinishValues) ? onFinishValues : [onFinishValues];\n    values.forEach(val => animation.onFinish(val.callback, val.opts));\n  }\n};\n\nconst checkProgress = (animation, currentProps = {}, prevProps = {}) => {\n  var _a, _b, _c, _d, _e;\n\n  const {\n    progressStart,\n    progressStep,\n    progressEnd\n  } = currentProps;\n\n  if (progressStart && (((_a = prevProps.progressStart) === null || _a === void 0 ? void 0 : _a.forceLinearEasing) !== (progressStart === null || progressStart === void 0 ? void 0 : progressStart.forceLinearEasing) || ((_b = prevProps.progressStart) === null || _b === void 0 ? void 0 : _b.step) !== (progressStart === null || progressStart === void 0 ? void 0 : progressStart.step))) {\n    animation.progressStart(progressStart.forceLinearEasing, progressStart.step);\n  }\n\n  if (progressStep && ((_c = prevProps.progressStep) === null || _c === void 0 ? void 0 : _c.step) !== (progressStep === null || progressStep === void 0 ? void 0 : progressStep.step)) {\n    animation.progressStep(progressStep.step);\n  }\n\n  if (progressEnd && (((_d = prevProps.progressEnd) === null || _d === void 0 ? void 0 : _d.playTo) !== (progressEnd === null || progressEnd === void 0 ? void 0 : progressEnd.playTo) || ((_e = prevProps.progressEnd) === null || _e === void 0 ? void 0 : _e.step) !== (progressEnd === null || progressEnd === void 0 ? void 0 : progressEnd.step) || (prevProps === null || prevProps === void 0 ? void 0 : prevProps.dur) !== (progressEnd === null || progressEnd === void 0 ? void 0 : progressEnd.dur))) {\n    animation.progressEnd(progressEnd.playTo, progressEnd.step, progressEnd.dur);\n  }\n};\n\nconst checkPlayback = (animation, currentProps = {}, prevProps = {}) => {\n  if (!prevProps.play && currentProps.play) {\n    animation.play();\n  }\n\n  if (!prevProps.pause && currentProps.pause) {\n    animation.pause();\n  }\n\n  if (!prevProps.stop && currentProps.stop) {\n    animation.stop();\n  }\n\n  if (!prevProps.destroy && currentProps.destroy) {\n    animation.destroy();\n  }\n};\n\nfunction useController(displayName, controller) {\n  const overlayRef = useRef();\n  const didDismissEventName = useMemo(() => `on${displayName}DidDismiss`, [displayName]);\n  const didPresentEventName = useMemo(() => `on${displayName}DidPresent`, [displayName]);\n  const willDismissEventName = useMemo(() => `on${displayName}WillDismiss`, [displayName]);\n  const willPresentEventName = useMemo(() => `on${displayName}WillPresent`, [displayName]);\n\n  const present = async options => {\n    if (overlayRef.current) {\n      return;\n    }\n\n    const {\n      onDidDismiss,\n      onWillDismiss,\n      onDidPresent,\n      onWillPresent\n    } = options,\n          rest = __rest(options, [\"onDidDismiss\", \"onWillDismiss\", \"onDidPresent\", \"onWillPresent\"]);\n\n    const handleDismiss = event => {\n      if (onDidDismiss) {\n        onDidDismiss(event);\n      }\n\n      overlayRef.current = undefined;\n    };\n\n    overlayRef.current = await controller.create(Object.assign({}, rest));\n    attachProps(overlayRef.current, {\n      [didDismissEventName]: handleDismiss,\n      [didPresentEventName]: e => onDidPresent && onDidPresent(e),\n      [willDismissEventName]: e => onWillDismiss && onWillDismiss(e),\n      [willPresentEventName]: e => onWillPresent && onWillPresent(e)\n    });\n    overlayRef.current.present();\n  };\n\n  const dismiss = async () => {\n    overlayRef.current && (await overlayRef.current.dismiss());\n    overlayRef.current = undefined;\n  };\n\n  return {\n    present,\n    dismiss\n  };\n}\n/**\n * A hook for presenting/dismissing an IonActionSheet component\n * @returns Returns the present and dismiss methods in an array\n */\n\n\nfunction useIonActionSheet() {\n  const controller = useController('IonActionSheet', actionSheetController$1);\n\n  function present(buttonsOrOptions, header) {\n    if (Array.isArray(buttonsOrOptions)) {\n      controller.present({\n        buttons: buttonsOrOptions,\n        header\n      });\n    } else {\n      controller.present(buttonsOrOptions);\n    }\n  }\n\n  return [present, controller.dismiss];\n}\n/**\n * A hook for presenting/dismissing an IonAlert component\n * @returns Returns the present and dismiss methods in an array\n */\n\n\nfunction useIonAlert() {\n  const controller = useController('IonAlert', alertController);\n\n  function present(messageOrOptions, buttons) {\n    if (typeof messageOrOptions === 'string') {\n      controller.present({\n        message: messageOrOptions,\n        buttons: buttons !== null && buttons !== void 0 ? buttons : [{\n          text: 'Ok'\n        }]\n      });\n    } else {\n      controller.present(messageOrOptions);\n    }\n  }\n\n  return [present, controller.dismiss];\n}\n/**\n * A hook for presenting/dismissing an IonToast component\n * @returns Returns the present and dismiss methods in an array\n */\n\n\nfunction useIonToast() {\n  const controller = useController('IonToast', toastController$1);\n\n  function present(messageOrOptions, duration) {\n    if (typeof messageOrOptions === 'string') {\n      controller.present({\n        message: messageOrOptions,\n        duration\n      });\n    } else {\n      controller.present(messageOrOptions);\n    }\n  }\n\n  return [present, controller.dismiss];\n}\n\nfunction useOverlay(displayName, controller, component, componentProps) {\n  const overlayRef = useRef();\n  const containerElRef = useRef();\n  const didDismissEventName = useMemo(() => `on${displayName}DidDismiss`, [displayName]);\n  const didPresentEventName = useMemo(() => `on${displayName}DidPresent`, [displayName]);\n  const willDismissEventName = useMemo(() => `on${displayName}WillDismiss`, [displayName]);\n  const willPresentEventName = useMemo(() => `on${displayName}WillPresent`, [displayName]);\n  const [isOpen, setIsOpen] = useState(false);\n  useEffect(() => {\n    if (isOpen && component && containerElRef.current) {\n      if (React.isValidElement(component)) {\n        ReactDOM.render(component, containerElRef.current);\n      } else {\n        ReactDOM.render(React.createElement(component, componentProps), containerElRef.current);\n      }\n    }\n  }, [component, containerElRef.current, isOpen, componentProps]);\n\n  const present = async options => {\n    if (overlayRef.current) {\n      return;\n    }\n\n    const {\n      onDidDismiss,\n      onWillDismiss,\n      onDidPresent,\n      onWillPresent\n    } = options,\n          rest = __rest(options, [\"onDidDismiss\", \"onWillDismiss\", \"onDidPresent\", \"onWillPresent\"]);\n\n    if (typeof document !== 'undefined') {\n      containerElRef.current = document.createElement('div');\n    }\n\n    overlayRef.current = await controller.create(Object.assign(Object.assign({}, rest), {\n      component: containerElRef.current\n    }));\n    attachProps(overlayRef.current, {\n      [didDismissEventName]: handleDismiss,\n      [didPresentEventName]: e => onDidPresent && onDidPresent(e),\n      [willDismissEventName]: e => onWillDismiss && onWillDismiss(e),\n      [willPresentEventName]: e => onWillPresent && onWillPresent(e)\n    });\n    overlayRef.current.present();\n    setIsOpen(true);\n\n    function handleDismiss(event) {\n      if (onDidDismiss) {\n        onDidDismiss(event);\n      }\n\n      overlayRef.current = undefined;\n      containerElRef.current = undefined;\n      setIsOpen(false);\n    }\n  };\n\n  const dismiss = async () => {\n    overlayRef.current && (await overlayRef.current.dismiss());\n    overlayRef.current = undefined;\n    containerElRef.current = undefined;\n  };\n\n  return {\n    present,\n    dismiss\n  };\n}\n/**\n * A hook for presenting/dismissing an IonModal component\n * @param component The component that the modal will show. Can be a React Component, a functional component, or a JSX Element\n * @param componentProps The props that will be passed to the component, if required\n * @returns Returns the present and dismiss methods in an array\n */\n\n\nfunction useIonModal(component, componentProps) {\n  const controller = useOverlay('IonModal', modalController, component, componentProps);\n\n  function present(options = {}) {\n    controller.present(options);\n  }\n\n  return [present, controller.dismiss];\n}\n/**\n * A hook for presenting/dismissing an IonPicker component\n * @param component The component that the popover will show. Can be a React Component, a functional component, or a JSX Element\n * @param componentProps The props that will be passed to the component, if required\n * @returns Returns the present and dismiss methods in an array\n */\n\n\nfunction useIonPopover(component, componentProps) {\n  const controller = useOverlay('IonPopover', popoverController, component, componentProps);\n\n  function present(options = {}) {\n    controller.present(options);\n  }\n\n  return [present, controller.dismiss];\n}\n/**\n * A hook for presenting/dismissing an IonPicker component\n * @returns Returns the present and dismiss methods in an array\n */\n\n\nfunction useIonPicker() {\n  const controller = useController('IonPicker', pickerController);\n\n  function present(columnsOrOptions, buttons) {\n    if (Array.isArray(columnsOrOptions)) {\n      controller.present({\n        columns: columnsOrOptions,\n        buttons: buttons !== null && buttons !== void 0 ? buttons : [{\n          text: 'Ok'\n        }]\n      });\n    } else {\n      controller.present(columnsOrOptions);\n    }\n  }\n\n  return [present, controller.dismiss];\n}\n/**\n * A hook for presenting/dismissing an IonLoading component\n * @returns Returns the present and dismiss methods in an array\n */\n\n\nfunction useIonLoading() {\n  const controller = useController('IonLoading', loadingController);\n\n  function present(messageOrOptions = '', duration, spinner) {\n    if (typeof messageOrOptions === 'string') {\n      controller.present({\n        message: messageOrOptions,\n        duration,\n        spinner: spinner !== null && spinner !== void 0 ? spinner : 'lines'\n      });\n    } else {\n      controller.present(messageOrOptions);\n    }\n  }\n\n  return [present, controller.dismiss];\n} // Icons that are used by internal components\n\n\naddIcons({\n  'arrow-back-sharp': arrowBackSharp,\n  'caret-back-sharp': caretBackSharp,\n  'chevron-back': chevronBack,\n  'chevron-forward': chevronForward,\n  close,\n  'close-circle': closeCircle,\n  'close-sharp': closeSharp,\n  'menu-outline': menuOutline,\n  'menu-sharp': menuSharp,\n  'reorder-two-sharp': reorderTwoSharp,\n  'reorder-three-outline': reorderThreeOutline,\n  'search-outline': searchOutline,\n  'search-sharp': searchSharp\n}); // TODO: defineCustomElements() is asyncronous\n// We need to use the promise\n\nif (typeof window !== 'undefined') {\n  defineCustomElements(window);\n}\n\nconst RouteManagerContext = /*@__PURE__*/React.createContext({\n  addViewItem: () => undefined,\n  canGoBack: () => undefined,\n  clearOutlet: () => undefined,\n  createViewItem: () => undefined,\n  findViewItemByPathname: () => undefined,\n  findLeavingViewItemByRouteInfo: () => undefined,\n  findViewItemByRouteInfo: () => undefined,\n  getChildrenToRender: () => undefined,\n  goBack: () => undefined,\n  unMountViewItem: () => undefined\n});\n\nclass ViewLifeCycleManager extends React.Component {\n  constructor(props) {\n    super(props);\n    this.ionLifeCycleContext = new DefaultIonLifeCycleContext();\n    this._isMounted = false;\n    this.ionLifeCycleContext.onComponentCanBeDestroyed(() => {\n      if (!this.props.mount) {\n        if (this._isMounted) {\n          this.setState({\n            show: false\n          }, () => this.props.removeView());\n        }\n      }\n    });\n    this.state = {\n      show: true\n    };\n  }\n\n  componentDidMount() {\n    this._isMounted = true;\n  }\n\n  componentWillUnmount() {\n    this._isMounted = false;\n  }\n\n  render() {\n    const {\n      show\n    } = this.state;\n    return React.createElement(IonLifeCycleContext.Provider, {\n      value: this.ionLifeCycleContext\n    }, show && this.props.children);\n  }\n\n} // const RESTRICT_SIZE = 100;\n\n\nclass LocationHistory {\n  constructor() {\n    this.locationHistory = [];\n    this.tabHistory = {};\n  }\n\n  add(routeInfo) {\n    if (routeInfo.routeAction === 'push' || routeInfo.routeAction == null) {\n      this._add(routeInfo);\n    } else if (routeInfo.routeAction === 'pop') {\n      this._pop(routeInfo);\n    } else if (routeInfo.routeAction === 'replace') {\n      this._replace(routeInfo);\n    }\n\n    if (routeInfo.routeDirection === 'root') {\n      this._clear();\n\n      this._add(routeInfo);\n    }\n  }\n\n  clearTabStack(tab) {\n    const routeInfos = this._getRouteInfosByKey(tab);\n\n    if (routeInfos) {\n      routeInfos.forEach(ri => {\n        this.locationHistory = this.locationHistory.filter(x => x.id !== ri.id);\n      });\n      this.tabHistory[tab] = [];\n    }\n  }\n\n  update(routeInfo) {\n    const locationIndex = this.locationHistory.findIndex(x => x.id === routeInfo.id);\n\n    if (locationIndex > -1) {\n      this.locationHistory.splice(locationIndex, 1, routeInfo);\n    }\n\n    const tabArray = this.tabHistory[routeInfo.tab || ''];\n\n    if (tabArray) {\n      const tabIndex = tabArray.findIndex(x => x.id === routeInfo.id);\n\n      if (tabIndex > -1) {\n        tabArray.splice(tabIndex, 1, routeInfo);\n      } else {\n        tabArray.push(routeInfo);\n      }\n    } else if (routeInfo.tab) {\n      this.tabHistory[routeInfo.tab] = [routeInfo];\n    }\n  }\n\n  _add(routeInfo) {\n    const routeInfos = this._getRouteInfosByKey(routeInfo.tab);\n\n    if (routeInfos) {\n      // If the latest routeInfo is the same (going back and forth between tabs), replace it\n      if (this._areRoutesEqual(routeInfos[routeInfos.length - 1], routeInfo)) {\n        routeInfos.pop();\n      }\n\n      routeInfos.push(routeInfo);\n    }\n\n    this.locationHistory.push(routeInfo);\n  }\n\n  _areRoutesEqual(route1, route2) {\n    if (!route1 || !route2) {\n      return false;\n    }\n\n    return route1.pathname === route2.pathname && route1.search === route2.search;\n  }\n\n  _pop(routeInfo) {\n    const routeInfos = this._getRouteInfosByKey(routeInfo.tab);\n\n    if (routeInfos) {\n      // Pop the previous route\n      routeInfos.pop(); // Replace the current route with an updated version\n\n      routeInfos.pop();\n      routeInfos.push(routeInfo);\n    } // Pop the previous route\n\n\n    this.locationHistory.pop(); // Replace the current route with an updated version\n\n    this.locationHistory.pop();\n    this.locationHistory.push(routeInfo);\n  }\n\n  _replace(routeInfo) {\n    const routeInfos = this._getRouteInfosByKey(routeInfo.tab);\n\n    routeInfos && routeInfos.pop();\n    this.locationHistory.pop();\n\n    this._add(routeInfo);\n  }\n\n  _clear() {\n    const keys = Object.keys(this.tabHistory);\n    keys.forEach(k => this.tabHistory[k] = []);\n    this.locationHistory = [];\n  }\n\n  _getRouteInfosByKey(key) {\n    let routeInfos;\n\n    if (key) {\n      routeInfos = this.tabHistory[key];\n\n      if (!routeInfos) {\n        routeInfos = this.tabHistory[key] = [];\n      }\n    }\n\n    return routeInfos;\n  }\n\n  getFirstRouteInfoForTab(tab) {\n    const routeInfos = this._getRouteInfosByKey(tab);\n\n    if (routeInfos) {\n      return routeInfos[0];\n    }\n\n    return undefined;\n  }\n\n  getCurrentRouteInfoForTab(tab) {\n    const routeInfos = this._getRouteInfosByKey(tab);\n\n    if (routeInfos) {\n      return routeInfos[routeInfos.length - 1];\n    }\n\n    return undefined;\n  }\n\n  findLastLocation(routeInfo) {\n    const routeInfos = this._getRouteInfosByKey(routeInfo.tab);\n\n    if (routeInfos) {\n      for (let i = routeInfos.length - 2; i >= 0; i--) {\n        const ri = routeInfos[i];\n\n        if (ri) {\n          if (ri.pathname === routeInfo.pushedByRoute) {\n            return ri;\n          }\n        }\n      }\n    }\n\n    for (let i = this.locationHistory.length - 2; i >= 0; i--) {\n      const ri = this.locationHistory[i];\n\n      if (ri) {\n        if (ri.pathname === routeInfo.pushedByRoute) {\n          return ri;\n        }\n      }\n    }\n\n    return undefined;\n  }\n\n  previous() {\n    return this.locationHistory[this.locationHistory.length - 2] || this.locationHistory[this.locationHistory.length - 1];\n  }\n\n  current() {\n    return this.locationHistory[this.locationHistory.length - 1];\n  }\n\n  canGoBack() {\n    return this.locationHistory.length > 1;\n  }\n\n}\n\nclass NavManager extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this._isMounted = false;\n    this.ionRouterContextValue = {\n      push: (pathname, routerDirection, routeAction, routerOptions, animationBuilder) => {\n        this.navigate(pathname, routerDirection, routeAction, animationBuilder, routerOptions);\n      },\n      back: animationBuilder => {\n        this.goBack(undefined, animationBuilder);\n      },\n      canGoBack: () => this.props.locationHistory.canGoBack(),\n      nativeBack: () => this.props.onNativeBack(),\n      routeInfo: this.props.routeInfo\n    };\n    this.state = {\n      goBack: this.goBack.bind(this),\n      hasIonicRouter: () => true,\n      navigate: this.navigate.bind(this),\n      getIonRedirect: this.getIonRedirect.bind(this),\n      getIonRoute: this.getIonRoute.bind(this),\n      getStackManager: this.getStackManager.bind(this),\n      getPageManager: this.getPageManager.bind(this),\n      routeInfo: this.props.routeInfo,\n      setCurrentTab: this.props.onSetCurrentTab,\n      changeTab: this.props.onChangeTab,\n      resetTab: this.props.onResetTab\n    };\n\n    if (typeof document !== 'undefined') {\n      this.handleHardwareBackButton = this.handleHardwareBackButton.bind(this);\n      document.addEventListener('ionBackButton', this.handleHardwareBackButton);\n    }\n  }\n\n  componentDidMount() {\n    this._isMounted = true;\n  }\n\n  componentWillUnmount() {\n    if (typeof document !== 'undefined') {\n      document.removeEventListener('ionBackButton', this.handleHardwareBackButton);\n      this._isMounted = false;\n    }\n  }\n\n  handleHardwareBackButton(e) {\n    e.detail.register(0, processNextHandler => {\n      if (this._isMounted) {\n        this.nativeGoBack();\n        processNextHandler();\n      }\n    });\n  }\n\n  goBack(route, animationBuilder) {\n    this.props.onNavigateBack(route, animationBuilder);\n  }\n\n  nativeGoBack() {\n    this.props.onNativeBack();\n  }\n\n  navigate(path, direction = 'forward', action = 'push', animationBuilder, options, tab) {\n    this.props.onNavigate(path, action, direction, animationBuilder, options, tab);\n  }\n\n  getPageManager() {\n    return PageManager;\n  }\n\n  getIonRedirect() {\n    return this.props.ionRedirect;\n  }\n\n  getIonRoute() {\n    return this.props.ionRoute;\n  }\n\n  getStackManager() {\n    return this.props.stackManager;\n  }\n\n  render() {\n    return React.createElement(NavContext.Provider, {\n      value: Object.assign(Object.assign({}, this.state), {\n        routeInfo: this.props.routeInfo\n      })\n    }, React.createElement(IonRouterContext.Provider, {\n      value: Object.assign(Object.assign({}, this.ionRouterContextValue), {\n        routeInfo: this.props.routeInfo\n      })\n    }, this.props.children));\n  }\n\n}\n\nclass ViewStacks {\n  constructor() {\n    this.viewStacks = {};\n    this.add = this.add.bind(this);\n    this.clear = this.clear.bind(this);\n    this.getViewItemsForOutlet = this.getViewItemsForOutlet.bind(this);\n    this.remove = this.remove.bind(this);\n  }\n\n  add(viewItem) {\n    const {\n      outletId\n    } = viewItem;\n\n    if (!this.viewStacks[outletId]) {\n      this.viewStacks[outletId] = [viewItem];\n    } else {\n      this.viewStacks[outletId].push(viewItem);\n    }\n  }\n\n  clear(outletId) {\n    // Give some time for the leaving views to transition before removing\n    setTimeout(() => {\n      // console.log('Removing viewstack for outletID ' + outletId);\n      delete this.viewStacks[outletId];\n    }, 500);\n  }\n\n  getViewItemsForOutlet(outletId) {\n    return this.viewStacks[outletId] || [];\n  }\n\n  remove(viewItem) {\n    const {\n      outletId\n    } = viewItem;\n    const viewStack = this.viewStacks[outletId];\n\n    if (viewStack) {\n      const viewItemToRemove = viewStack.find(x => x.id === viewItem.id);\n\n      if (viewItemToRemove) {\n        viewItemToRemove.mount = false;\n        this.viewStacks[outletId] = viewStack.filter(x => x.id !== viewItemToRemove.id);\n      }\n    }\n  }\n\n  getStackIds() {\n    return Object.keys(this.viewStacks);\n  }\n\n  getAllViewItems() {\n    const keys = this.getStackIds();\n    const viewItems = [];\n    keys.forEach(k => {\n      viewItems.push(...this.viewStacks[k]);\n    });\n    return viewItems;\n  }\n\n}\n\nconst ids = {\n  main: 0\n};\n\nconst generateId = (type = 'main') => {\n  var _a;\n\n  const id = ((_a = ids[type]) !== null && _a !== void 0 ? _a : 0) + 1;\n  ids[type] = id;\n  return id.toString();\n};\n\nexport { CreateAnimation, DefaultIonLifeCycleContext, IonActionSheet, IonAlert, IonApp, IonAvatar, IonBackButton, IonBackdrop, IonBadge, IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonCheckbox, IonChip, IonCol, IonContent, IonDatetime, IonFab, IonFabButton, IonFabList, IonFooter, IonGrid, IonHeader, IonIcon, IonImg, IonInfiniteScroll, IonInfiniteScrollContent, IonInput, IonItem, IonItemDivider, IonItemGroup, IonItemOption, IonItemOptions, IonItemSliding, IonLabel, IonLifeCycleContext, IonList, IonListHeader, IonLoading, IonMenu, IonMenuButton, IonMenuToggle, IonModal, IonNav, IonNote, IonPage, IonPicker, IonPickerColumn, IonPopover, IonProgressBar, IonRadio, IonRadioGroup, IonRange, IonRedirect, IonRefresher, IonRefresherContent, IonReorder, IonReorderGroup, IonRippleEffect, IonRoute, IonRouterContext, IonRouterLink, IonRouterOutlet, IonRow, IonSearchbar, IonSegment, IonSegmentButton, IonSelect, IonSelectOption, IonSelectPopover, IonSkeletonText, IonSlide, IonSlides, IonSpinner, IonSplitPane, IonTab, IonTabBar, IonTabButton, IonTabs, IonTabsContext, IonText, IonTextarea, IonThumbnail, IonTitle, IonToast, IonToggle, IonToolbar, IonVirtualScroll, LocationHistory, NavContext, NavManager, RouteManagerContext, StackContext, ViewLifeCycleManager, ViewStacks, generateId, getConfig, getPlatforms, isPlatform, useIonActionSheet, useIonAlert, useIonLoading, useIonModal, useIonPicker, useIonPopover, useIonRouter, useIonToast, useIonViewDidEnter, useIonViewDidLeave, useIonViewWillEnter, useIonViewWillLeave, withIonLifeCycle };","map":{"version":3,"sources":["../src/contexts/IonLifeCycleContext.tsx","../src/lifecycle/IonLifeCycleHOC.tsx","../src/lifecycle/hooks.ts","../src/contexts/NavContext.ts","../src/components/utils/case.ts","../src/components/utils/attachProps.ts","../src/components/utils/index.tsx","../src/components/createComponent.tsx","../src/components/proxies.ts","../src/components/createControllerComponent.tsx","../src/components/IonAlert.tsx","../src/components/IonLoading.tsx","../src/components/IonToast.tsx","../src/components/IonPicker.tsx","../src/components/createOverlayComponent.tsx","../src/components/IonActionSheet.tsx","../src/components/IonModal.tsx","../src/components/IonPopover.tsx","../src/routing/StackContext.tsx","../src/routing/PageManager.tsx","../src/components/IonPage.tsx","../src/components/navigation/IonTabsContext.tsx","../src/components/inner-proxies.ts","../src/routing/OutletPageManager.tsx","../src/components/IonRouterOutlet.tsx","../src/components/navigation/IonTabButton.tsx","../src/components/navigation/IonTabBar.tsx","../src/components/navigation/IonTabs.tsx","../src/components/navigation/IonBackButton.tsx","../src/components/utils/dev.ts","../src/components/IonIcon.tsx","../src/components/IonRoute.tsx","../src/components/IonRedirect.tsx","../src/components/IonRouterContext.tsx","../src/components/CreateAnimation.tsx","../src/hooks/useController.ts","../src/hooks/useIonActionSheet.ts","../src/hooks/useIonAlert.ts","../src/hooks/useIonToast.ts","../src/hooks/useOverlay.ts","../src/hooks/useIonModal.ts","../src/hooks/useIonPopover.ts","../src/hooks/useIonPicker.tsx","../src/hooks/useIonLoading.tsx","../src/components/index.ts","../src/routing/RouteManagerContext.ts","../src/routing/ViewLifeCycleManager.tsx","../src/routing/LocationHistory.ts","../src/routing/NavManager.tsx","../src/routing/ViewStacks.ts","../src/utils/generateId.ts"],"names":["isPlatformCore","getPlatformsCore","toastControllerCore","actionSheetControllerCore","actionSheetController","toastController"],"mappings":";;;;;;;;MAaa,mBAAmB,GAAA,aAAiB,KAAK,CAAC,aAAN,CAAkD;AACjG,EAAA,kBAAkB,EAAE,MAAA;AAClB;AACD,GAHgG;AAIjG,EAAA,gBAAgB,EAAE,MAAA;AAChB;AACD,GANgG;AAOjG,EAAA,iBAAiB,EAAE,MAAA;AACjB;AACD,GATgG;AAUjG,EAAA,eAAe,EAAE,MAAA;AACf;AACD,GAZgG;AAajG,EAAA,kBAAkB,EAAE,MAAA;AAClB;AACD,GAfgG;AAgBjG,EAAA,gBAAgB,EAAE,MAAA;AAChB;AACD,GAlBgG;AAmBjG,EAAA,iBAAiB,EAAE,MAAA;AACjB;AACD,GArBgG;AAsBjG,EAAA,eAAe,EAAE,MAAA;AACf;AACD;AAxBgG,CAAlD,C;MAgCpC,0BAA0B,GAAG,MAAA;AAAA,EAAA,WAAA,GAAA;AACxC,SAAA,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C,IAAI,GAAG,MAAR,KAAc;;;AACtC,QAAM,EAAE,GAAG,CAAA,CAAA,EAAA,GAAC,GAAG,CAAC,IAAD,CAAJ,MAAU,IAAV,IAAU,EAAA,KAAA,KAAA,CAAV,GAAU,EAAV,GAAc,CAAd,IAAmB,CAA9B;AACA,EAAA,GAAG,CAAC,IAAD,CAAH,GAAY,EAAZ;AACA,SAAO,EAAE,CAAC,QAAH,EAAP;AACF,C","sourcesContent":["import React from 'react';\n\nexport interface IonLifeCycleContextInterface {\n  onIonViewWillEnter: (callback: () => void) => void;\n  ionViewWillEnter: () => void;\n  onIonViewDidEnter: (callback: () => void) => void;\n  ionViewDidEnter: () => void;\n  onIonViewWillLeave: (callback: () => void) => void;\n  ionViewWillLeave: () => void;\n  onIonViewDidLeave: (callback: () => void) => void;\n  ionViewDidLeave: () => void;\n}\n\nexport const IonLifeCycleContext = /*@__PURE__*/ React.createContext<IonLifeCycleContextInterface>({\n  onIonViewWillEnter: () => {\n    return;\n  },\n  ionViewWillEnter: () => {\n    return;\n  },\n  onIonViewDidEnter: () => {\n    return;\n  },\n  ionViewDidEnter: () => {\n    return;\n  },\n  onIonViewWillLeave: () => {\n    return;\n  },\n  ionViewWillLeave: () => {\n    return;\n  },\n  onIonViewDidLeave: () => {\n    return;\n  },\n  ionViewDidLeave: () => {\n    return;\n  },\n});\n\nexport interface LifeCycleCallback {\n  (): void;\n  id?: number;\n}\n\nexport const DefaultIonLifeCycleContext = class implements IonLifeCycleContextInterface {\n  ionViewWillEnterCallbacks: LifeCycleCallback[] = [];\n  ionViewDidEnterCallbacks: LifeCycleCallback[] = [];\n  ionViewWillLeaveCallbacks: LifeCycleCallback[] = [];\n  ionViewDidLeaveCallbacks: LifeCycleCallback[] = [];\n  componentCanBeDestroyedCallback?: () => void;\n\n  onIonViewWillEnter(callback: LifeCycleCallback) {\n    if (callback.id) {\n      const index = this.ionViewWillEnterCallbacks.findIndex((x) => x.id === callback.id);\n      if (index > -1) {\n        this.ionViewWillEnterCallbacks[index] = callback;\n      } else {\n        this.ionViewWillEnterCallbacks.push(callback);\n      }\n    } else {\n      this.ionViewWillEnterCallbacks.push(callback);\n    }\n  }\n\n  ionViewWillEnter() {\n    this.ionViewWillEnterCallbacks.forEach((cb) => cb());\n  }\n\n  onIonViewDidEnter(callback: LifeCycleCallback) {\n    if (callback.id) {\n      const index = this.ionViewDidEnterCallbacks.findIndex((x) => x.id === callback.id);\n      if (index > -1) {\n        this.ionViewDidEnterCallbacks[index] = callback;\n      } else {\n        this.ionViewDidEnterCallbacks.push(callback);\n      }\n    } else {\n      this.ionViewDidEnterCallbacks.push(callback);\n    }\n  }\n\n  ionViewDidEnter() {\n    this.ionViewDidEnterCallbacks.forEach((cb) => cb());\n  }\n\n  onIonViewWillLeave(callback: LifeCycleCallback) {\n    if (callback.id) {\n      const index = this.ionViewWillLeaveCallbacks.findIndex((x) => x.id === callback.id);\n      if (index > -1) {\n        this.ionViewWillLeaveCallbacks[index] = callback;\n      } else {\n        this.ionViewWillLeaveCallbacks.push(callback);\n      }\n    } else {\n      this.ionViewWillLeaveCallbacks.push(callback);\n    }\n  }\n\n  ionViewWillLeave() {\n    this.ionViewWillLeaveCallbacks.forEach((cb) => cb());\n  }\n\n  onIonViewDidLeave(callback: LifeCycleCallback) {\n    if (callback.id) {\n      const index = this.ionViewDidLeaveCallbacks.findIndex((x) => x.id === callback.id);\n      if (index > -1) {\n        this.ionViewDidLeaveCallbacks[index] = callback;\n      } else {\n        this.ionViewDidLeaveCallbacks.push(callback);\n      }\n    } else {\n      this.ionViewDidLeaveCallbacks.push(callback);\n    }\n  }\n\n  ionViewDidLeave() {\n    this.ionViewDidLeaveCallbacks.forEach((cb) => cb());\n    this.componentCanBeDestroyed();\n  }\n\n  onComponentCanBeDestroyed(callback: () => void) {\n    this.componentCanBeDestroyedCallback = callback;\n  }\n\n  componentCanBeDestroyed() {\n    if (this.componentCanBeDestroyedCallback) {\n      this.componentCanBeDestroyedCallback();\n    }\n  }\n};\n","import React from 'react';\n\nimport { IonLifeCycleContext } from '../contexts/IonLifeCycleContext';\n\nexport const withIonLifeCycle = (WrappedComponent: React.ComponentType<any>) => {\n  return class IonLifeCycle extends React.Component<any, any> {\n    context!: React.ContextType<typeof IonLifeCycleContext>;\n    componentRef = React.createRef<any>();\n\n    constructor(props: any) {\n      super(props);\n    }\n\n    componentDidMount() {\n      const element = this.componentRef.current;\n      this.context.onIonViewWillEnter(() => {\n        if (element && element.ionViewWillEnter) {\n          element.ionViewWillEnter();\n        }\n      });\n\n      this.context.onIonViewDidEnter(() => {\n        if (element && element.ionViewDidEnter) {\n          element.ionViewDidEnter();\n        }\n      });\n\n      this.context.onIonViewWillLeave(() => {\n        if (element && element.ionViewWillLeave) {\n          element.ionViewWillLeave();\n        }\n      });\n\n      this.context.onIonViewDidLeave(() => {\n        if (element && element.ionViewDidLeave) {\n          element.ionViewDidLeave();\n        }\n      });\n    }\n\n    render() {\n      return (\n        <IonLifeCycleContext.Consumer>\n          {(context) => {\n            this.context = context;\n            return <WrappedComponent ref={this.componentRef} {...this.props} />;\n          }}\n        </IonLifeCycleContext.Consumer>\n      );\n    }\n  };\n};\n","import { useContext, useEffect, useRef } from 'react';\n\nimport { IonLifeCycleContext, LifeCycleCallback } from '../contexts/IonLifeCycleContext';\n\nexport const useIonViewWillEnter = (callback: LifeCycleCallback, deps: any[] = []) => {\n  const context = useContext(IonLifeCycleContext);\n  const id = useRef<number | undefined>();\n  id.current = id.current || Math.floor(Math.random() * 1000000);\n  useEffect(() => {\n    callback.id = id.current!;\n    context.onIonViewWillEnter(callback);\n  }, deps);\n};\n\nexport const useIonViewDidEnter = (callback: LifeCycleCallback, deps: any[] = []) => {\n  const context = useContext(IonLifeCycleContext);\n  const id = useRef<number | undefined>();\n  id.current = id.current || Math.floor(Math.random() * 1000000);\n  useEffect(() => {\n    callback.id = id.current!;\n    context.onIonViewDidEnter(callback);\n  }, deps);\n};\n\nexport const useIonViewWillLeave = (callback: LifeCycleCallback, deps: any[] = []) => {\n  const context = useContext(IonLifeCycleContext);\n  const id = useRef<number | undefined>();\n  id.current = id.current || Math.floor(Math.random() * 1000000);\n  useEffect(() => {\n    callback.id = id.current!;\n    context.onIonViewWillLeave(callback);\n  }, deps);\n};\n\nexport const useIonViewDidLeave = (callback: LifeCycleCallback, deps: any[] = []) => {\n  const context = useContext(IonLifeCycleContext);\n  const id = useRef<number | undefined>();\n  id.current = id.current || Math.floor(Math.random() * 1000000);\n  useEffect(() => {\n    callback.id = id.current!;\n    context.onIonViewDidLeave(callback);\n  }, deps);\n};\n","import { AnimationBuilder, RouterDirection } from '@ionic/core';\nimport React from 'react';\n\nimport { RouteInfo } from '../models';\n\nexport interface NavContextState {\n  getIonRoute: () => any;\n  getIonRedirect: () => any;\n  getPageManager: () => any;\n  getStackManager: () => any;\n  goBack: (route?: string | RouteInfo, animationBuilder?: AnimationBuilder) => void;\n  navigate: (\n    path: string,\n    direction?: RouterDirection | 'none',\n    ionRouteAction?: 'push' | 'replace' | 'pop',\n    animationBuilder?: AnimationBuilder,\n    options?: any,\n    tab?: string\n  ) => void;\n  hasIonicRouter: () => boolean;\n  routeInfo?: RouteInfo;\n  setCurrentTab: (tab: string, routeInfo: RouteInfo) => void;\n  changeTab: (tab: string, path: string, routeOptions?: any) => void;\n  resetTab: (tab: string, originalHref: string, originalRouteOptions?: any) => void;\n}\n\nexport const NavContext = /*@__PURE__*/ React.createContext<NavContextState>({\n  getIonRedirect: () => undefined,\n  getIonRoute: () => undefined,\n  getPageManager: () => undefined,\n  getStackManager: () => undefined,\n  goBack: (route?: string | RouteInfo) => {\n    if (typeof window !== 'undefined') {\n      if (typeof route === 'string') {\n        window.location.pathname = route;\n      } else {\n        window.history.back();\n      }\n    }\n  },\n  navigate: (path: string) => {\n    if (typeof window !== 'undefined') {\n      window.location.pathname = path;\n    }\n  },\n  hasIonicRouter: () => false,\n  routeInfo: undefined,\n  setCurrentTab: () => undefined,\n  changeTab: (_tab: string, path: string) => {\n    if (typeof window !== 'undefined') {\n      window.location.pathname = path;\n    }\n  },\n  resetTab: (_tab: string, path: string) => {\n    if (typeof window !== 'undefined') {\n      window.location.pathname = path;\n    }\n  },\n});\n","export const dashToPascalCase = (str: string) =>\n  str\n    .toLowerCase()\n    .split('-')\n    .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n    .join('');\nexport const camelToDashCase = (str: string) =>\n  str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n  // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n  if (node instanceof Element) {\n    // add any classes in className to the class list\n    const className = getClassName(node.classList, newProps, oldProps);\n    if (className !== '') {\n      node.className = className;\n    }\n\n    Object.keys(newProps).forEach((name) => {\n      if (\n        name === 'children' ||\n        name === 'style' ||\n        name === 'ref' ||\n        name === 'class' ||\n        name === 'className' ||\n        name === 'forwardedRef'\n      ) {\n        return;\n      }\n      if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n        const eventName = name.substring(2);\n        const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n        if (!isCoveredByReact(eventNameLc)) {\n          syncEvent(node, eventNameLc, newProps[name]);\n        }\n      } else {\n        const propType = typeof newProps[name];\n        if (propType === 'string') {\n          node.setAttribute(camelToDashCase(name), newProps[name]);\n        } else {\n          (node as any)[name] = newProps[name];\n        }\n      }\n    });\n  }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n  const newClassProp: string = newProps.className || newProps.class;\n  const oldClassProp: string = oldProps.className || oldProps.class;\n  // map the classes to Maps for performance\n  const currentClasses = arrayToMap(classList);\n  const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n  const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n  const finalClassNames: string[] = [];\n  // loop through each of the current classes on the component\n  // to see if it should be a part of the classNames added\n  currentClasses.forEach((currentClass) => {\n    if (incomingPropClasses.has(currentClass)) {\n      // add it as its already included in classnames coming in from newProps\n      finalClassNames.push(currentClass);\n      incomingPropClasses.delete(currentClass);\n    } else if (!oldPropClasses.has(currentClass)) {\n      // add it as it has NOT been removed by user\n      finalClassNames.push(currentClass);\n    }\n  });\n  incomingPropClasses.forEach((s) => finalClassNames.push(s));\n  return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string) => {\n  if (typeof document === 'undefined') {\n    return true;\n  } else {\n    const eventName = 'on' + eventNameSuffix;\n    let isSupported = eventName in document;\n\n    if (!isSupported) {\n      const element = document.createElement('div');\n      element.setAttribute(eventName, 'return;');\n      isSupported = typeof (element as any)[eventName] === 'function';\n    }\n\n    return isSupported;\n  }\n};\n\nexport const syncEvent = (\n  node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n  eventName: string,\n  newEventHandler?: (e: Event) => any\n) => {\n  const eventStore = node.__events || (node.__events = {});\n  const oldEventHandler = eventStore[eventName];\n\n  // Remove old listener so they don't double up.\n  if (oldEventHandler) {\n    node.removeEventListener(eventName, oldEventHandler);\n  }\n\n  // Bind new listener.\n  node.addEventListener(\n    eventName,\n    (eventStore[eventName] = function handler(e: Event) {\n      if (newEventHandler) {\n        newEventHandler.call(this, e);\n      }\n    })\n  );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n  const map = new Map<string, string>();\n  (arr as string[]).forEach((s: string) => map.set(s, s));\n  return map;\n};\n","import {\n  Config as CoreConfig,\n  Platforms,\n  getPlatforms as getPlatformsCore,\n  isPlatform as isPlatformCore,\n} from '@ionic/core';\nimport React from 'react';\n\nimport { IonicReactProps } from '../IonicReactProps';\n\nexport type IonicReactExternalProps<PropType, ElementType> = PropType &\n  Omit<React.HTMLAttributes<ElementType>, 'style'> &\n  IonicReactProps;\n\nexport const createForwardRef = <PropType, ElementType>(\n  ReactComponent: any,\n  displayName: string\n) => {\n  const forwardRef = (\n    props: IonicReactExternalProps<PropType, ElementType>,\n    ref: React.ForwardedRef<ElementType>\n  ) => {\n    return <ReactComponent {...props} forwardedRef={ref} />;\n  };\n  forwardRef.displayName = displayName;\n\n  return React.forwardRef(forwardRef);\n};\n\nexport const setRef = (ref: React.ForwardedRef<any> | React.Ref<any> | undefined, value: any) => {\n  if (typeof ref === 'function') {\n    ref(value)\n  } else if (ref != null) {\n    // Cast as a MutableRef so we can assign current\n    (ref as React.MutableRefObject<any>).current = value\n  }\n};\n\nexport const mergeRefs = (\n  ...refs: (React.ForwardedRef<any> | React.Ref<any> | undefined)[]\n): React.RefCallback<any> => {\n  return (value: any) => {\n    refs.forEach(ref => {\n      setRef(ref, value)\n    })\n  }\n};\n\nexport * from './attachProps';\nexport * from './case';\n\nexport const isPlatform = (platform: Platforms) => {\n  return isPlatformCore(window, platform);\n};\n\nexport const getPlatforms = () => {\n  return getPlatformsCore(window);\n};\n\nexport const getConfig = (): CoreConfig | null => {\n  if (typeof (window as any) !== 'undefined') {\n    const Ionic = (window as any).Ionic;\n    if (Ionic && Ionic.config) {\n      return Ionic.config;\n    }\n  }\n  return null;\n};\n","import { AnimationBuilder } from '@ionic/core';\nimport React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\nimport { RouterOptions } from '../models';\nimport { RouterDirection } from '../models/RouterDirection';\n\nimport {\n  attachProps,\n  camelToDashCase,\n  createForwardRef,\n  dashToPascalCase,\n  isCoveredByReact,\n  mergeRefs,\n} from './utils';\n\ninterface IonicReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n  forwardedRef?: React.ForwardedRef<ElementType>;\n  href?: string;\n  routerLink?: string;\n  ref?: React.Ref<any>;\n  routerDirection?: RouterDirection;\n  routerOptions?: RouterOptions;\n  routerAnimation?: AnimationBuilder;\n}\n\nexport const createReactComponent = <PropType, ElementType>(\n  tagName: string,\n  routerLinkComponent = false\n) => {\n  const displayName = dashToPascalCase(tagName);\n  const ReactComponent = class extends React.Component<IonicReactInternalProps<PropType>> {\n    context!: React.ContextType<typeof NavContext>;\n    ref: React.RefObject<HTMLElement>;\n    stableMergedRefs: React.RefCallback<HTMLElement>\n\n    constructor(props: IonicReactInternalProps<PropType>) {\n      super(props);\n      // Create a local ref to to attach props to the wrapped element.\n      this.ref = React.createRef();\n      // React refs must be stable (not created inline).\n      this.stableMergedRefs = mergeRefs(this.ref, this.props.forwardedRef)\n    }\n\n    componentDidMount() {\n      this.componentDidUpdate(this.props);\n    }\n\n    componentDidUpdate(prevProps: IonicReactInternalProps<PropType>) {\n      const node = this.ref.current! as HTMLElement;\n      attachProps(node, this.props, prevProps);\n    }\n\n    private handleClick = (e: React.MouseEvent<PropType>) => {\n      const { routerLink, routerDirection, routerOptions, routerAnimation } = this.props;\n      if (routerLink !== undefined) {\n        e.preventDefault();\n        this.context.navigate(\n          routerLink,\n          routerDirection,\n          undefined,\n          routerAnimation,\n          routerOptions\n        );\n      }\n    };\n\n    render() {\n      const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n      const propsToPass = Object.keys(cProps).reduce((acc, name) => {\n        if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n          const eventName = name.substring(2).toLowerCase();\n          if (isCoveredByReact(eventName)) {\n            (acc as any)[name] = (cProps as any)[name];\n          }\n        } else if (['string', 'boolean', 'number'].includes(typeof (cProps as any)[name])) {\n          (acc as any)[camelToDashCase(name)] = (cProps as any)[name];\n        }\n        return acc;\n      }, {});\n\n      const newProps: IonicReactInternalProps<PropType> = {\n        ...propsToPass,\n        ref: this.stableMergedRefs,\n        style,\n      };\n\n      if (routerLinkComponent) {\n        if (this.props.routerLink && !this.props.href) {\n          newProps.href = this.props.routerLink;\n        }\n        if (newProps.onClick) {\n          const oldClick = newProps.onClick;\n          newProps.onClick = (e: React.MouseEvent<PropType>) => {\n            oldClick(e);\n            if (!e.defaultPrevented) {\n              this.handleClick(e);\n            }\n          };\n        } else {\n          newProps.onClick = this.handleClick;\n        }\n      }\n\n      return React.createElement(tagName, newProps, children);\n    }\n\n    static get displayName() {\n      return displayName;\n    }\n\n    static get contextType() {\n      return NavContext;\n    }\n  };\n  return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","import { JSX } from '@ionic/core';\n\nimport { createReactComponent } from './createComponent';\nimport { HrefProps } from './hrefprops';\n\n// ionic/core\nexport const IonApp = /*@__PURE__*/ createReactComponent<JSX.IonApp, HTMLIonAppElement>('ion-app');\nexport const IonTab = /*@__PURE__*/ createReactComponent<JSX.IonTab, HTMLIonTabElement>('ion-tab');\nexport const IonRouterLink = /*@__PURE__*/ createReactComponent<\n  HrefProps<JSX.IonRouterLink>,\n  HTMLIonRouterLinkElement\n>('ion-router-link', true);\nexport const IonAvatar = /*@__PURE__*/ createReactComponent<JSX.IonAvatar, HTMLIonAvatarElement>(\n  'ion-avatar'\n);\nexport const IonBackdrop = /*@__PURE__*/ createReactComponent<\n  JSX.IonBackdrop,\n  HTMLIonBackdropElement\n>('ion-backdrop');\nexport const IonBadge = /*@__PURE__*/ createReactComponent<JSX.IonBadge, HTMLIonBadgeElement>(\n  'ion-badge'\n);\nexport const IonButton = /*@__PURE__*/ createReactComponent<\n  HrefProps<JSX.IonButton>,\n  HTMLIonButtonElement\n>('ion-button', true);\nexport const IonButtons = /*@__PURE__*/ createReactComponent<JSX.IonButtons, HTMLIonButtonsElement>(\n  'ion-buttons'\n);\nexport const IonCard = /*@__PURE__*/ createReactComponent<\n  HrefProps<JSX.IonCard>,\n  HTMLIonCardElement\n>('ion-card', true);\nexport const IonCardContent = /*@__PURE__*/ createReactComponent<\n  JSX.IonCardContent,\n  HTMLIonCardContentElement\n>('ion-card-content');\nexport const IonCardHeader = /*@__PURE__*/ createReactComponent<\n  JSX.IonCardHeader,\n  HTMLIonCardHeaderElement\n>('ion-card-header');\nexport const IonCardSubtitle = /*@__PURE__*/ createReactComponent<\n  JSX.IonCardSubtitle,\n  HTMLIonCardSubtitleElement\n>('ion-card-subtitle');\nexport const IonCardTitle = /*@__PURE__*/ createReactComponent<\n  JSX.IonCardTitle,\n  HTMLIonCardTitleElement\n>('ion-card-title');\nexport const IonCheckbox = /*@__PURE__*/ createReactComponent<\n  JSX.IonCheckbox,\n  HTMLIonCheckboxElement\n>('ion-checkbox');\nexport const IonCol = /*@__PURE__*/ createReactComponent<JSX.IonCol, HTMLIonColElement>('ion-col');\nexport const IonContent = /*@__PURE__*/ createReactComponent<JSX.IonContent, HTMLIonContentElement>(\n  'ion-content'\n);\nexport const IonChip = /*@__PURE__*/ createReactComponent<JSX.IonChip, HTMLIonChipElement>(\n  'ion-chip'\n);\nexport const IonDatetime = /*@__PURE__*/ createReactComponent<\n  JSX.IonDatetime,\n  HTMLIonDatetimeElement\n>('ion-datetime');\nexport const IonFab = /*@__PURE__*/ createReactComponent<JSX.IonFab, HTMLIonFabElement>('ion-fab');\nexport const IonFabButton = /*@__PURE__*/ createReactComponent<\n  HrefProps<JSX.IonFabButton>,\n  HTMLIonFabButtonElement\n>('ion-fab-button', true);\nexport const IonFabList = /*@__PURE__*/ createReactComponent<JSX.IonFabList, HTMLIonFabListElement>(\n  'ion-fab-list'\n);\nexport const IonFooter = /*@__PURE__*/ createReactComponent<JSX.IonFooter, HTMLIonFooterElement>(\n  'ion-footer'\n);\nexport const IonGrid = /*@__PURE__*/ createReactComponent<JSX.IonGrid, HTMLIonGridElement>(\n  'ion-grid'\n);\nexport const IonHeader = /*@__PURE__*/ createReactComponent<JSX.IonHeader, HTMLIonHeaderElement>(\n  'ion-header'\n);\nexport const IonImg = /*@__PURE__*/ createReactComponent<JSX.IonImg, HTMLIonImgElement>('ion-img');\nexport const IonInfiniteScroll = /*@__PURE__*/ createReactComponent<\n  JSX.IonInfiniteScroll,\n  HTMLIonInfiniteScrollElement\n>('ion-infinite-scroll');\nexport const IonInfiniteScrollContent = /*@__PURE__*/ createReactComponent<\n  JSX.IonInfiniteScrollContent,\n  HTMLIonInfiniteScrollContentElement\n>('ion-infinite-scroll-content');\nexport const IonInput = /*@__PURE__*/ createReactComponent<JSX.IonInput, HTMLIonInputElement>(\n  'ion-input'\n);\nexport const IonItem = /*@__PURE__*/ createReactComponent<\n  HrefProps<JSX.IonItem>,\n  HTMLIonItemElement\n>('ion-item', true);\nexport const IonItemDivider = /*@__PURE__*/ createReactComponent<\n  JSX.IonItemDivider,\n  HTMLIonItemDividerElement\n>('ion-item-divider');\nexport const IonItemGroup = /*@__PURE__*/ createReactComponent<\n  JSX.IonItemGroup,\n  HTMLIonItemGroupElement\n>('ion-item-group');\nexport const IonItemOption = /*@__PURE__*/ createReactComponent<\n  HrefProps<JSX.IonItemOption>,\n  HTMLIonItemOptionElement\n>('ion-item-option', true);\nexport const IonItemOptions = /*@__PURE__*/ createReactComponent<\n  JSX.IonItemOptions,\n  HTMLIonItemOptionsElement\n>('ion-item-options');\nexport const IonItemSliding = /*@__PURE__*/ createReactComponent<\n  JSX.IonItemSliding,\n  HTMLIonItemSlidingElement\n>('ion-item-sliding');\nexport const IonLabel = /*@__PURE__*/ createReactComponent<JSX.IonLabel, HTMLIonLabelElement>(\n  'ion-label'\n);\nexport const IonList = /*@__PURE__*/ createReactComponent<JSX.IonList, HTMLIonListElement>(\n  'ion-list'\n);\nexport const IonListHeader = /*@__PURE__*/ createReactComponent<\n  JSX.IonListHeader,\n  HTMLIonListHeaderElement\n>('ion-list-header');\nexport const IonMenu = /*@__PURE__*/ createReactComponent<JSX.IonMenu, HTMLIonMenuElement>(\n  'ion-menu'\n);\nexport const IonMenuButton = /*@__PURE__*/ createReactComponent<\n  JSX.IonMenuButton,\n  HTMLIonMenuButtonElement\n>('ion-menu-button');\nexport const IonMenuToggle = /*@__PURE__*/ createReactComponent<\n  JSX.IonMenuToggle,\n  HTMLIonMenuToggleElement\n>('ion-menu-toggle');\nexport const IonNote = /*@__PURE__*/ createReactComponent<JSX.IonNote, HTMLIonNoteElement>(\n  'ion-note'\n);\nexport const IonPickerColumn = /*@__PURE__*/ createReactComponent<\n  JSX.IonPickerColumn,\n  HTMLIonPickerColumnElement\n>('ion-picker-column');\nexport const IonNav = /*@__PURE__*/ createReactComponent<JSX.IonNav, HTMLIonNavElement>('ion-nav');\nexport const IonProgressBar = /*@__PURE__*/ createReactComponent<\n  JSX.IonProgressBar,\n  HTMLIonProgressBarElement\n>('ion-progress-bar');\nexport const IonRadio = /*@__PURE__*/ createReactComponent<JSX.IonRadio, HTMLIonRadioElement>(\n  'ion-radio'\n);\nexport const IonRadioGroup = /*@__PURE__*/ createReactComponent<\n  JSX.IonRadioGroup,\n  HTMLIonRadioGroupElement\n>('ion-radio-group');\nexport const IonRange = /*@__PURE__*/ createReactComponent<JSX.IonRange, HTMLIonRangeElement>(\n  'ion-range'\n);\nexport const IonRefresher = /*@__PURE__*/ createReactComponent<\n  JSX.IonRefresher,\n  HTMLIonRefresherElement\n>('ion-refresher');\nexport const IonRefresherContent = /*@__PURE__*/ createReactComponent<\n  JSX.IonRefresherContent,\n  HTMLIonRefresherContentElement\n>('ion-refresher-content');\nexport const IonReorder = /*@__PURE__*/ createReactComponent<JSX.IonReorder, HTMLIonReorderElement>(\n  'ion-reorder'\n);\nexport const IonReorderGroup = /*@__PURE__*/ createReactComponent<\n  JSX.IonReorderGroup,\n  HTMLIonReorderGroupElement\n>('ion-reorder-group');\nexport const IonRippleEffect = /*@__PURE__*/ createReactComponent<\n  JSX.IonRippleEffect,\n  HTMLIonRippleEffectElement\n>('ion-ripple-effect');\nexport const IonRow = /*@__PURE__*/ createReactComponent<JSX.IonRow, HTMLIonRowElement>('ion-row');\nexport const IonSearchbar = /*@__PURE__*/ createReactComponent<\n  JSX.IonSearchbar,\n  HTMLIonSearchbarElement\n>('ion-searchbar');\nexport const IonSegment = /*@__PURE__*/ createReactComponent<JSX.IonSegment, HTMLIonSegmentElement>(\n  'ion-segment'\n);\nexport const IonSegmentButton = /*@__PURE__*/ createReactComponent<\n  JSX.IonSegmentButton,\n  HTMLIonSegmentButtonElement\n>('ion-segment-button');\nexport const IonSelect = /*@__PURE__*/ createReactComponent<JSX.IonSelect, HTMLIonSelectElement>(\n  'ion-select'\n);\nexport const IonSelectOption = /*@__PURE__*/ createReactComponent<\n  JSX.IonSelectOption,\n  HTMLIonSelectOptionElement\n>('ion-select-option');\nexport const IonSelectPopover = /*@__PURE__*/ createReactComponent<\n  JSX.IonSelectPopover,\n  HTMLIonSelectPopoverElement\n>('ion-select-popover');\nexport const IonSkeletonText = /*@__PURE__*/ createReactComponent<\n  JSX.IonSkeletonText,\n  HTMLIonSkeletonTextElement\n>('ion-skeleton-text');\nexport const IonSlide = /*@__PURE__*/ createReactComponent<JSX.IonSlide, HTMLIonSlideElement>(\n  'ion-slide'\n);\nexport const IonSlides = /*@__PURE__*/ createReactComponent<JSX.IonSlides, HTMLIonSlidesElement>(\n  'ion-slides'\n);\nexport const IonSpinner = /*@__PURE__*/ createReactComponent<JSX.IonSpinner, HTMLIonSpinnerElement>(\n  'ion-spinner'\n);\nexport const IonSplitPane = /*@__PURE__*/ createReactComponent<\n  JSX.IonSplitPane,\n  HTMLIonSplitPaneElement\n>('ion-split-pane');\nexport const IonText = /*@__PURE__*/ createReactComponent<JSX.IonText, HTMLIonTextElement>(\n  'ion-text'\n);\nexport const IonTextarea = /*@__PURE__*/ createReactComponent<\n  JSX.IonTextarea,\n  HTMLIonTextareaElement\n>('ion-textarea');\nexport const IonThumbnail = /*@__PURE__*/ createReactComponent<\n  JSX.IonThumbnail,\n  HTMLIonThumbnailElement\n>('ion-thumbnail');\nexport const IonTitle = /*@__PURE__*/ createReactComponent<JSX.IonTitle, HTMLIonTitleElement>(\n  'ion-title'\n);\nexport const IonToggle = /*@__PURE__*/ createReactComponent<JSX.IonToggle, HTMLIonToggleElement>(\n  'ion-toggle'\n);\nexport const IonToolbar = /*@__PURE__*/ createReactComponent<JSX.IonToolbar, HTMLIonToolbarElement>(\n  'ion-toolbar'\n);\nexport const IonVirtualScroll = /*@__PURE__*/ createReactComponent<\n  JSX.IonVirtualScroll,\n  HTMLIonVirtualScrollElement\n>('ion-virtual-scroll');\n","import { OverlayEventDetail } from '@ionic/core';\nimport React from 'react';\n\nimport { attachProps, setRef } from './utils';\n\ninterface OverlayBase extends HTMLElement {\n  present: () => Promise<void>;\n  dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;\n}\n\nexport interface ReactControllerProps {\n  isOpen: boolean;\n  onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;\n  onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;\n  onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;\n  onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;\n}\n\nexport const createControllerComponent = <\n  OptionsType extends object,\n  OverlayType extends OverlayBase\n>(\n  displayName: string,\n  controller: { create: (options: OptionsType) => Promise<OverlayType> }\n) => {\n  const didDismissEventName = `on${displayName}DidDismiss`;\n  const didPresentEventName = `on${displayName}DidPresent`;\n  const willDismissEventName = `on${displayName}WillDismiss`;\n  const willPresentEventName = `on${displayName}WillPresent`;\n\n  type Props = OptionsType &\n    ReactControllerProps & {\n      forwardedRef?: React.ForwardedRef<OverlayType>;\n    };\n\n  class Overlay extends React.Component<Props> {\n    overlay?: OverlayType;\n    isUnmounted = false;\n\n    constructor(props: Props) {\n      super(props);\n      this.handleDismiss = this.handleDismiss.bind(this);\n    }\n\n    static get displayName() {\n      return displayName;\n    }\n\n    async componentDidMount() {\n      const { isOpen } = this.props;\n      if (isOpen as boolean) {\n        this.present();\n      }\n    }\n\n    componentWillUnmount() {\n      this.isUnmounted = true;\n      if (this.overlay) {\n        this.overlay.dismiss();\n      }\n    }\n\n    async componentDidUpdate(prevProps: Props) {\n      if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {\n        this.present(prevProps);\n      }\n      if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {\n        await this.overlay.dismiss();\n      }\n    }\n\n    handleDismiss(event: CustomEvent<OverlayEventDetail<any>>) {\n      if (this.props.onDidDismiss) {\n        this.props.onDidDismiss(event);\n      }\n      setRef(this.props.forwardedRef, null)\n    }\n\n    async present(prevProps?: Props) {\n      const {\n        isOpen,\n        onDidDismiss,\n        onDidPresent,\n        onWillDismiss,\n        onWillPresent,\n        ...cProps\n      } = this.props;\n      this.overlay = await controller.create({\n        ...(cProps as any),\n      });\n      attachProps(\n        this.overlay,\n        {\n          [didDismissEventName]: this.handleDismiss,\n          [didPresentEventName]: (e: CustomEvent) =>\n            this.props.onDidPresent && this.props.onDidPresent(e),\n          [willDismissEventName]: (e: CustomEvent) =>\n            this.props.onWillDismiss && this.props.onWillDismiss(e),\n          [willPresentEventName]: (e: CustomEvent) =>\n            this.props.onWillPresent && this.props.onWillPresent(e),\n        },\n        prevProps\n      );\n      // Check isOpen again since the value could have changed during the async call to controller.create\n      // It's also possible for the component to have become unmounted.\n      if (this.props.isOpen === true && this.isUnmounted === false) {\n        setRef(this.props.forwardedRef, this.overlay)\n        await this.overlay.present();\n      }\n    }\n\n    render(): null {\n      return null;\n    }\n  }\n\n  return React.forwardRef<OverlayType, Props>((props, ref) => {\n    return <Overlay {...props} forwardedRef={ref} />;\n  });\n};\n","import { AlertOptions, alertController } from '@ionic/core';\n\nimport { createControllerComponent } from './createControllerComponent';\n\nexport const IonAlert = /*@__PURE__*/ createControllerComponent<AlertOptions, HTMLIonAlertElement>(\n  'IonAlert',\n  alertController\n);\n","import { LoadingOptions, loadingController } from '@ionic/core';\n\nimport { createControllerComponent } from './createControllerComponent';\n\nexport const IonLoading = /*@__PURE__*/ createControllerComponent<\n  LoadingOptions,\n  HTMLIonLoadingElement\n>('IonLoading', loadingController);\n","import {\n  ToastButton as ToastButtonCore,\n  ToastOptions as ToastOptionsCore,\n  toastController as toastControllerCore,\n} from '@ionic/core';\n\nimport { createControllerComponent } from './createControllerComponent';\n\nexport interface ToastButton extends Omit<ToastButtonCore, 'icon'> {\n  icon?:\n    | {\n        ios: string;\n        md: string;\n      }\n    | string;\n}\n\nexport interface ToastOptions extends Omit<ToastOptionsCore, 'buttons'> {\n  buttons?: (ToastButton | string)[];\n}\n\nconst toastController = {\n  create: (options: ToastOptions) => toastControllerCore.create(options as any),\n  dismiss: (data?: any, role?: string | undefined, id?: string | undefined) =>\n    toastControllerCore.dismiss(data, role, id),\n  getTop: () => toastControllerCore.getTop(),\n};\n\nexport const IonToast = /*@__PURE__*/ createControllerComponent<ToastOptions, HTMLIonToastElement>(\n  'IonToast',\n  toastController\n);\n","import { PickerOptions, pickerController } from '@ionic/core';\n\nimport { createControllerComponent } from './createControllerComponent';\n\nexport const IonPicker = /*@__PURE__*/ createControllerComponent<\n  PickerOptions,\n  HTMLIonPickerElement\n>('IonPicker', pickerController);\n","import { OverlayEventDetail } from '@ionic/core';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { attachProps, setRef } from './utils';\n\ninterface OverlayElement extends HTMLElement {\n  present: () => Promise<void>;\n  dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;\n}\n\nexport interface ReactOverlayProps {\n  children?: React.ReactNode;\n  isOpen: boolean;\n  onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;\n  onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;\n  onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;\n  onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;\n}\n\nexport const createOverlayComponent = <\n  OverlayComponent extends object,\n  OverlayType extends OverlayElement\n>(\n  displayName: string,\n  controller: { create: (options: any) => Promise<OverlayType> }\n) => {\n  const didDismissEventName = `on${displayName}DidDismiss`;\n  const didPresentEventName = `on${displayName}DidPresent`;\n  const willDismissEventName = `on${displayName}WillDismiss`;\n  const willPresentEventName = `on${displayName}WillPresent`;\n\n  type Props = OverlayComponent &\n    ReactOverlayProps & {\n      forwardedRef?: React.ForwardedRef<OverlayType>;\n    };\n\n  let isDismissing = false;\n\n  class Overlay extends React.Component<Props> {\n    overlay?: OverlayType;\n    el!: HTMLDivElement;\n\n    constructor(props: Props) {\n      super(props);\n      if (typeof document !== 'undefined') {\n        this.el = document.createElement('div');\n      }\n      this.handleDismiss = this.handleDismiss.bind(this);\n    }\n\n    static get displayName() {\n      return displayName;\n    }\n\n    componentDidMount() {\n      if (this.props.isOpen) {\n        this.present();\n      }\n    }\n\n    componentWillUnmount() {\n      if (this.overlay) {\n        this.overlay.dismiss();\n      }\n    }\n\n    handleDismiss(event: CustomEvent<OverlayEventDetail<any>>) {\n      if (this.props.onDidDismiss) {\n        this.props.onDidDismiss(event);\n      }\n      setRef(this.props.forwardedRef, null)\n    }\n\n    shouldComponentUpdate(nextProps: Props) {\n      // Check if the overlay component is about to dismiss\n      if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {\n        isDismissing = true;\n      }\n\n      return true;\n    }\n\n    async componentDidUpdate(prevProps: Props) {\n      if (this.overlay) {\n        attachProps(this.overlay, this.props, prevProps);\n      }\n\n      if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {\n        this.present(prevProps);\n      }\n      if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {\n        await this.overlay.dismiss();\n        isDismissing = false;\n\n        /**\n         * Now that the overlay is dismissed\n         * we need to render again so that any\n         * inner components will be unmounted\n         */\n        this.forceUpdate();\n      }\n    }\n\n    async present(prevProps?: Props) {\n      const {\n        children,\n        isOpen,\n        onDidDismiss,\n        onDidPresent,\n        onWillDismiss,\n        onWillPresent,\n        ...cProps\n      } = this.props;\n      const elementProps = {\n        ...cProps,\n        ref: this.props.forwardedRef,\n        [didDismissEventName]: this.handleDismiss,\n        [didPresentEventName]: (e: CustomEvent) =>\n          this.props.onDidPresent && this.props.onDidPresent(e),\n        [willDismissEventName]: (e: CustomEvent) =>\n          this.props.onWillDismiss && this.props.onWillDismiss(e),\n        [willPresentEventName]: (e: CustomEvent) =>\n          this.props.onWillPresent && this.props.onWillPresent(e),\n      };\n\n      this.overlay = await controller.create({\n        ...elementProps,\n        component: this.el,\n        componentProps: {},\n      });\n\n      setRef(this.props.forwardedRef, this.overlay);\n      attachProps(this.overlay, elementProps, prevProps);\n\n      await this.overlay.present();\n    }\n\n    render() {\n      /**\n       * Continue to render the component even when\n       * overlay is dismissing otherwise component\n       * will be hidden before animation is done.\n       */\n      return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);\n    }\n  }\n\n  return React.forwardRef<OverlayType, Props>((props, ref) => {\n    return <Overlay {...props} forwardedRef={ref} />;\n  });\n};\n","import {\n  ActionSheetButton as ActionSheetButtonCore,\n  ActionSheetOptions as ActionSheetOptionsCore,\n  actionSheetController as actionSheetControllerCore,\n} from '@ionic/core';\n\nimport { createOverlayComponent } from './createOverlayComponent';\n\nexport interface ActionSheetButton extends Omit<ActionSheetButtonCore, 'icon'> {\n  icon?:\n    | {\n        ios: string;\n        md: string;\n      }\n    | string;\n}\n\nexport interface ActionSheetOptions extends Omit<ActionSheetOptionsCore, 'buttons'> {\n  buttons?: (ActionSheetButton | string)[];\n}\n\nconst actionSheetController = {\n  create: (options: ActionSheetOptions) => actionSheetControllerCore.create(options as any),\n  dismiss: (data?: any, role?: string | undefined, id?: string | undefined) =>\n    actionSheetControllerCore.dismiss(data, role, id),\n  getTop: () => actionSheetControllerCore.getTop(),\n};\n\nexport const IonActionSheet = /*@__PURE__*/ createOverlayComponent<\n  ActionSheetOptions,\n  HTMLIonActionSheetElement\n>('IonActionSheet', actionSheetController);\n","import { ModalOptions, modalController } from '@ionic/core';\n\nimport { createOverlayComponent } from './createOverlayComponent';\n\nexport type ReactModalOptions = Omit<ModalOptions, 'component' | 'componentProps'> & {\n  children: React.ReactNode;\n};\n\nexport const IonModal = /*@__PURE__*/ createOverlayComponent<\n  ReactModalOptions,\n  HTMLIonModalElement\n>('IonModal', modalController);\n","import { PopoverOptions, popoverController } from '@ionic/core';\n\nimport { createOverlayComponent } from './createOverlayComponent';\n\nexport type ReactPopoverOptions = Omit<PopoverOptions, 'component' | 'componentProps'> & {\n  children: React.ReactNode;\n};\n\nexport const IonPopover = /*@__PURE__*/ createOverlayComponent<\n  ReactPopoverOptions,\n  HTMLIonPopoverElement\n>('IonPopover', popoverController);\n","import React from 'react';\n\nimport { RouteInfo } from '../models/RouteInfo';\n\nexport interface StackContextState {\n  registerIonPage: (page: HTMLElement, routeInfo: RouteInfo) => void;\n  isInOutlet: () => boolean;\n}\n\nexport const StackContext = React.createContext<StackContextState>({\n  registerIonPage: () => undefined,\n  isInOutlet: () => false,\n});\n","import React from 'react';\n\nimport { mergeRefs } from '../components/utils';\nimport { IonLifeCycleContext } from '../contexts/IonLifeCycleContext';\nimport { RouteInfo } from '../models';\n\nimport { StackContext } from './StackContext';\n\ninterface PageManagerProps {\n  className?: string;\n  forwardedRef?: React.ForwardedRef<HTMLDivElement>;\n  routeInfo?: RouteInfo;\n}\n\nexport class PageManager extends React.PureComponent<PageManagerProps> {\n  ionLifeCycleContext!: React.ContextType<typeof IonLifeCycleContext>;\n  context!: React.ContextType<typeof StackContext>;\n  ionPageElementRef: React.RefObject<HTMLDivElement>;\n  stableMergedRefs: React.RefCallback<HTMLDivElement>\n\n  constructor(props: PageManagerProps) {\n    super(props);\n    this.ionPageElementRef = React.createRef();\n    // React refs must be stable (not created inline).\n    this.stableMergedRefs = mergeRefs(this.ionPageElementRef, this.props.forwardedRef)\n  }\n\n  componentDidMount() {\n    if (this.ionPageElementRef.current) {\n      if (this.context.isInOutlet()) {\n        this.ionPageElementRef.current.classList.add('ion-page-invisible');\n      }\n      this.context.registerIonPage(this.ionPageElementRef.current, this.props.routeInfo!);\n      this.ionPageElementRef.current.addEventListener(\n        'ionViewWillEnter',\n        this.ionViewWillEnterHandler.bind(this)\n      );\n      this.ionPageElementRef.current.addEventListener(\n        'ionViewDidEnter',\n        this.ionViewDidEnterHandler.bind(this)\n      );\n      this.ionPageElementRef.current.addEventListener(\n        'ionViewWillLeave',\n        this.ionViewWillLeaveHandler.bind(this)\n      );\n      this.ionPageElementRef.current.addEventListener(\n        'ionViewDidLeave',\n        this.ionViewDidLeaveHandler.bind(this)\n      );\n    }\n  }\n\n  componentWillUnmount() {\n    if (this.ionPageElementRef.current) {\n      this.ionPageElementRef.current.removeEventListener(\n        'ionViewWillEnter',\n        this.ionViewWillEnterHandler.bind(this)\n      );\n      this.ionPageElementRef.current.removeEventListener(\n        'ionViewDidEnter',\n        this.ionViewDidEnterHandler.bind(this)\n      );\n      this.ionPageElementRef.current.removeEventListener(\n        'ionViewWillLeave',\n        this.ionViewWillLeaveHandler.bind(this)\n      );\n      this.ionPageElementRef.current.removeEventListener(\n        'ionViewDidLeave',\n        this.ionViewDidLeaveHandler.bind(this)\n      );\n    }\n  }\n\n  ionViewWillEnterHandler() {\n    this.ionLifeCycleContext.ionViewWillEnter();\n  }\n\n  ionViewDidEnterHandler() {\n    this.ionLifeCycleContext.ionViewDidEnter();\n  }\n\n  ionViewWillLeaveHandler() {\n    this.ionLifeCycleContext.ionViewWillLeave();\n  }\n\n  ionViewDidLeaveHandler() {\n    this.ionLifeCycleContext.ionViewDidLeave();\n  }\n\n  render() {\n    const { className, children, routeInfo, forwardedRef, ...props } = this.props;\n\n    return (\n      <IonLifeCycleContext.Consumer>\n        {(context) => {\n          this.ionLifeCycleContext = context;\n          return (\n            <div\n              className={\n                className ? `${className} ion-page` : `ion-page`\n              }\n              ref={this.stableMergedRefs}\n              {...props}\n            >\n              {children}\n            </div>\n          );\n        }}\n      </IonLifeCycleContext.Consumer>\n    );\n  }\n\n  static get contextType() {\n    return StackContext;\n  }\n}\nexport default PageManager;\n","import React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\nimport PageManager from '../routing/PageManager';\n\nimport { IonicReactProps } from './IonicReactProps';\nimport { createForwardRef } from './utils';\n\ninterface IonPageProps extends IonicReactProps {}\n\ninterface IonPageInternalProps extends IonPageProps {\n  forwardedRef?: React.ForwardedRef<HTMLDivElement>;\n}\n\nclass IonPageInternal extends React.Component<IonPageInternalProps> {\n  context!: React.ContextType<typeof NavContext>;\n\n  constructor(props: IonPageInternalProps) {\n    super(props);\n  }\n\n  render() {\n    const { className, children, forwardedRef, ...props } = this.props;\n\n    return this.context.hasIonicRouter() ? (\n      <PageManager\n        className={className ? `${className}` : ''}\n        routeInfo={this.context.routeInfo}\n        forwardedRef={forwardedRef}\n        {...props}\n      >\n        {children}\n      </PageManager>\n    ) : (\n      <div\n        className={className ? `ion-page ${className}` : 'ion-page'}\n        ref={forwardedRef}\n        {...props}\n      >\n        {children}\n      </div>\n    );\n  }\n\n  static get displayName() {\n    return 'IonPage';\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n}\n\nexport const IonPage = createForwardRef(IonPageInternal, 'IonPage');\n","import React from 'react';\n\nexport interface IonTabsContextState {\n  activeTab: string | undefined;\n  selectTab: (tab: string) => boolean;\n}\n\nexport const IonTabsContext = React.createContext<IonTabsContextState>({\n  activeTab: undefined,\n  selectTab: () => false,\n});\n","import { JSX } from '@ionic/core';\nimport { JSX as IoniconsJSX } from 'ionicons';\n\nimport { /*@__PURE__*/ createReactComponent } from './createComponent';\n\nexport const IonTabButtonInner = /*@__PURE__*/ createReactComponent<\n  JSX.IonTabButton & { onIonTabButtonClick?: (e: CustomEvent) => void },\n  HTMLIonTabButtonElement\n>('ion-tab-button');\nexport const IonTabBarInner = /*@__PURE__*/ createReactComponent<\n  JSX.IonTabBar,\n  HTMLIonTabBarElement\n>('ion-tab-bar');\nexport const IonBackButtonInner = /*@__PURE__*/ createReactComponent<\n  Omit<JSX.IonBackButton, 'icon'>,\n  HTMLIonBackButtonElement\n>('ion-back-button');\nexport const IonRouterOutletInner = /*@__PURE__*/ createReactComponent<\n  JSX.IonRouterOutlet & {\n    setRef?: (val: HTMLIonRouterOutletElement) => void;\n    forwardedRef?: React.ForwardedRef<HTMLIonRouterOutletElement>;\n  },\n  HTMLIonRouterOutletElement\n>('ion-router-outlet');\n\n// ionicons\nexport const IonIconInner = /*@__PURE__*/ createReactComponent<\n  IoniconsJSX.IonIcon,\n  HTMLIonIconElement\n>('ion-icon');\n","import React from 'react';\n\nimport { IonRouterOutletInner } from '../components/inner-proxies';\nimport { IonLifeCycleContext } from '../contexts/IonLifeCycleContext';\nimport { RouteInfo } from '../models';\n\nimport { StackContext } from './StackContext';\n\ninterface OutletPageManagerProps {\n  className?: string;\n  forwardedRef?: React.ForwardedRef<HTMLIonRouterOutletElement>;\n  routeInfo?: RouteInfo;\n  StackManager: any;\n}\n\nexport class OutletPageManager extends React.Component<OutletPageManagerProps> {\n  ionLifeCycleContext!: React.ContextType<typeof IonLifeCycleContext>;\n  context!: React.ContextType<typeof StackContext>;\n  ionRouterOutlet: HTMLIonRouterOutletElement | undefined;\n\n  constructor(props: OutletPageManagerProps) {\n    super(props);\n  }\n\n  componentDidMount() {\n    if (this.ionRouterOutlet) {\n      setTimeout(() => {\n        this.context.registerIonPage(this.ionRouterOutlet!, this.props.routeInfo!);\n      }, 25);\n\n      this.ionRouterOutlet.addEventListener(\n        'ionViewWillEnter',\n        this.ionViewWillEnterHandler.bind(this)\n      );\n      this.ionRouterOutlet.addEventListener(\n        'ionViewDidEnter',\n        this.ionViewDidEnterHandler.bind(this)\n      );\n      this.ionRouterOutlet.addEventListener(\n        'ionViewWillLeave',\n        this.ionViewWillLeaveHandler.bind(this)\n      );\n      this.ionRouterOutlet.addEventListener(\n        'ionViewDidLeave',\n        this.ionViewDidLeaveHandler.bind(this)\n      );\n    }\n  }\n\n  componentWillUnmount() {\n    if (this.ionRouterOutlet) {\n      this.ionRouterOutlet.removeEventListener(\n        'ionViewWillEnter',\n        this.ionViewWillEnterHandler.bind(this)\n      );\n      this.ionRouterOutlet.removeEventListener(\n        'ionViewDidEnter',\n        this.ionViewDidEnterHandler.bind(this)\n      );\n      this.ionRouterOutlet.removeEventListener(\n        'ionViewWillLeave',\n        this.ionViewWillLeaveHandler.bind(this)\n      );\n      this.ionRouterOutlet.removeEventListener(\n        'ionViewDidLeave',\n        this.ionViewDidLeaveHandler.bind(this)\n      );\n    }\n  }\n\n  ionViewWillEnterHandler() {\n    this.ionLifeCycleContext.ionViewWillEnter();\n  }\n\n  ionViewDidEnterHandler() {\n    this.ionLifeCycleContext.ionViewDidEnter();\n  }\n\n  ionViewWillLeaveHandler() {\n    this.ionLifeCycleContext.ionViewWillLeave();\n  }\n\n  ionViewDidLeaveHandler() {\n    this.ionLifeCycleContext.ionViewDidLeave();\n  }\n\n  render() {\n    const { StackManager, children, routeInfo, ...props } = this.props;\n    return (\n      <IonLifeCycleContext.Consumer>\n        {(context) => {\n          this.ionLifeCycleContext = context;\n          return (\n            <StackManager routeInfo={routeInfo}>\n              <IonRouterOutletInner\n                setRef={(val: HTMLIonRouterOutletElement) => (this.ionRouterOutlet = val)}\n                {...props}\n              >\n                {children}\n              </IonRouterOutletInner>\n            </StackManager>\n          );\n        }}\n      </IonLifeCycleContext.Consumer>\n    );\n  }\n\n  static get contextType() {\n    return StackContext;\n  }\n}\nexport default OutletPageManager;\n","import { JSX as LocalJSX } from '@ionic/core';\nimport React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\nimport OutletPageManager from '../routing/OutletPageManager';\n\nimport { IonicReactProps } from './IonicReactProps';\nimport { IonRouterOutletInner } from './inner-proxies';\nimport { createForwardRef } from './utils';\n\ntype Props = LocalJSX.IonRouterOutlet & {\n  basePath?: string;\n  ref?: React.Ref<any>;\n  ionPage?: boolean;\n};\n\ninterface InternalProps extends Props {\n  forwardedRef?: React.ForwardedRef<HTMLIonRouterOutletElement>;\n}\n\ninterface InternalState {}\n\nclass IonRouterOutletContainer extends React.Component<InternalProps, InternalState> {\n  context!: React.ContextType<typeof NavContext>;\n\n  constructor(props: InternalProps) {\n    super(props);\n  }\n\n  render() {\n    const StackManager = this.context.getStackManager();\n    const { children, forwardedRef, ...props } = this.props;\n\n    return this.context.hasIonicRouter() ? (\n      props.ionPage ? (\n        <OutletPageManager\n          StackManager={StackManager}\n          routeInfo={this.context.routeInfo}\n          {...props}\n        >\n          {children}\n        </OutletPageManager>\n      ) : (\n        <StackManager routeInfo={this.context.routeInfo}>\n          <IonRouterOutletInner {...props} forwardedRef={forwardedRef}>\n            {children}\n          </IonRouterOutletInner>\n        </StackManager>\n      )\n    ) : (\n      <IonRouterOutletInner ref={forwardedRef} {...this.props}>\n        {this.props.children}\n      </IonRouterOutletInner>\n    );\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n}\n\nexport const IonRouterOutlet = createForwardRef<\n  Props & IonicReactProps,\n  HTMLIonRouterOutletElement\n>(IonRouterOutletContainer, 'IonRouterOutlet');\n","import { JSX as LocalJSX } from '@ionic/core';\nimport React from 'react';\n\nimport { RouterOptions } from '../../models';\nimport { IonicReactProps } from '../IonicReactProps';\nimport { IonTabButtonInner } from '../inner-proxies';\n\ntype Props = LocalJSX.IonTabButton &\n  IonicReactProps & {\n    routerOptions?: RouterOptions;\n    ref?: React.Ref<HTMLIonTabButtonElement>;\n    onClick?: (e: any) => void;\n  };\n\nexport class IonTabButton extends React.Component<Props> {\n  constructor(props: Props) {\n    super(props);\n    this.handleIonTabButtonClick = this.handleIonTabButtonClick.bind(this);\n  }\n\n  handleIonTabButtonClick() {\n    if (this.props.onClick) {\n      this.props.onClick(\n        new CustomEvent('ionTabButtonClick', {\n          detail: {\n            tab: this.props.tab,\n            href: this.props.href,\n            routeOptions: this.props.routerOptions,\n          },\n        })\n      );\n    }\n  }\n\n  render() {\n    const { onClick, ...rest } = this.props;\n    return (\n      <IonTabButtonInner\n        onIonTabButtonClick={this.handleIonTabButtonClick}\n        {...rest}\n      ></IonTabButtonInner>\n    );\n  }\n\n  static get displayName() {\n    return 'IonTabButton';\n  }\n}\n","import { JSX as LocalJSX } from '@ionic/core';\nimport React, { useContext } from 'react';\n\nimport { NavContext } from '../../contexts/NavContext';\nimport { RouteInfo } from '../../models';\nimport { IonicReactProps } from '../IonicReactProps';\nimport { IonTabBarInner } from '../inner-proxies';\nimport { createForwardRef } from '../utils';\n\nimport { IonTabButton } from './IonTabButton';\n\ntype IonTabBarProps = LocalJSX.IonTabBar &\n  IonicReactProps & {\n    onIonTabsDidChange?: (event: CustomEvent<{ tab: string }>) => void;\n    onIonTabsWillChange?: (event: CustomEvent<{ tab: string }>) => void;\n    slot?: 'bottom' | 'top';\n    style?: { [key: string]: string };\n  };\n\ninterface InternalProps extends IonTabBarProps {\n  forwardedRef?: React.ForwardedRef<HTMLIonIconElement>;\n  onSetCurrentTab: (tab: string, routeInfo: RouteInfo) => void;\n  routeInfo: RouteInfo;\n}\n\ninterface TabUrls {\n  originalHref: string;\n  currentHref: string;\n  originalRouteOptions?: unknown;\n  currentRouteOptions?: unknown;\n}\n\ninterface IonTabBarState {\n  activeTab?: string;\n  tabs: { [key: string]: TabUrls };\n}\n\nclass IonTabBarUnwrapped extends React.PureComponent<InternalProps, IonTabBarState> {\n  context!: React.ContextType<typeof NavContext>;\n\n  constructor(props: InternalProps) {\n    super(props);\n    const tabs: { [key: string]: TabUrls } = {};\n    React.Children.forEach((props as any).children, (child: any) => {\n      if (\n        child != null &&\n        typeof child === 'object' &&\n        child.props &&\n        (child.type === IonTabButton || child.type.isTabButton)\n      ) {\n        tabs[child.props.tab] = {\n          originalHref: child.props.href,\n          currentHref: child.props.href,\n          originalRouteOptions:\n            child.props.href === props.routeInfo?.pathname\n              ? props.routeInfo?.routeOptions\n              : undefined,\n          currentRouteOptions:\n            child.props.href === props.routeInfo?.pathname\n              ? props.routeInfo?.routeOptions\n              : undefined,\n        };\n      }\n    });\n\n    this.state = {\n      tabs,\n    };\n\n    this.onTabButtonClick = this.onTabButtonClick.bind(this);\n    this.renderTabButton = this.renderTabButton.bind(this);\n    this.setActiveTabOnContext = this.setActiveTabOnContext.bind(this);\n    this.selectTab = this.selectTab.bind(this);\n  }\n\n  componentDidMount() {\n    const tabs = this.state.tabs;\n    const tabKeys = Object.keys(tabs);\n    const activeTab = tabKeys.find((key) => {\n      const href = tabs[key].originalHref;\n      return this.props.routeInfo!.pathname.startsWith(href);\n    });\n\n    if (activeTab) {\n      this.setState({\n        activeTab,\n      });\n    }\n  }\n\n  componentDidUpdate() {\n    if (this.state.activeTab) {\n      this.setActiveTabOnContext(this.state.activeTab);\n    }\n  }\n\n  setActiveTabOnContext = (_tab: string) => {};\n\n  selectTab(tab: string) {\n    const tabUrl = this.state.tabs[tab];\n    if (tabUrl) {\n      this.onTabButtonClick(\n        new CustomEvent('ionTabButtonClick', {\n          detail: {\n            href: tabUrl.currentHref,\n            tab,\n            selected: tab === this.state.activeTab,\n            routeOptions: undefined,\n          },\n        })\n      );\n      return true;\n    }\n    return false;\n  }\n\n  static getDerivedStateFromProps(props: InternalProps, state: IonTabBarState) {\n    const tabs = { ...state.tabs };\n    const tabKeys = Object.keys(state.tabs);\n    const activeTab = tabKeys.find((key) => {\n      const href = state.tabs[key].originalHref;\n      return props.routeInfo!.pathname.startsWith(href);\n    });\n\n    // Check to see if the tab button href has changed, and if so, update it in the tabs state\n    React.Children.forEach((props as any).children, (child: any) => {\n      if (\n        child != null &&\n        typeof child === 'object' &&\n        child.props &&\n        (child.type === IonTabButton || child.type.isTabButton)\n      ) {\n        const tab = tabs[child.props.tab];\n        if (!tab || tab.originalHref !== child.props.href) {\n          tabs[child.props.tab] = {\n            originalHref: child.props.href,\n            currentHref: child.props.href,\n            originalRouteOptions: child.props.routeOptions,\n            currentRouteOptions: child.props.routeOptions,\n          };\n        }\n      }\n    });\n\n    const { activeTab: prevActiveTab } = state;\n    if (activeTab && prevActiveTab) {\n      const prevHref = state.tabs[prevActiveTab].currentHref;\n      const prevRouteOptions = state.tabs[prevActiveTab].currentRouteOptions;\n      if (\n        activeTab !== prevActiveTab ||\n        prevHref !== props.routeInfo?.pathname ||\n        prevRouteOptions !== props.routeInfo?.routeOptions\n      ) {\n        tabs[activeTab] = {\n          originalHref: tabs[activeTab].originalHref,\n          currentHref: props.routeInfo!.pathname + (props.routeInfo!.search || ''),\n          originalRouteOptions: tabs[activeTab].originalRouteOptions,\n          currentRouteOptions: props.routeInfo?.routeOptions,\n        };\n        if (props.routeInfo.routeAction === 'pop' && activeTab !== prevActiveTab) {\n          // If navigating back and the tabs change, set the prev tab back to its original href\n          tabs[prevActiveTab] = {\n            originalHref: tabs[prevActiveTab].originalHref,\n            currentHref: tabs[prevActiveTab].originalHref,\n            originalRouteOptions: tabs[prevActiveTab].originalRouteOptions,\n            currentRouteOptions: tabs[prevActiveTab].currentRouteOptions,\n          };\n        }\n      }\n    }\n\n    activeTab && props.onSetCurrentTab(activeTab, props.routeInfo);\n\n    return {\n      activeTab,\n      tabs,\n    };\n  }\n\n  private onTabButtonClick(\n    e: CustomEvent<{ href: string; selected: boolean; tab: string; routeOptions: unknown }>\n  ) {\n    const tappedTab = this.state.tabs[e.detail.tab];\n    const originalHref = tappedTab.originalHref;\n    const currentHref = e.detail.href;\n    const { activeTab: prevActiveTab } = this.state;\n    // this.props.onSetCurrentTab(e.detail.tab, this.props.routeInfo);\n    // Clicking the current tab will bring you back to the original href\n    if (prevActiveTab === e.detail.tab) {\n      if (originalHref !== currentHref) {\n        this.context.resetTab(e.detail.tab, originalHref, tappedTab.originalRouteOptions);\n      }\n    } else {\n      if (this.props.onIonTabsWillChange) {\n        this.props.onIonTabsWillChange(\n          new CustomEvent('ionTabWillChange', { detail: { tab: e.detail.tab } })\n        );\n      }\n      if (this.props.onIonTabsDidChange) {\n        this.props.onIonTabsDidChange(\n          new CustomEvent('ionTabDidChange', { detail: { tab: e.detail.tab } })\n        );\n      }\n      this.setActiveTabOnContext(e.detail.tab);\n      this.context.changeTab(e.detail.tab, currentHref, e.detail.routeOptions);\n    }\n  }\n\n  private renderTabButton(activeTab: string | null | undefined) {\n    return (\n      child:\n        | React.ReactElement<\n            LocalJSX.IonTabButton & { onClick: (e: any) => void; routeOptions?: unknown }\n          >\n        | null\n        | undefined\n    ) => {\n      if (\n        child != null &&\n        child.props &&\n        (child.type === IonTabButton || (child as any).type.isTabButton)\n      ) {\n        const href =\n          child.props.tab === activeTab\n            ? this.props.routeInfo?.pathname\n            : this.state.tabs[child.props.tab!].currentHref;\n        const routeOptions =\n          child.props.tab === activeTab\n            ? this.props.routeInfo?.routeOptions\n            : this.state.tabs[child.props.tab!].currentRouteOptions;\n\n        return React.cloneElement(child, {\n          href,\n          routeOptions,\n          onClick: this.onTabButtonClick,\n        });\n      }\n      return null;\n    };\n  }\n\n  render() {\n    const { activeTab } = this.state;\n    return (\n      <IonTabBarInner {...this.props} selectedTab={activeTab}>\n        {React.Children.map(this.props.children as any, this.renderTabButton(activeTab))}\n      </IonTabBarInner>\n    );\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n}\n\nconst IonTabBarContainer: React.FC<InternalProps> = React.memo<InternalProps>(\n  ({ forwardedRef, ...props }) => {\n    const context = useContext(NavContext);\n    return (\n      <IonTabBarUnwrapped\n        ref={forwardedRef}\n        {...(props as any)}\n        routeInfo={props.routeInfo || context.routeInfo || { pathname: window.location.pathname }}\n        onSetCurrentTab={context.setCurrentTab}\n      >\n        {props.children}\n      </IonTabBarUnwrapped>\n    );\n  }\n);\n\nexport const IonTabBar = createForwardRef<IonTabBarProps, HTMLIonTabBarElement>(\n  IonTabBarContainer,\n  'IonTabBar'\n);\n","import { JSX as LocalJSX } from '@ionic/core';\nimport React, { Fragment } from 'react';\n\nimport { NavContext } from '../../contexts/NavContext';\nimport PageManager from '../../routing/PageManager';\nimport { IonRouterOutlet } from '../IonRouterOutlet';\n\nimport { IonTabBar } from './IonTabBar';\nimport { IonTabsContext, IonTabsContextState } from './IonTabsContext';\n\nclass IonTabsElement extends HTMLElement {\n  constructor() {\n    super();\n  }\n}\n\nif (window && window.customElements) {\n  const element = customElements.get('ion-tabs');\n  if (!element) {\n    customElements.define('ion-tabs', IonTabsElement);\n  }\n}\n\ndeclare global {\n  namespace JSX {\n    interface IntrinsicElements {\n      'ion-tabs': any;\n    }\n  }\n}\n\ntype ChildFunction = (ionTabContext: IonTabsContextState) => React.ReactNode;\n\ninterface Props extends LocalJSX.IonTabs {\n  className?: string;\n  children: ChildFunction | React.ReactNode;\n}\n\nconst hostStyles: React.CSSProperties = {\n  display: 'flex',\n  position: 'absolute',\n  top: '0',\n  left: '0',\n  right: '0',\n  bottom: '0',\n  flexDirection: 'column',\n  width: '100%',\n  height: '100%',\n  contain: 'layout size style',\n};\n\nconst tabsInner: React.CSSProperties = {\n  position: 'relative',\n  flex: 1,\n  contain: 'layout size style',\n};\n\nexport class IonTabs extends React.Component<Props> {\n  context!: React.ContextType<typeof NavContext>;\n  routerOutletRef: React.Ref<HTMLIonRouterOutletElement> = React.createRef();\n  selectTabHandler?: (tag: string) => boolean;\n  tabBarRef = React.createRef<any>();\n\n  ionTabContextState: IonTabsContextState = {\n    activeTab: undefined,\n    selectTab: () => false,\n  };\n\n  constructor(props: Props) {\n    super(props);\n  }\n\n  componentDidMount() {\n    if (this.tabBarRef.current) {\n      // Grab initial value\n      this.ionTabContextState.activeTab = this.tabBarRef.current.state.activeTab;\n      // Override method\n      this.tabBarRef.current.setActiveTabOnContext = (tab: string) => {\n        this.ionTabContextState.activeTab = tab;\n      };\n      this.ionTabContextState.selectTab = this.tabBarRef.current.selectTab;\n    }\n  }\n\n  render() {\n    let outlet: React.ReactElement<{}> | undefined;\n    let tabBar: React.ReactElement | undefined;\n    const { className, onIonTabsDidChange, onIonTabsWillChange, ...props } = this.props;\n\n    const children =\n      typeof this.props.children === 'function'\n        ? (this.props.children as ChildFunction)(this.ionTabContextState)\n        : this.props.children;\n\n    React.Children.forEach(children, (child: any) => {\n      if (child == null || typeof child !== 'object' || !child.hasOwnProperty('type')) {\n        return;\n      }\n      if (child.type === IonRouterOutlet || child.type.isRouterOutlet) {\n        outlet = React.cloneElement(child, { tabs: true });\n      } else if (child.type === Fragment && child.props.children[0].type === IonRouterOutlet) {\n        outlet = child.props.children[0];\n      }\n\n      let childProps: any = {\n        ref: this.tabBarRef\n      }\n\n      /**\n       * Only pass these props\n       * down from IonTabs to IonTabBar\n       * if they are defined, otherwise\n       * if you have a handler set on\n       * IonTabBar it will be overridden.\n       */\n      if (onIonTabsDidChange !== undefined) {\n        childProps = {\n          ...childProps,\n          onIonTabsDidChange\n        }\n      }\n\n      if (onIonTabsWillChange !== undefined) {\n        childProps = {\n          ...childProps,\n          onIonTabsWillChange\n        }\n      }\n\n      if (child.type === IonTabBar || child.type.isTabBar) {\n        tabBar = React.cloneElement(child, childProps);\n      } else if (\n        child.type === Fragment &&\n        (child.props.children[1].type === IonTabBar || child.props.children[1].type.isTabBar)\n      ) {\n        tabBar = React.cloneElement(child.props.children[1], childProps);\n      }\n    });\n\n    if (!outlet) {\n      throw new Error('IonTabs must contain an IonRouterOutlet');\n    }\n    if (!tabBar) {\n      throw new Error('IonTabs needs a IonTabBar');\n    }\n\n    return (\n      <IonTabsContext.Provider value={this.ionTabContextState}>\n        {this.context.hasIonicRouter() ? (\n          <PageManager\n            className={className ? `${className}` : ''}\n            routeInfo={this.context.routeInfo}\n            {...props}\n          >\n            <ion-tabs className=\"ion-tabs\" style={hostStyles}>\n              {tabBar.props.slot === 'top' ? tabBar : null}\n              <div style={tabsInner} className=\"tabs-inner\">\n                {outlet}\n              </div>\n              {tabBar.props.slot === 'bottom' ? tabBar : null}\n            </ion-tabs>\n          </PageManager>\n        ) : (\n          <div className={className ? `${className}` : 'ion-tabs'} {...props} style={hostStyles}>\n            {tabBar.props.slot === 'top' ? tabBar : null}\n            <div style={tabsInner} className=\"tabs-inner\">\n              {outlet}\n            </div>\n            {tabBar.props.slot === 'bottom' ? tabBar : null}\n          </div>\n        )}\n      </IonTabsContext.Provider>\n    );\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n}\n","import { JSX as LocalJSX } from '@ionic/core';\nimport React from 'react';\n\nimport { NavContext } from '../../contexts/NavContext';\nimport { IonicReactProps } from '../IonicReactProps';\nimport { IonBackButtonInner } from '../inner-proxies';\n\ntype Props = Omit<LocalJSX.IonBackButton, 'icon'> &\n  IonicReactProps & {\n    icon?:\n      | {\n          ios: string;\n          md: string;\n        }\n      | string;\n    ref?: React.Ref<HTMLIonBackButtonElement>;\n  };\n\nexport const IonBackButton = /*@__PURE__*/ (() =>\n  class extends React.Component<Props> {\n    context!: React.ContextType<typeof NavContext>;\n\n    clickButton = (e: React.MouseEvent) => {\n      const { defaultHref, routerAnimation } = this.props;\n      if (this.context.hasIonicRouter()) {\n        e.stopPropagation();\n        this.context.goBack(defaultHref, routerAnimation);\n      } else if (defaultHref !== undefined) {\n        window.location.href = defaultHref;\n      }\n    };\n\n    render() {\n      return <IonBackButtonInner onClick={this.clickButton} {...this.props}></IonBackButtonInner>;\n    }\n\n    static get displayName() {\n      return 'IonBackButton';\n    }\n\n    static get contextType() {\n      return NavContext;\n    }\n  })();\n","export const isDevMode = () => {\n  return process && process.env && process.env.NODE_ENV === 'development';\n};\n\nconst warnings: { [key: string]: boolean } = {};\n\nexport const deprecationWarning = (key: string, message: string) => {\n  if (isDevMode()) {\n    if (!warnings[key]) {\n      console.warn(message);\n      warnings[key] = true;\n    }\n  }\n};\n","import React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\n\nimport { IonicReactProps } from './IonicReactProps';\nimport { IonIconInner } from './inner-proxies';\nimport { createForwardRef, isPlatform } from './utils';\nimport { deprecationWarning } from './utils/dev';\n\ninterface IonIconProps {\n  ariaLabel?: string;\n  color?: string;\n  flipRtl?: boolean;\n  icon?: string;\n  ios?: string;\n  lazy?: boolean;\n  md?: string;\n  mode?: 'ios' | 'md';\n  name?: string;\n  size?: string;\n  src?: string;\n}\n\ntype InternalProps = IonIconProps & {\n  forwardedRef?: React.ForwardedRef<HTMLIonIconElement>;\n};\n\nclass IonIconContainer extends React.PureComponent<InternalProps> {\n  constructor(props: InternalProps) {\n    super(props);\n    if (this.props.name) {\n      deprecationWarning(\n        'icon-name',\n        'In Ionic React, you import icons from \"ionicons/icons\" and set the icon you imported to the \"icon\" property. Setting the \"name\" property has no effect.'\n      );\n    }\n  }\n\n  render() {\n    const { icon, ios, md, ...rest } = this.props;\n\n    let iconToUse: typeof icon;\n\n    if (ios || md) {\n      if (isPlatform('ios')) {\n        iconToUse = ios ?? md ?? icon;\n      } else {\n        iconToUse = md ?? ios ?? icon;\n      }\n    } else {\n      iconToUse = icon;\n    }\n\n    return (\n      <IonIconInner ref={this.props.forwardedRef} icon={iconToUse} {...rest}>\n        {this.props.children}\n      </IonIconInner>\n    );\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n}\n\nexport const IonIcon = createForwardRef<IonIconProps & IonicReactProps, HTMLIonIconElement>(\n  IonIconContainer,\n  'IonIcon'\n);\n","import React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\n\nexport interface IonRouteProps {\n  path?: string;\n  exact?: boolean;\n  show?: boolean;\n  render: (props?: any) => JSX.Element;\n  disableIonPageManagement?: boolean;\n}\n\ninterface IonRouteState {}\n\nexport class IonRoute extends React.PureComponent<IonRouteProps, IonRouteState> {\n  context!: React.ContextType<typeof NavContext>;\n\n  render() {\n    const IonRouteInner = this.context.getIonRoute();\n\n    if (!this.context.hasIonicRouter() || !IonRoute) {\n      console.error(\n        'You either do not have an Ionic Router package, or your router does not support using <IonRoute>'\n      );\n      return null;\n    }\n\n    return <IonRouteInner {...this.props} />;\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n}\n","import React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\n\nexport interface IonRedirectProps {\n  path?: string;\n  exact?: boolean;\n  to: string;\n  routerOptions?: unknown;\n}\n\ninterface IonRedirectState {}\n\nexport class IonRedirect extends React.PureComponent<IonRedirectProps, IonRedirectState> {\n  context!: React.ContextType<typeof NavContext>;\n\n  render() {\n    const IonRedirectInner = this.context.getIonRedirect();\n\n    if (!this.context.hasIonicRouter() || !IonRedirect) {\n      console.error(\n        'You either do not have an Ionic Router package, or your router does not support using <IonRedirect>'\n      );\n      return null;\n    }\n\n    return <IonRedirectInner {...this.props} />;\n  }\n\n  static get contextType() {\n    return NavContext;\n  }\n}\n","import { AnimationBuilder } from '@ionic/core';\nimport React, { useContext } from 'react';\n\nimport { RouteAction, RouterDirection, RouterOptions } from '../models';\nimport { RouteInfo } from '../models/RouteInfo';\n\nexport interface IonRouterContextState {\n  routeInfo: RouteInfo;\n  push: (\n    pathname: string,\n    routerDirection?: RouterDirection,\n    routeAction?: RouteAction,\n    routerOptions?: RouterOptions,\n    animationBuilder?: AnimationBuilder\n  ) => void;\n  back: (animationBuilder?: AnimationBuilder) => void;\n  canGoBack: () => boolean;\n  nativeBack: () => void;\n}\n\nexport const IonRouterContext = React.createContext<IonRouterContextState>({\n  routeInfo: undefined as any,\n  push: () => {\n    throw new Error('An Ionic Router is required for IonRouterContext');\n  },\n  back: () => {\n    throw new Error('An Ionic Router is required for IonRouterContext');\n  },\n  canGoBack: () => {\n    throw new Error('An Ionic Router is required for IonRouterContext');\n  },\n  nativeBack: () => {\n    throw new Error('An Ionic Router is required for IonRouterContext');\n  },\n});\n\n/**\n * A hook for more direct control over routing in an Ionic React applicaiton. Allows you to pass additional meta-data to the router before the call to the native router.\n */\nexport function useIonRouter(): UseIonRouterResult {\n  const context = useContext(IonRouterContext);\n  return {\n    back: context.back,\n    push: context.push,\n    goBack: context.back,\n    canGoBack: context.canGoBack,\n    routeInfo: context.routeInfo,\n  };\n}\n\nexport type UseIonRouterResult = {\n  /**\n   * @deprecated - Use goBack instead\n   * @param animationBuilder - Optional - A custom transition animation to use\n   */\n  back(animationBuilder?: AnimationBuilder): void;\n  /**\n   * Navigates to a new pathname\n   * @param pathname - The path to navigate to\n   * @param routerDirection - Optional - The RouterDirection to use for transition purposes, defaults to 'forward'\n   * @param routeAction - Optional - The RouteAction to use for history purposes, defaults to 'push'\n   * @param routerOptions - Optional - Any additional parameters to pass to the router\n   * @param animationBuilder - Optional - A custom transition animation to use\n   */\n  push(\n    pathname: string,\n    routerDirection?: RouterDirection,\n    routeAction?: RouteAction,\n    routerOptions?: RouterOptions,\n    animationBuilder?: AnimationBuilder\n  ): void;\n  /**\n   * Navigates backwards in history, using the IonRouter to determine history\n   * @param animationBuilder - Optional - A custom transition animation to use\n   */\n  goBack(animationBuilder?: AnimationBuilder): void;\n  /**\n   * Determines if there are any additional routes in the the Router's history. However, routing is not prevented if the browser's history has more entries. Returns true if more entries exist, false if not.\n   */\n  canGoBack(): boolean;\n  routeInfo: RouteInfo;\n};\n","import {\n  Animation,\n  AnimationCallbackOptions,\n  AnimationDirection,\n  AnimationFill,\n  AnimationKeyFrames,\n  AnimationLifecycle,\n  createAnimation,\n} from '@ionic/core';\nimport React from 'react';\n\ninterface PartialPropertyValue {\n  property: string;\n  value: any;\n}\ninterface PropertyValue {\n  property: string;\n  fromValue: any;\n  toValue: any;\n}\n\nexport interface CreateAnimationProps {\n  delay?: number;\n  direction?: AnimationDirection;\n  duration?: number;\n  easing?: string;\n  fill?: AnimationFill;\n  iterations?: number;\n  id?: string;\n\n  afterAddRead?: () => void;\n  afterAddWrite?: () => void;\n  afterClearStyles?: string[];\n  afterStyles?: { [property: string]: any };\n  afterAddClass?: string | string[];\n  afterRemoveClass?: string | string[];\n\n  beforeAddRead?: () => void;\n  beforeAddWrite?: () => void;\n  beforeClearStyles?: string[];\n  beforeStyles?: { [property: string]: any };\n  beforeAddClass?: string | string[];\n  beforeRemoveClass?: string | string[];\n\n  onFinish?: { callback: AnimationLifecycle; opts?: AnimationCallbackOptions };\n\n  keyframes?: AnimationKeyFrames;\n  from?: PartialPropertyValue[] | PartialPropertyValue;\n  to?: PartialPropertyValue[] | PartialPropertyValue;\n  fromTo?: PropertyValue[] | PropertyValue;\n\n  play?: boolean;\n  pause?: boolean;\n  stop?: boolean;\n  destroy?: boolean;\n\n  progressStart?: { forceLinearEasing: boolean; step?: number };\n  progressStep?: { step: number };\n  progressEnd?: { playTo: 0 | 1 | undefined; step: number; dur?: number };\n}\n\nexport class CreateAnimation extends React.PureComponent<CreateAnimationProps> {\n  nodes: Map<number, HTMLElement> = new Map();\n  animation: Animation;\n\n  constructor(props: any) {\n    super(props);\n\n    this.animation = createAnimation(props.id);\n  }\n\n  setupAnimation(props: any) {\n    const animation = this.animation;\n\n    if (this.nodes.size > 0) {\n      animation.addElement(Array.from(this.nodes.values()));\n    }\n\n    checkConfig(animation, props);\n    checkPlayback(animation, props);\n  }\n\n  componentDidMount() {\n    const props = this.props;\n    this.setupAnimation(props);\n  }\n\n  componentDidUpdate(prevProps: any) {\n    const animation = this.animation;\n\n    const props = this.props;\n\n    checkConfig(animation, props, prevProps);\n    checkProgress(animation, props, prevProps);\n    checkPlayback(animation, props, prevProps);\n  }\n\n  render() {\n    const { children } = this.props;\n    return (\n      <>\n        {React.Children.map(children, (child, id) =>\n          React.cloneElement(child as any, { ref: (el: any) => this.nodes.set(id, el) })\n        )}\n      </>\n    );\n  }\n}\n\nconst checkConfig = (animation: Animation, currentProps: any = {}, prevProps: any = {}) => {\n  const reservedProps = [\n    'children',\n    'progressStart',\n    'progressStep',\n    'progressEnd',\n    'pause',\n    'stop',\n    'destroy',\n    'play',\n    'from',\n    'to',\n    'fromTo',\n    'onFinish',\n  ];\n  for (const key in currentProps) {\n    if (\n      currentProps.hasOwnProperty(key) &&\n      !reservedProps.includes(key) &&\n      currentProps[key] !== prevProps[key]\n    ) {\n      (animation as any)[key]((currentProps as any)[key]);\n    }\n  }\n\n  const fromValues = currentProps.from;\n  if (fromValues && fromValues !== prevProps.from) {\n    const values = Array.isArray(fromValues) ? fromValues : [fromValues];\n    values.forEach((val) => animation.from(val.property, val.value));\n  }\n\n  const toValues = currentProps.to;\n  if (toValues && toValues !== prevProps.to) {\n    const values = Array.isArray(toValues) ? toValues : [toValues];\n    values.forEach((val) => animation.to(val.property, val.value));\n  }\n\n  const fromToValues = currentProps.fromTo;\n  if (fromToValues && fromToValues !== prevProps.fromTo) {\n    const values = Array.isArray(fromToValues) ? fromToValues : [fromToValues];\n    values.forEach((val) => animation.fromTo(val.property, val.fromValue, val.toValue));\n  }\n\n  const onFinishValues = currentProps.onFinish;\n  if (onFinishValues && onFinishValues !== prevProps.onFinish) {\n    const values = Array.isArray(onFinishValues) ? onFinishValues : [onFinishValues];\n    values.forEach((val) => animation.onFinish(val.callback, val.opts));\n  }\n};\n\nconst checkProgress = (animation: Animation, currentProps: any = {}, prevProps: any = {}) => {\n  const { progressStart, progressStep, progressEnd } = currentProps;\n\n  if (\n    progressStart &&\n    (prevProps.progressStart?.forceLinearEasing !== progressStart?.forceLinearEasing ||\n      prevProps.progressStart?.step !== progressStart?.step)\n  ) {\n    animation.progressStart(progressStart.forceLinearEasing, progressStart.step);\n  }\n\n  if (progressStep && prevProps.progressStep?.step !== progressStep?.step) {\n    animation.progressStep(progressStep.step);\n  }\n\n  if (\n    progressEnd &&\n    (prevProps.progressEnd?.playTo !== progressEnd?.playTo ||\n      prevProps.progressEnd?.step !== progressEnd?.step ||\n      prevProps?.dur !== progressEnd?.dur)\n  ) {\n    animation.progressEnd(progressEnd.playTo, progressEnd.step, progressEnd.dur);\n  }\n};\n\nconst checkPlayback = (animation: Animation, currentProps: any = {}, prevProps: any = {}) => {\n  if (!prevProps.play && currentProps.play) {\n    animation.play();\n  }\n\n  if (!prevProps.pause && currentProps.pause) {\n    animation.pause();\n  }\n\n  if (!prevProps.stop && currentProps.stop) {\n    animation.stop();\n  }\n\n  if (!prevProps.destroy && currentProps.destroy) {\n    animation.destroy();\n  }\n};\n","import { OverlayEventDetail } from '@ionic/core';\nimport { useMemo, useRef } from 'react';\n\nimport { attachProps } from '../components/utils';\n\nimport { HookOverlayOptions } from './HookOverlayOptions';\n\ninterface OverlayBase extends HTMLElement {\n  present: () => Promise<void>;\n  dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;\n}\n\nexport function useController<\n  OptionsType,\n  OverlayType extends OverlayBase\n>(\n  displayName: string,\n  controller: { create: (options: OptionsType) => Promise<OverlayType> }\n) {\n  const overlayRef = useRef<OverlayType>();\n  const didDismissEventName = useMemo(\n    () => `on${displayName}DidDismiss`,\n    [displayName]\n  );\n  const didPresentEventName = useMemo(\n    () => `on${displayName}DidPresent`,\n    [displayName]\n  );\n  const willDismissEventName = useMemo(\n    () => `on${displayName}WillDismiss`,\n    [displayName]\n  );\n  const willPresentEventName = useMemo(\n    () => `on${displayName}WillPresent`,\n    [displayName]\n  );\n\n  const present = async (options: OptionsType & HookOverlayOptions) => {\n    if (overlayRef.current) {\n      return;\n    }\n    const {\n      onDidDismiss,\n      onWillDismiss,\n      onDidPresent,\n      onWillPresent,\n      ...rest\n    } = options;\n\n    const handleDismiss = (event: CustomEvent<OverlayEventDetail<any>>) => {\n      if (onDidDismiss) {\n        onDidDismiss(event);\n      }\n      overlayRef.current = undefined;\n    }\n\n    overlayRef.current = await controller.create({\n      ...(rest as any),\n    });\n\n    attachProps(overlayRef.current, {\n      [didDismissEventName]: handleDismiss,\n      [didPresentEventName]: (e: CustomEvent) =>\n        onDidPresent && onDidPresent(e),\n      [willDismissEventName]: (e: CustomEvent) =>\n        onWillDismiss && onWillDismiss(e),\n      [willPresentEventName]: (e: CustomEvent) =>\n        onWillPresent && onWillPresent(e),\n    });\n\n    overlayRef.current.present();\n  };\n\n  const dismiss = async () => {\n    overlayRef.current && await overlayRef.current.dismiss();\n    overlayRef.current = undefined;\n  };\n\n  return {\n    present,\n    dismiss,\n  };\n}\n","import { ActionSheetButton, ActionSheetOptions, actionSheetController } from '@ionic/core';\n\nimport { HookOverlayOptions } from './HookOverlayOptions';\nimport { useController } from './useController';\n\n/**\n * A hook for presenting/dismissing an IonActionSheet component\n * @returns Returns the present and dismiss methods in an array\n */\nexport function useIonActionSheet(): UseIonActionSheetResult {\n  const controller = useController<ActionSheetOptions, HTMLIonActionSheetElement>(\n    'IonActionSheet',\n    actionSheetController\n  );\n\n  function present(buttons: ActionSheetButton[], header?: string): void;\n  function present(options: ActionSheetOptions & HookOverlayOptions): void;\n  function present(buttonsOrOptions: ActionSheetButton[] | ActionSheetOptions & HookOverlayOptions, header?: string) {\n    if (Array.isArray(buttonsOrOptions)) {\n      controller.present({\n        buttons: buttonsOrOptions,\n        header\n      });\n    } else {\n      controller.present(buttonsOrOptions);\n    }\n  }\n\n  return [\n    present,\n    controller.dismiss\n  ];\n}\n\nexport type UseIonActionSheetResult = [\n  {\n    /**\n     * Presents the action sheet\n     * @param buttons An array of buttons for the action sheet\n     * @param header Optional - Title for the action sheet\n     */\n    (buttons: ActionSheetButton[], header?: string | undefined): void;\n    /**\n     * Presents the action sheet\n     * @param options The options to pass to the IonActionSheet\n     */\n    (options: ActionSheetOptions & HookOverlayOptions): void;\n  },\n  /**\n   * Dismisses the action sheet\n   */\n  () => void\n];\n","import { AlertButton, AlertOptions, alertController } from '@ionic/core';\n\nimport { HookOverlayOptions } from './HookOverlayOptions';\nimport { useController } from './useController';\n\n/**\n * A hook for presenting/dismissing an IonAlert component\n * @returns Returns the present and dismiss methods in an array\n */\nexport function useIonAlert(): UseIonAlertResult {\n  const controller = useController<AlertOptions, HTMLIonAlertElement>(\n    'IonAlert',\n    alertController\n  );\n\n  function present(message: string, buttons?: AlertButton[]): void;\n  function present(options: AlertOptions & HookOverlayOptions): void;\n  function present(messageOrOptions: string | AlertOptions & HookOverlayOptions, buttons?: AlertButton[]) {\n    if (typeof messageOrOptions === 'string') {\n      controller.present({\n        message: messageOrOptions,\n        buttons: buttons ?? [{ text: 'Ok' }]\n      });\n    } else {\n      controller.present(messageOrOptions);\n    }\n  };\n\n  return [\n    present,\n    controller.dismiss\n  ];\n}\n\nexport type UseIonAlertResult = [\n  {\n    /**\n     * Presents the alert\n     * @param message The main message to be displayed in the alert\n     * @param buttons Optional - Array of buttons to be added to the alert\n     */\n    (message: string, buttons?: AlertButton[]): void;\n    /**\n     * Presents the alert\n     * @param options The options to pass to the IonAlert\n     */\n    (options: AlertOptions & HookOverlayOptions): void;\n  },\n  /**\n   * Dismisses the alert\n   */\n  () => void\n];\n","import { ToastOptions, toastController } from '@ionic/core';\n\nimport { HookOverlayOptions } from './HookOverlayOptions';\nimport { useController } from './useController';\n\n/**\n * A hook for presenting/dismissing an IonToast component\n * @returns Returns the present and dismiss methods in an array\n */\nexport function useIonToast(): UseIonToastResult {\n  const controller = useController<ToastOptions, HTMLIonToastElement>(\n    'IonToast',\n    toastController\n  );\n\n  function present(message: string, duration?: number): void;\n  function present(options: ToastOptions & HookOverlayOptions): void;\n  function present(messageOrOptions: string | ToastOptions & HookOverlayOptions, duration?: number) {\n    if (typeof messageOrOptions === 'string') {\n      controller.present({\n        message: messageOrOptions,\n        duration\n      });\n    } else {\n      controller.present(messageOrOptions);\n    }\n  };\n\n  return [\n    present,\n    controller.dismiss\n  ];\n}\n\nexport type UseIonToastResult = [\n  {\n    /**\n     * Presents the toast\n     * @param message Message to be shown in the toast.\n     * @param duration Optional - How many milliseconds to wait before hiding the toast. By default, it will show until dismissToast() is called.\n     */\n    (message: string, duration?: number): void;\n    /**\n     * Presents the Toast\n     * @param options The options to pass to the IonToast.\n     */\n    (options: ToastOptions & HookOverlayOptions): void;\n  },\n  /**\n   * Dismisses the toast\n   */\n  () => void\n];\n","import { OverlayEventDetail } from '@ionic/core';\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { attachProps } from '../components/utils';\n\nimport { HookOverlayOptions } from './HookOverlayOptions';\n\nexport type ReactComponentOrElement = React.ComponentClass<any, any> | React.FC<any> | JSX.Element;\n\ninterface OverlayBase extends HTMLElement {\n  present: () => Promise<void>;\n  dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;\n}\n\nexport function useOverlay<\n  OptionsType,\n  OverlayType extends OverlayBase\n>(\n  displayName: string,\n  controller: { create: (options: OptionsType) => Promise<OverlayType>; },\n  component: ReactComponentOrElement,\n  componentProps?: any\n) {\n  const overlayRef = useRef<OverlayType>();\n  const containerElRef = useRef<HTMLDivElement>();\n  const didDismissEventName = useMemo(\n    () => `on${displayName}DidDismiss`,\n    [displayName]\n  );\n  const didPresentEventName = useMemo(\n    () => `on${displayName}DidPresent`,\n    [displayName]\n  );\n  const willDismissEventName = useMemo(\n    () => `on${displayName}WillDismiss`,\n    [displayName]\n  );\n  const willPresentEventName = useMemo(\n    () => `on${displayName}WillPresent`,\n    [displayName]\n  );\n  const [isOpen, setIsOpen] = useState(false);\n\n  useEffect(() => {\n    if (isOpen && component && containerElRef.current) {\n      if (React.isValidElement(component)) {\n        ReactDOM.render(component, containerElRef.current);\n      } else {\n        ReactDOM.render(React.createElement(component as React.ComponentClass, componentProps), containerElRef.current);\n      }\n    }\n  }, [component, containerElRef.current, isOpen, componentProps]);\n\n  const present = async (options: OptionsType & HookOverlayOptions) => {\n    if (overlayRef.current) {\n      return;\n    }\n\n    const {\n      onDidDismiss,\n      onWillDismiss,\n      onDidPresent,\n      onWillPresent,\n      ...rest\n    } = options;\n\n    if (typeof document !== 'undefined') {\n      containerElRef.current = document.createElement('div');\n    }\n\n    overlayRef.current = await controller.create({\n      ...(rest as any),\n      component: containerElRef.current\n    });\n\n    attachProps(overlayRef.current, {\n      [didDismissEventName]: handleDismiss,\n      [didPresentEventName]: (e: CustomEvent) =>\n        onDidPresent && onDidPresent(e),\n      [willDismissEventName]: (e: CustomEvent) =>\n        onWillDismiss && onWillDismiss(e),\n      [willPresentEventName]: (e: CustomEvent) =>\n        onWillPresent && onWillPresent(e),\n    });\n\n    overlayRef.current.present();\n\n    setIsOpen(true);\n\n    function handleDismiss(event: CustomEvent<OverlayEventDetail<any>>) {\n      if (onDidDismiss) {\n        onDidDismiss(event);\n      }\n      overlayRef.current = undefined;\n      containerElRef.current = undefined;\n      setIsOpen(false);\n    }\n  };\n\n  const dismiss = async () => {\n    overlayRef.current && await overlayRef.current.dismiss();\n    overlayRef.current = undefined;\n    containerElRef.current = undefined;\n  };\n\n  return {\n    present,\n    dismiss,\n  };\n}\n","import { ModalOptions, modalController } from '@ionic/core';\n\nimport { HookOverlayOptions } from './HookOverlayOptions';\nimport { ReactComponentOrElement, useOverlay } from './useOverlay';\n\n/**\n * A hook for presenting/dismissing an IonModal component\n * @param component The component that the modal will show. Can be a React Component, a functional component, or a JSX Element\n * @param componentProps The props that will be passed to the component, if required\n * @returns Returns the present and dismiss methods in an array\n */\nexport function useIonModal(component: ReactComponentOrElement, componentProps?: any): UseIonModalResult {\n  const controller = useOverlay<ModalOptions, HTMLIonModalElement>(\n    'IonModal',\n    modalController,\n    component,\n    componentProps\n  );\n\n  function present(options: Omit<ModalOptions, 'component' | 'componentProps'> & HookOverlayOptions = {}) {\n    controller.present(options as any);\n  };\n\n  return [\n    present,\n    controller.dismiss\n  ];\n}\n\nexport type UseIonModalResult = [\n  (options?: Omit<ModalOptions, 'component' | 'componentProps'> & HookOverlayOptions) => void,\n  /**\n   * Dismisses the modal\n   */\n  () => void\n];\n","import { PopoverOptions, popoverController } from '@ionic/core';\n\nimport { HookOverlayOptions } from './HookOverlayOptions';\nimport { ReactComponentOrElement, useOverlay } from './useOverlay';\n\n/**\n * A hook for presenting/dismissing an IonPicker component\n * @param component The component that the popover will show. Can be a React Component, a functional component, or a JSX Element\n * @param componentProps The props that will be passed to the component, if required\n * @returns Returns the present and dismiss methods in an array\n */\nexport function useIonPopover(component: ReactComponentOrElement, componentProps?: any): UseIonPopoverResult {\n  const controller = useOverlay<PopoverOptions, HTMLIonPopoverElement>(\n    'IonPopover',\n    popoverController,\n    component,\n    componentProps\n  );\n\n  function present(options: Omit<PopoverOptions, 'component' | 'componentProps'> & HookOverlayOptions = {}) {\n    controller.present(options as any);\n  };\n\n  return [\n    present,\n    controller.dismiss\n  ];\n}\n\nexport type UseIonPopoverResult = [\n  (options?: Omit<PopoverOptions, 'component' | 'componentProps'> & HookOverlayOptions) => void,\n  /**\n   * Dismisses the popover\n   */\n  () => void\n];\n","import {\n  PickerButton,\n  PickerColumn,\n  PickerOptions,\n  pickerController,\n} from '@ionic/core';\n\nimport { HookOverlayOptions } from './HookOverlayOptions';\nimport { useController } from './useController';\n\n/**\n * A hook for presenting/dismissing an IonPicker component\n * @returns Returns the present and dismiss methods in an array\n */\nexport function useIonPicker(): UseIonPickerResult {\n  const controller = useController<PickerOptions, HTMLIonPickerElement>(\n    'IonPicker',\n    pickerController\n  );\n\n  function present(columns: PickerColumn[], buttons?: PickerButton[]): void;\n  function present(options: PickerOptions & HookOverlayOptions): void;\n  function present(\n    columnsOrOptions: PickerColumn[] | (PickerOptions & HookOverlayOptions),\n    buttons?: PickerButton[]\n  ) {\n    if (Array.isArray(columnsOrOptions)) {\n      controller.present({\n        columns: columnsOrOptions,\n        buttons: buttons ?? [{ text: 'Ok' }],\n      });\n    } else {\n      controller.present(columnsOrOptions);\n    }\n  }\n\n  return [present, controller.dismiss];\n}\n\nexport type UseIonPickerResult = [\n  {\n    /**\n     * Presents the picker\n     * @param columns Array of columns to be displayed in the picker.\n     * @param buttons Optional - Array of buttons to be displayed at the top of the picker.\n     */\n    (columns: PickerColumn[], buttons?: PickerButton[]): void;\n    /**\n     * Presents the picker\n     * @param options The options to pass to the IonPicker\n     */\n    (options: PickerOptions & HookOverlayOptions): void;\n  },\n  /**\n   * Dismisses the picker\n   */\n  () => void\n];\n","import { LoadingOptions, SpinnerTypes, loadingController } from '@ionic/core';\n\nimport { HookOverlayOptions } from './HookOverlayOptions';\nimport { useController } from './useController';\n\n/**\n * A hook for presenting/dismissing an IonLoading component\n * @returns Returns the present and dismiss methods in an array\n */\nexport function useIonLoading(): UseIonLoadingResult {\n  const controller = useController<LoadingOptions, HTMLIonLoadingElement>(\n    'IonLoading',\n    loadingController\n  );\n\n  function present(\n    message?: string,\n    duration?: number,\n    spinner?: SpinnerTypes\n  ): void;\n  function present(options: LoadingOptions & HookOverlayOptions): void;\n  function present(\n    messageOrOptions: string | (LoadingOptions & HookOverlayOptions) = '',\n    duration?: number,\n    spinner?: SpinnerTypes\n  ) {\n    if (typeof messageOrOptions === 'string') {\n      controller.present({\n        message: messageOrOptions,\n        duration,\n        spinner: spinner ?? 'lines',\n      });\n    } else {\n      controller.present(messageOrOptions);\n    }\n  }\n\n  return [present, controller.dismiss];\n}\n\nexport type UseIonLoadingResult = [\n  {\n    /**\n     * Presents the loading indicator\n     * @param message Optional - Text content to display in the loading indicator, defaults to blank string\n     * @param duration Optional - Number of milliseconds to wait before dismissing the loading indicator\n     * @param spinner Optional - The name of the spinner to display, defaults to \"lines\"\n     */\n    (message?: string, duration?: number, spinner?: SpinnerTypes): void;\n    /**\n     * Presents the loading indicator\n     * @param options The options to pass to the IonLoading\n     */\n    (options: LoadingOptions & HookOverlayOptions): void;\n  },\n  /**\n   * Dismisses the loading indicator\n   */\n  () => void\n];\n","import { defineCustomElements } from '@ionic/core/loader';\nimport { addIcons } from 'ionicons';\nimport {\n  arrowBackSharp,\n  caretBackSharp,\n  chevronBack,\n  chevronForward,\n  close,\n  closeCircle,\n  closeSharp,\n  menuOutline,\n  menuSharp,\n  reorderThreeOutline,\n  reorderTwoSharp,\n  searchOutline,\n  searchSharp,\n} from 'ionicons/icons';\nexport {\n  Animation,\n  AnimationBuilder,\n  AnimationCallbackOptions,\n  AnimationDirection,\n  AnimationFill,\n  AnimationKeyFrames,\n  AnimationLifecycle,\n  createAnimation,\n  createGesture,\n  AlertButton,\n  AlertInput,\n  Gesture,\n  GestureConfig,\n  GestureDetail,\n  iosTransitionAnimation,\n  IonicSafeString,\n  mdTransitionAnimation,\n  NavComponentWithProps,\n  setupConfig,\n} from '@ionic/core';\nexport * from './proxies';\n\n// createControllerComponent\nexport { IonAlert } from './IonAlert';\nexport { IonLoading } from './IonLoading';\nexport * from './IonToast';\nexport { IonPicker } from './IonPicker';\n\n// createOverlayComponent\nexport * from './IonActionSheet';\nexport { IonModal } from './IonModal';\nexport { IonPopover } from './IonPopover';\n\n// Custom Components\nexport { IonPage } from './IonPage';\nexport { IonTabsContext, IonTabsContextState } from './navigation/IonTabsContext';\nexport { IonTabs } from './navigation/IonTabs';\nexport { IonTabBar } from './navigation/IonTabBar';\nexport { IonTabButton } from './navigation/IonTabButton';\nexport { IonBackButton } from './navigation/IonBackButton';\nexport { IonRouterOutlet } from './IonRouterOutlet';\nexport { IonIcon } from './IonIcon';\nexport * from './IonRoute';\nexport * from './IonRedirect';\nexport * from './IonRouterContext';\n\n// Utils\nexport { isPlatform, getPlatforms, getConfig } from './utils';\nexport * from './hrefprops';\n\n// Ionic Animations\nexport { CreateAnimation } from './CreateAnimation';\n\n// Hooks\nexport { useIonActionSheet, UseIonActionSheetResult } from '../hooks/useIonActionSheet';\nexport { useIonAlert, UseIonAlertResult } from '../hooks/useIonAlert';\nexport { useIonToast, UseIonToastResult } from '../hooks/useIonToast';\nexport { useIonModal, UseIonModalResult } from '../hooks/useIonModal';\nexport { useIonPopover, UseIonPopoverResult } from '../hooks/useIonPopover';\nexport { useIonPicker, UseIonPickerResult } from '../hooks/useIonPicker';\nexport { useIonLoading, UseIonLoadingResult } from '../hooks/useIonLoading';\n\n// Icons that are used by internal components\naddIcons({\n  'arrow-back-sharp': arrowBackSharp,\n  'caret-back-sharp': caretBackSharp,\n  'chevron-back': chevronBack,\n  'chevron-forward': chevronForward,\n  close,\n  'close-circle': closeCircle,\n  'close-sharp': closeSharp,\n  'menu-outline': menuOutline,\n  'menu-sharp': menuSharp,\n  'reorder-two-sharp': reorderTwoSharp,\n  'reorder-three-outline': reorderThreeOutline,\n  'search-outline': searchOutline,\n  'search-sharp': searchSharp,\n});\n\n// TODO: defineCustomElements() is asyncronous\n// We need to use the promise\nif (typeof window !== 'undefined') {\n  defineCustomElements(window);\n}\n","import React from 'react';\n\nimport { RouteInfo } from '../models/RouteInfo';\n\nimport { ViewItem } from './ViewItem';\n\nexport interface RouteManagerContextState {\n  addViewItem: (viewItem: ViewItem) => void;\n  canGoBack: () => boolean;\n  clearOutlet: (outletId: string) => void;\n  createViewItem: (\n    outletId: string,\n    reactElement: React.ReactElement,\n    routeInfo: RouteInfo,\n    page?: HTMLElement\n  ) => ViewItem;\n  findViewItemByPathname(pathname: string, outletId?: string): ViewItem | undefined;\n  findLeavingViewItemByRouteInfo: (routeInfo: RouteInfo, outletId?: string) => ViewItem | undefined;\n  findViewItemByRouteInfo: (routeInfo: RouteInfo, outletId?: string) => ViewItem | undefined;\n  getChildrenToRender: (\n    outletId: string,\n    ionRouterOutlet: React.ReactElement,\n    routeInfo: RouteInfo,\n    reRender: () => void\n  ) => React.ReactNode[];\n  goBack: () => void;\n  unMountViewItem: (viewItem: ViewItem) => void;\n}\n\nexport const RouteManagerContext = /*@__PURE__*/ React.createContext<RouteManagerContextState>({\n  addViewItem: () => undefined,\n  canGoBack: () => undefined as any,\n  clearOutlet: () => undefined,\n  createViewItem: () => undefined as any,\n  findViewItemByPathname: () => undefined,\n  findLeavingViewItemByRouteInfo: () => undefined,\n  findViewItemByRouteInfo: () => undefined,\n  getChildrenToRender: () => undefined as any,\n  goBack: () => undefined,\n  unMountViewItem: () => undefined,\n});\n","import React from 'react';\n\nimport { DefaultIonLifeCycleContext, IonLifeCycleContext } from '../contexts/IonLifeCycleContext';\n\ninterface ViewTransitionManagerProps {\n  removeView: () => void;\n  mount: boolean;\n}\n\ninterface ViewTransitionManagerState {\n  show: boolean;\n}\n\nexport class ViewLifeCycleManager extends React.Component<\n  ViewTransitionManagerProps,\n  ViewTransitionManagerState\n> {\n  ionLifeCycleContext = new DefaultIonLifeCycleContext();\n  private _isMounted = false;\n\n  constructor(props: ViewTransitionManagerProps) {\n    super(props);\n\n    this.ionLifeCycleContext.onComponentCanBeDestroyed(() => {\n      if (!this.props.mount) {\n        if (this._isMounted) {\n          this.setState(\n            {\n              show: false,\n            },\n            () => this.props.removeView()\n          );\n        }\n      }\n    });\n\n    this.state = {\n      show: true,\n    };\n  }\n\n  componentDidMount() {\n    this._isMounted = true;\n  }\n\n  componentWillUnmount() {\n    this._isMounted = false;\n  }\n\n  render() {\n    const { show } = this.state;\n    return (\n      <IonLifeCycleContext.Provider value={this.ionLifeCycleContext}>\n        {show && this.props.children}\n      </IonLifeCycleContext.Provider>\n    );\n  }\n}\n","import { RouteInfo } from '../models/RouteInfo';\n\n// const RESTRICT_SIZE = 100;\n\nexport class LocationHistory {\n  private locationHistory: RouteInfo[] = [];\n  private tabHistory: {\n    [key: string]: RouteInfo[];\n  } = {};\n\n  add(routeInfo: RouteInfo) {\n    if (routeInfo.routeAction === 'push' || routeInfo.routeAction == null) {\n      this._add(routeInfo);\n    } else if (routeInfo.routeAction === 'pop') {\n      this._pop(routeInfo);\n    } else if (routeInfo.routeAction === 'replace') {\n      this._replace(routeInfo);\n    }\n\n    if (routeInfo.routeDirection === 'root') {\n      this._clear();\n      this._add(routeInfo);\n    }\n  }\n\n  clearTabStack(tab: string) {\n    const routeInfos = this._getRouteInfosByKey(tab);\n    if (routeInfos) {\n      routeInfos.forEach((ri) => {\n        this.locationHistory = this.locationHistory.filter((x) => x.id !== ri.id);\n      });\n      this.tabHistory[tab] = [];\n    }\n  }\n\n  update(routeInfo: RouteInfo) {\n    const locationIndex = this.locationHistory.findIndex((x) => x.id === routeInfo.id);\n    if (locationIndex > -1) {\n      this.locationHistory.splice(locationIndex, 1, routeInfo);\n    }\n    const tabArray = this.tabHistory[routeInfo.tab || ''];\n    if (tabArray) {\n      const tabIndex = tabArray.findIndex((x) => x.id === routeInfo.id);\n      if (tabIndex > -1) {\n        tabArray.splice(tabIndex, 1, routeInfo);\n      } else {\n        tabArray.push(routeInfo);\n      }\n    } else if (routeInfo.tab) {\n      this.tabHistory[routeInfo.tab] = [routeInfo];\n    }\n  }\n\n  private _add(routeInfo: RouteInfo) {\n    const routeInfos = this._getRouteInfosByKey(routeInfo.tab);\n    if (routeInfos) {\n      // If the latest routeInfo is the same (going back and forth between tabs), replace it\n      if (this._areRoutesEqual(routeInfos[routeInfos.length - 1], routeInfo)) {\n        routeInfos.pop();\n      }\n      routeInfos.push(routeInfo);\n    }\n    this.locationHistory.push(routeInfo);\n  }\n\n  private _areRoutesEqual(route1?: RouteInfo, route2?: RouteInfo) {\n    if(!route1 || !route2) {\n      return false;\n    }\n    return route1.pathname === route2.pathname && route1.search === route2.search;\n  }\n\n  private _pop(routeInfo: RouteInfo) {\n    const routeInfos = this._getRouteInfosByKey(routeInfo.tab);\n\n    if (routeInfos) {\n      // Pop the previous route\n      routeInfos.pop();\n      // Replace the current route with an updated version\n      routeInfos.pop();\n      routeInfos.push(routeInfo);\n    }\n\n    // Pop the previous route\n    this.locationHistory.pop();\n    // Replace the current route with an updated version\n    this.locationHistory.pop();\n    this.locationHistory.push(routeInfo);\n  }\n\n  private _replace(routeInfo: RouteInfo) {\n    const routeInfos = this._getRouteInfosByKey(routeInfo.tab);\n    routeInfos && routeInfos.pop();\n    this.locationHistory.pop();\n    this._add(routeInfo);\n  }\n\n  private _clear() {\n    const keys = Object.keys(this.tabHistory);\n    keys.forEach((k) => (this.tabHistory[k] = []));\n    this.locationHistory = [];\n  }\n\n  private _getRouteInfosByKey(key?: string) {\n    let routeInfos: RouteInfo[] | undefined;\n    if (key) {\n      routeInfos = this.tabHistory[key];\n      if (!routeInfos) {\n        routeInfos = this.tabHistory[key] = [];\n      }\n    }\n    return routeInfos;\n  }\n\n  getFirstRouteInfoForTab(tab: string) {\n    const routeInfos = this._getRouteInfosByKey(tab);\n    if (routeInfos) {\n      return routeInfos[0];\n    }\n    return undefined;\n  }\n\n  getCurrentRouteInfoForTab(tab?: string) {\n    const routeInfos = this._getRouteInfosByKey(tab);\n    if (routeInfos) {\n      return routeInfos[routeInfos.length - 1];\n    }\n    return undefined;\n  }\n\n  findLastLocation(routeInfo: RouteInfo) {\n    const routeInfos = this._getRouteInfosByKey(routeInfo.tab);\n    if (routeInfos) {\n      for (let i = routeInfos.length - 2; i >= 0; i--) {\n        const ri = routeInfos[i];\n        if (ri) {\n          if (ri.pathname === routeInfo.pushedByRoute) {\n            return ri;\n          }\n        }\n      }\n    }\n    for (let i = this.locationHistory.length - 2; i >= 0; i--) {\n      const ri = this.locationHistory[i];\n      if (ri) {\n        if (ri.pathname === routeInfo.pushedByRoute) {\n          return ri;\n        }\n      }\n    }\n    return undefined;\n  }\n\n  previous() {\n    return (\n      this.locationHistory[this.locationHistory.length - 2] ||\n      this.locationHistory[this.locationHistory.length - 1]\n    );\n  }\n\n  current() {\n    return this.locationHistory[this.locationHistory.length - 1];\n  }\n\n  canGoBack() {\n    return this.locationHistory.length > 1;\n  }\n}\n","import { AnimationBuilder } from '@ionic/core';\nimport React from 'react';\n\nimport { IonRouterContext, IonRouterContextState } from '../components/IonRouterContext';\nimport { NavContext, NavContextState } from '../contexts/NavContext';\nimport { RouteAction } from '../models/RouteAction';\nimport { RouteInfo } from '../models/RouteInfo';\nimport { RouterDirection } from '../models/RouterDirection';\nimport { RouterOptions } from '../models/RouterOptions';\n\nimport { LocationHistory } from './LocationHistory';\nimport PageManager from './PageManager';\n\ninterface NavManagerProps {\n  routeInfo: RouteInfo;\n  onNativeBack: () => void;\n  onNavigateBack: (route?: string | RouteInfo, animationBuilder?: AnimationBuilder) => void;\n  onNavigate: (\n    path: string,\n    action: RouteAction,\n    direction?: RouterDirection,\n    animationBuilder?: AnimationBuilder,\n    options?: any,\n    tab?: string\n  ) => void;\n  onSetCurrentTab: (tab: string, routeInfo: RouteInfo) => void;\n  onChangeTab: (tab: string, path: string, routeOptions?: any) => void;\n  onResetTab: (tab: string, path: string, routeOptions?: any) => void;\n  ionRedirect: any;\n  ionRoute: any;\n  stackManager: any;\n  locationHistory: LocationHistory;\n}\n\nexport class NavManager extends React.PureComponent<NavManagerProps, NavContextState> {\n  _isMounted = false;\n\n  ionRouterContextValue: IonRouterContextState = {\n    push: (\n      pathname: string,\n      routerDirection?: RouterDirection,\n      routeAction?: RouteAction,\n      routerOptions?: RouterOptions,\n      animationBuilder?: AnimationBuilder\n    ) => {\n      this.navigate(pathname, routerDirection, routeAction, animationBuilder, routerOptions);\n    },\n    back: (animationBuilder?: AnimationBuilder) => {\n      this.goBack(undefined, animationBuilder);\n    },\n    canGoBack: () => this.props.locationHistory.canGoBack(),\n    nativeBack: () => this.props.onNativeBack(),\n    routeInfo: this.props.routeInfo,\n  };\n\n  constructor(props: NavManagerProps) {\n    super(props);\n    this.state = {\n      goBack: this.goBack.bind(this),\n      hasIonicRouter: () => true,\n      navigate: this.navigate.bind(this),\n      getIonRedirect: this.getIonRedirect.bind(this),\n      getIonRoute: this.getIonRoute.bind(this),\n      getStackManager: this.getStackManager.bind(this),\n      getPageManager: this.getPageManager.bind(this),\n      routeInfo: this.props.routeInfo,\n      setCurrentTab: this.props.onSetCurrentTab,\n      changeTab: this.props.onChangeTab,\n      resetTab: this.props.onResetTab,\n    };\n\n    if (typeof document !== 'undefined') {\n      this.handleHardwareBackButton = this.handleHardwareBackButton.bind(this);\n      document.addEventListener('ionBackButton', this.handleHardwareBackButton);\n    }\n  }\n\n  componentDidMount() {\n    this._isMounted = true;\n  }\n\n  componentWillUnmount() {\n    if (typeof document !== 'undefined') {\n      document.removeEventListener('ionBackButton', this.handleHardwareBackButton);\n      this._isMounted = false;\n    }\n  }\n\n  handleHardwareBackButton(e: any) {\n    e.detail.register(0, (processNextHandler: () => void) => {\n      if (this._isMounted) {\n        this.nativeGoBack();\n        processNextHandler();\n      }\n    });\n  }\n\n  goBack(route?: string | RouteInfo, animationBuilder?: AnimationBuilder) {\n    this.props.onNavigateBack(route, animationBuilder);\n  }\n\n  nativeGoBack() {\n    this.props.onNativeBack();\n  }\n\n  navigate(\n    path: string,\n    direction: RouterDirection = 'forward',\n    action: RouteAction = 'push',\n    animationBuilder?: AnimationBuilder,\n    options?: any,\n    tab?: string\n  ) {\n    this.props.onNavigate(path, action, direction, animationBuilder, options, tab);\n  }\n\n  getPageManager() {\n    return PageManager;\n  }\n\n  getIonRedirect() {\n    return this.props.ionRedirect;\n  }\n\n  getIonRoute() {\n    return this.props.ionRoute;\n  }\n\n  getStackManager() {\n    return this.props.stackManager;\n  }\n\n  render() {\n    return (\n      <NavContext.Provider value={{ ...this.state, routeInfo: this.props.routeInfo }}>\n        <IonRouterContext.Provider\n          value={{ ...this.ionRouterContextValue, routeInfo: this.props.routeInfo }}\n        >\n          {this.props.children}\n        </IonRouterContext.Provider>\n      </NavContext.Provider>\n    );\n  }\n}\n","import { RouteInfo } from '../models/RouteInfo';\n\nimport { ViewItem } from './ViewItem';\n\nexport abstract class ViewStacks {\n  private viewStacks: { [key: string]: ViewItem[] } = {};\n\n  constructor() {\n    this.add = this.add.bind(this);\n    this.clear = this.clear.bind(this);\n    this.getViewItemsForOutlet = this.getViewItemsForOutlet.bind(this);\n    this.remove = this.remove.bind(this);\n  }\n\n  add(viewItem: ViewItem) {\n    const { outletId } = viewItem;\n    if (!this.viewStacks[outletId]) {\n      this.viewStacks[outletId] = [viewItem];\n    } else {\n      this.viewStacks[outletId].push(viewItem);\n    }\n  }\n\n  clear(outletId: string) {\n    // Give some time for the leaving views to transition before removing\n    setTimeout(() => {\n      // console.log('Removing viewstack for outletID ' + outletId);\n      delete this.viewStacks[outletId];\n    }, 500);\n  }\n\n  getViewItemsForOutlet(outletId: string) {\n    return this.viewStacks[outletId] || [];\n  }\n\n  remove(viewItem: ViewItem) {\n    const { outletId } = viewItem;\n    const viewStack = this.viewStacks[outletId];\n    if (viewStack) {\n      const viewItemToRemove = viewStack.find((x) => x.id === viewItem.id);\n      if (viewItemToRemove) {\n        viewItemToRemove.mount = false;\n        this.viewStacks[outletId] = viewStack.filter((x) => x.id !== viewItemToRemove.id);\n      }\n    }\n  }\n\n  protected getStackIds() {\n    return Object.keys(this.viewStacks);\n  }\n\n  protected getAllViewItems() {\n    const keys = this.getStackIds();\n    const viewItems: ViewItem[] = [];\n    keys.forEach((k) => {\n      viewItems.push(...this.viewStacks[k]);\n    });\n    return viewItems;\n  }\n\n  abstract createViewItem(\n    outletId: string,\n    reactElement: React.ReactElement,\n    routeInfo: RouteInfo,\n    page?: HTMLElement\n  ): ViewItem;\n  abstract findViewItemByPathname(pathname: string, outletId?: string): ViewItem | undefined;\n  abstract findViewItemByRouteInfo(routeInfo: RouteInfo, outletId?: string): ViewItem | undefined;\n  abstract findLeavingViewItemByRouteInfo(\n    routeInfo: RouteInfo,\n    outletId?: string\n  ): ViewItem | undefined;\n  abstract getChildrenToRender(\n    outletId: string,\n    ionRouterOutlet: React.ReactElement,\n    routeInfo: RouteInfo,\n    reRender: () => void,\n    setInTransition: () => void\n  ): React.ReactNode[];\n}\n","const ids: { [key: string]: number } = { main: 0 };\n\nexport const generateId = (type = 'main') => {\n  const id = (ids[type] ?? 0) + 1;\n  ids[type] = id;\n  return id.toString();\n};\n"]},"metadata":{},"sourceType":"module"}