@ionic/react-router 8.7.12 → 8.7.13-dev.11765426479.16a61ecf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2125 -539
- package/dist/index.js.map +1 -1
- package/dist/types/ReactRouter/IonReactHashRouter.d.ts +7 -22
- package/dist/types/ReactRouter/IonReactMemoryRouter.d.ts +7 -21
- package/dist/types/ReactRouter/IonReactRouter.d.ts +8 -21
- package/dist/types/ReactRouter/IonRouteInner.d.ts +1 -3
- package/dist/types/ReactRouter/IonRouter.d.ts +18 -38
- package/dist/types/ReactRouter/ReactRouterViewStack.d.ts +59 -6
- package/dist/types/ReactRouter/utils/computeParentPath.d.ts +57 -0
- package/dist/types/ReactRouter/utils/pathMatching.d.ts +31 -0
- package/dist/types/ReactRouter/utils/pathNormalization.d.ts +22 -0
- package/dist/types/ReactRouter/utils/routeElements.d.ts +23 -0
- package/dist/types/ReactRouter/utils/viewItemUtils.d.ts +10 -0
- package/package.json +7 -8
- package/dist/types/ReactRouter/StackManager.d.ts +0 -30
- package/dist/types/ReactRouter/utils/matchPath.d.ts +0 -21
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/ReactRouter/IonRouteInner.tsx","../src/ReactRouter/utils/matchPath.ts","../src/ReactRouter/ReactRouterViewStack.tsx","../src/ReactRouter/clonePageElement.ts","../src/ReactRouter/StackManager.tsx","../src/ReactRouter/IonRouter.tsx","../src/ReactRouter/IonReactRouter.tsx","../src/ReactRouter/IonReactMemoryRouter.tsx","../src/ReactRouter/IonReactHashRouter.tsx"],"sourcesContent":["import type { IonRouteProps } from '@ionic/react';\nimport React from 'react';\nimport { Route } from 'react-router';\n\nexport class IonRouteInner extends React.PureComponent<IonRouteProps> {\n render() {\n return (\n <Route\n path={this.props.path}\n exact={this.props.exact}\n render={this.props.render}\n {\n /**\n * `computedMatch` is a private API in react-router v5 that\n * has been removed in v6.\n *\n * This needs to be removed when we support v6.\n *\n * TODO: FW-647\n */\n ...((this.props as any).computedMatch !== undefined\n ? {\n computedMatch: (this.props as any).computedMatch,\n }\n : {})\n }\n />\n );\n }\n}\n","import { matchPath as reactRouterMatchPath } from 'react-router';\n\ninterface MatchPathOptions {\n /**\n * The pathname to match against.\n */\n pathname: string;\n /**\n * The props to match against, they are identical to the matching props `Route` accepts.\n */\n componentProps: {\n path?: string;\n from?: string;\n component?: any;\n exact?: boolean;\n };\n}\n\n/**\n * @see https://v5.reactrouter.com/web/api/matchPath\n */\nexport const matchPath = ({\n pathname,\n componentProps,\n}: MatchPathOptions): false | ReturnType<typeof reactRouterMatchPath> => {\n const { exact, component } = componentProps;\n\n const path = componentProps.path || componentProps.from;\n /***\n * The props to match against, they are identical\n * to the matching props `Route` accepts. It could also be a string\n * or an array of strings as shortcut for `{ path }`.\n */\n const matchProps = {\n exact,\n path,\n component,\n };\n\n const match = reactRouterMatchPath(pathname, matchProps);\n\n if (!match) {\n return false;\n }\n\n return match;\n};\n","import type { RouteInfo, ViewItem } from '@ionic/react';\nimport { IonRoute, ViewLifeCycleManager, ViewStacks, generateId } from '@ionic/react';\nimport React from 'react';\n\nimport { matchPath } from './utils/matchPath';\n\nexport class ReactRouterViewStack extends ViewStacks {\n constructor() {\n super();\n this.createViewItem = this.createViewItem.bind(this);\n this.findViewItemByRouteInfo = this.findViewItemByRouteInfo.bind(this);\n this.findLeavingViewItemByRouteInfo = this.findLeavingViewItemByRouteInfo.bind(this);\n this.getChildrenToRender = this.getChildrenToRender.bind(this);\n this.findViewItemByPathname = this.findViewItemByPathname.bind(this);\n }\n\n createViewItem(outletId: string, reactElement: React.ReactElement, routeInfo: RouteInfo, page?: HTMLElement) {\n const viewItem: ViewItem = {\n id: generateId('viewItem'),\n outletId,\n ionPageElement: page,\n reactElement,\n mount: true,\n ionRoute: false,\n };\n\n if (reactElement.type === IonRoute) {\n viewItem.ionRoute = true;\n viewItem.disableIonPageManagement = reactElement.props.disableIonPageManagement;\n }\n\n viewItem.routeData = {\n match: matchPath({\n pathname: routeInfo.pathname,\n componentProps: reactElement.props,\n }),\n childProps: reactElement.props,\n };\n\n return viewItem;\n }\n\n getChildrenToRender(outletId: string, ionRouterOutlet: React.ReactElement, routeInfo: RouteInfo) {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Sync latest routes with viewItems\n React.Children.forEach(ionRouterOutlet.props.children, (child: React.ReactElement) => {\n const viewItem = viewItems.find((v) => {\n return matchComponent(child, v.routeData.childProps.path || v.routeData.childProps.from);\n });\n if (viewItem) {\n viewItem.reactElement = child;\n }\n });\n\n const children = viewItems.map((viewItem) => {\n let clonedChild;\n if (viewItem.ionRoute && !viewItem.disableIonPageManagement) {\n clonedChild = (\n <ViewLifeCycleManager\n key={`view-${viewItem.id}`}\n mount={viewItem.mount}\n removeView={() => this.remove(viewItem)}\n >\n {React.cloneElement(viewItem.reactElement, {\n computedMatch: viewItem.routeData.match,\n })}\n </ViewLifeCycleManager>\n );\n } else {\n const match = matchComponent(viewItem.reactElement, routeInfo.pathname);\n clonedChild = (\n <ViewLifeCycleManager\n key={`view-${viewItem.id}`}\n mount={viewItem.mount}\n removeView={() => this.remove(viewItem)}\n >\n {React.cloneElement(viewItem.reactElement, {\n computedMatch: viewItem.routeData.match,\n })}\n </ViewLifeCycleManager>\n );\n\n if (!match && viewItem.routeData.match) {\n viewItem.routeData.match = undefined;\n viewItem.mount = false;\n }\n }\n\n return clonedChild;\n });\n return children;\n }\n\n findViewItemByRouteInfo(routeInfo: RouteInfo, outletId?: string, updateMatch?: boolean) {\n const { viewItem, match } = this.findViewItemByPath(routeInfo.pathname, outletId);\n const shouldUpdateMatch = updateMatch === undefined || updateMatch === true;\n if (shouldUpdateMatch && viewItem && match) {\n viewItem.routeData.match = match;\n }\n return viewItem;\n }\n\n findLeavingViewItemByRouteInfo(routeInfo: RouteInfo, outletId?: string, mustBeIonRoute = true) {\n const { viewItem } = this.findViewItemByPath(routeInfo.lastPathname!, outletId, mustBeIonRoute);\n return viewItem;\n }\n\n findViewItemByPathname(pathname: string, outletId?: string) {\n const { viewItem } = this.findViewItemByPath(pathname, outletId);\n return viewItem;\n }\n\n /**\n * Returns the matching view item and the match result for a given pathname.\n */\n private findViewItemByPath(pathname: string, outletId?: string, mustBeIonRoute?: boolean) {\n let viewItem: ViewItem | undefined;\n let match: ReturnType<typeof matchPath> | undefined;\n let viewStack: ViewItem[];\n\n if (outletId) {\n viewStack = this.getViewItemsForOutlet(outletId);\n viewStack.some(matchView);\n if (!viewItem) {\n viewStack.some(matchDefaultRoute);\n }\n } else {\n const viewItems = this.getAllViewItems();\n viewItems.some(matchView);\n if (!viewItem) {\n viewItems.some(matchDefaultRoute);\n }\n }\n\n return { viewItem, match };\n\n function matchView(v: ViewItem) {\n if (mustBeIonRoute && !v.ionRoute) {\n return false;\n }\n\n match = matchPath({\n pathname,\n componentProps: v.routeData.childProps,\n });\n\n if (match) {\n /**\n * Even though we have a match from react-router, we do not know if the match\n * is for this specific view item.\n *\n * To validate this, we need to check if the path and url match the view item's route data.\n */\n const hasParameter = match.path.includes(':');\n if (!hasParameter || (hasParameter && match.url === v.routeData?.match?.url)) {\n viewItem = v;\n return true;\n }\n }\n return false;\n }\n\n function matchDefaultRoute(v: ViewItem) {\n // try to find a route that doesn't have a path or from prop, that will be our default route\n if (!v.routeData.childProps.path && !v.routeData.childProps.from) {\n match = {\n path: pathname,\n url: pathname,\n isExact: true,\n params: {},\n };\n viewItem = v;\n return true;\n }\n return false;\n }\n }\n}\n\nfunction matchComponent(node: React.ReactElement, pathname: string) {\n return matchPath({\n pathname,\n componentProps: node.props,\n });\n}\n","export function clonePageElement(leavingViewHtml: string | HTMLElement) {\n let html: string;\n if (typeof leavingViewHtml === 'string') {\n html = leavingViewHtml;\n } else {\n html = leavingViewHtml.outerHTML;\n }\n if (document) {\n const newEl = document.createElement('div');\n newEl.innerHTML = html;\n newEl.style.zIndex = '';\n // Remove an existing back button so the new element doesn't get two of them\n const ionBackButton = newEl.getElementsByTagName('ion-back-button');\n if (ionBackButton[0]) {\n ionBackButton[0].remove();\n }\n return newEl.firstChild as HTMLElement;\n }\n return undefined;\n}\n","import type { RouteInfo, StackContextState, ViewItem } from '@ionic/react';\nimport { RouteManagerContext, StackContext, generateId, getConfig } from '@ionic/react';\nimport React from 'react';\n\nimport { clonePageElement } from './clonePageElement';\nimport { matchPath } from './utils/matchPath';\n\n// TODO(FW-2959): types\n\ninterface StackManagerProps {\n routeInfo: RouteInfo;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface StackManagerState {}\n\nconst isViewVisible = (el: HTMLElement) =>\n !el.classList.contains('ion-page-invisible') && !el.classList.contains('ion-page-hidden');\n\nexport class StackManager extends React.PureComponent<StackManagerProps, StackManagerState> {\n id: string;\n context!: React.ContextType<typeof RouteManagerContext>;\n ionRouterOutlet?: React.ReactElement;\n routerOutletElement: HTMLIonRouterOutletElement | undefined;\n prevProps?: StackManagerProps;\n skipTransition: boolean;\n\n stackContextValue: StackContextState = {\n registerIonPage: this.registerIonPage.bind(this),\n isInOutlet: () => true,\n };\n\n private clearOutletTimeout: any;\n private pendingPageTransition = false;\n\n constructor(props: StackManagerProps) {\n super(props);\n this.registerIonPage = this.registerIonPage.bind(this);\n this.transitionPage = this.transitionPage.bind(this);\n this.handlePageTransition = this.handlePageTransition.bind(this);\n this.id = generateId('routerOutlet');\n this.prevProps = undefined;\n this.skipTransition = false;\n }\n\n componentDidMount() {\n if (this.clearOutletTimeout) {\n /**\n * The clearOutlet integration with React Router is a bit hacky.\n * It uses a timeout to clear the outlet after a transition.\n * In React v18, components are mounted and unmounted in development mode\n * to check for side effects.\n *\n * This clearTimeout prevents the outlet from being cleared when the component is re-mounted,\n * which should only happen in development mode and as a result of a hot reload.\n */\n clearTimeout(this.clearOutletTimeout);\n }\n if (this.routerOutletElement) {\n this.setupRouterOutlet(this.routerOutletElement);\n this.handlePageTransition(this.props.routeInfo);\n }\n }\n\n componentDidUpdate(prevProps: StackManagerProps) {\n const { pathname } = this.props.routeInfo;\n const { pathname: prevPathname } = prevProps.routeInfo;\n\n if (pathname !== prevPathname) {\n this.prevProps = prevProps;\n this.handlePageTransition(this.props.routeInfo);\n } else if (this.pendingPageTransition) {\n this.handlePageTransition(this.props.routeInfo);\n this.pendingPageTransition = false;\n }\n }\n\n componentWillUnmount() {\n this.clearOutletTimeout = this.context.clearOutlet(this.id);\n }\n\n async handlePageTransition(routeInfo: RouteInfo) {\n if (!this.routerOutletElement || !this.routerOutletElement.commit) {\n /**\n * The route outlet has not mounted yet. We need to wait for it to render\n * before we can transition the page.\n *\n * Set a flag to indicate that we should transition the page after\n * the component has updated.\n */\n this.pendingPageTransition = true;\n } else {\n let enteringViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n let leavingViewItem = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id);\n\n if (!leavingViewItem && routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n }\n\n // Check if leavingViewItem should be unmounted\n if (leavingViewItem) {\n if (routeInfo.routeAction === 'replace') {\n leavingViewItem.mount = false;\n } else if (!(routeInfo.routeAction === 'push' && routeInfo.routeDirection === 'forward')) {\n if (routeInfo.routeDirection !== 'none' && enteringViewItem !== leavingViewItem) {\n leavingViewItem.mount = false;\n }\n } else if (routeInfo.routeOptions?.unmount) {\n leavingViewItem.mount = false;\n }\n }\n\n const enteringRoute = matchRoute(this.ionRouterOutlet?.props.children, routeInfo) as React.ReactElement;\n\n if (enteringViewItem) {\n enteringViewItem.reactElement = enteringRoute;\n } else if (enteringRoute) {\n enteringViewItem = this.context.createViewItem(this.id, enteringRoute, routeInfo);\n this.context.addViewItem(enteringViewItem);\n }\n\n if (enteringViewItem && enteringViewItem.ionPageElement) {\n /**\n * If the entering view item is the same as the leaving view item,\n * then we don't need to transition.\n */\n if (enteringViewItem === leavingViewItem) {\n /**\n * If the entering view item is the same as the leaving view item,\n * we are either transitioning using parameterized routes to the same view\n * or a parent router outlet is re-rendering as a result of React props changing.\n *\n * If the route data does not match the current path, the parent router outlet\n * is attempting to transition and we cancel the operation.\n */\n if (enteringViewItem.routeData.match.url !== routeInfo.pathname) {\n return;\n }\n }\n\n /**\n * If there isn't a leaving view item, but the route info indicates\n * that the user has routed from a previous path, then we need\n * to find the leaving view item to transition between.\n */\n if (!leavingViewItem && this.props.routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(this.props.routeInfo.prevRouteLastPathname, this.id);\n }\n\n /**\n * If the entering view is already visible and the leaving view is not, the transition does not need to occur.\n */\n if (\n isViewVisible(enteringViewItem.ionPageElement) &&\n leavingViewItem !== undefined &&\n !isViewVisible(leavingViewItem.ionPageElement!)\n ) {\n return;\n }\n\n /**\n * The view should only be transitioned in the following cases:\n * 1. Performing a replace or pop action, such as a swipe to go back gesture\n * to animation the leaving view off the screen.\n *\n * 2. Navigating between top-level router outlets, such as /page-1 to /page-2;\n * or navigating within a nested outlet, such as /tabs/tab-1 to /tabs/tab-2.\n *\n * 3. The entering view is an ion-router-outlet containing a page\n * matching the current route and that hasn't already transitioned in.\n *\n * This should only happen when navigating directly to a nested router outlet\n * route or on an initial page load (i.e. refreshing). In cases when loading\n * /tabs/tab-1, we need to transition the /tabs page element into the view.\n */\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem);\n } else if (leavingViewItem && !enteringRoute && !enteringViewItem) {\n // If we have a leavingView but no entering view/route, we are probably leaving to\n // another outlet, so hide this leavingView. We do it in a timeout to give time for a\n // transition to finish.\n // setTimeout(() => {\n if (leavingViewItem.ionPageElement) {\n leavingViewItem.ionPageElement.classList.add('ion-page-hidden');\n leavingViewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n // }, 250);\n }\n\n this.forceUpdate();\n }\n }\n\n registerIonPage(page: HTMLElement, routeInfo: RouteInfo) {\n const foundView = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n if (foundView) {\n const oldPageElement = foundView.ionPageElement;\n foundView.ionPageElement = page;\n foundView.ionRoute = true;\n\n /**\n * React 18 will unmount and remount IonPage\n * elements in development mode when using createRoot.\n * This can cause duplicate page transitions to occur.\n */\n if (oldPageElement === page) {\n return;\n }\n }\n this.handlePageTransition(routeInfo);\n }\n\n async setupRouterOutlet(routerOutlet: HTMLIonRouterOutletElement) {\n const canStart = () => {\n const config = getConfig();\n const swipeEnabled = config && config.get('swipeBackEnabled', routerOutlet.mode === 'ios');\n if (!swipeEnabled) {\n return false;\n }\n\n const { routeInfo } = this.props;\n\n const propsToUse =\n this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as any);\n const enteringViewItem = this.context.findViewItemByRouteInfo(propsToUse, this.id, false);\n\n return (\n !!enteringViewItem &&\n /**\n * The root url '/' is treated as\n * the first view item (but is never mounted),\n * so we do not want to swipe back to the\n * root url.\n */\n enteringViewItem.mount &&\n /**\n * When on the first page (whatever view\n * you land on after the root url) it\n * is possible for findViewItemByRouteInfo to\n * return the exact same view you are currently on.\n * Make sure that we are not swiping back to the same\n * instances of a view.\n */\n enteringViewItem.routeData.match.path !== routeInfo.pathname\n );\n };\n\n const onStart = async () => {\n const { routeInfo } = this.props;\n\n const propsToUse =\n this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as any);\n const enteringViewItem = this.context.findViewItemByRouteInfo(propsToUse, this.id, false);\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n /**\n * When the gesture starts, kick off\n * a transition that is controlled\n * via a swipe gesture.\n */\n if (enteringViewItem && leavingViewItem) {\n await this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back', true);\n }\n\n return Promise.resolve();\n };\n const onEnd = (shouldContinue: boolean) => {\n if (shouldContinue) {\n this.skipTransition = true;\n\n this.context.goBack();\n } else {\n /**\n * In the event that the swipe\n * gesture was aborted, we should\n * re-hide the page that was going to enter.\n */\n const { routeInfo } = this.props;\n\n const propsToUse =\n this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as any);\n const enteringViewItem = this.context.findViewItemByRouteInfo(propsToUse, this.id, false);\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n /**\n * Ionic React has a design defect where it\n * a) Unmounts the leaving view item when using parameterized routes\n * b) Considers the current view to be the entering view when using\n * parameterized routes\n *\n * As a result, we should not hide the view item here\n * as it will cause the current view to be hidden.\n */\n if (enteringViewItem !== leavingViewItem && enteringViewItem?.ionPageElement !== undefined) {\n const { ionPageElement } = enteringViewItem;\n ionPageElement.setAttribute('aria-hidden', 'true');\n ionPageElement.classList.add('ion-page-hidden');\n }\n }\n };\n\n routerOutlet.swipeHandler = {\n canStart,\n onStart,\n onEnd,\n };\n }\n\n async transitionPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem?: ViewItem,\n direction?: 'forward' | 'back',\n progressAnimation = false\n ) {\n const runCommit = async (enteringEl: HTMLElement, leavingEl?: HTMLElement) => {\n const skipTransition = this.skipTransition;\n\n /**\n * If the transition was handled\n * via the swipe to go back gesture,\n * then we do not want to perform\n * another transition.\n *\n * We skip adding ion-page or ion-page-invisible\n * because the entering view already exists in the DOM.\n * If we added the classes, there would be a flicker where\n * the view would be briefly hidden.\n */\n if (skipTransition) {\n /**\n * We need to reset skipTransition before\n * we call routerOutlet.commit otherwise\n * the transition triggered by the swipe\n * to go back gesture would reset it. In\n * that case you would see a duplicate\n * transition triggered by handlePageTransition\n * in componentDidUpdate.\n */\n this.skipTransition = false;\n } else {\n enteringEl.classList.add('ion-page');\n enteringEl.classList.add('ion-page-invisible');\n }\n\n await routerOutlet.commit(enteringEl, leavingEl, {\n duration: skipTransition || directionToUse === undefined ? 0 : undefined,\n direction: directionToUse,\n showGoBack: !!routeInfo.pushedByRoute,\n progressAnimation,\n animationBuilder: routeInfo.routeAnimation,\n });\n };\n\n const routerOutlet = this.routerOutletElement!;\n\n const routeInfoFallbackDirection =\n routeInfo.routeDirection === 'none' || routeInfo.routeDirection === 'root' ? undefined : routeInfo.routeDirection;\n const directionToUse = direction ?? routeInfoFallbackDirection;\n\n if (enteringViewItem && enteringViewItem.ionPageElement && this.routerOutletElement) {\n if (leavingViewItem && leavingViewItem.ionPageElement && enteringViewItem === leavingViewItem) {\n // If a page is transitioning to another version of itself\n // we clone it so we can have an animation to show\n\n const match = matchComponent(leavingViewItem.reactElement, routeInfo.pathname, true);\n if (match) {\n const newLeavingElement = clonePageElement(leavingViewItem.ionPageElement.outerHTML);\n if (newLeavingElement) {\n this.routerOutletElement.appendChild(newLeavingElement);\n await runCommit(enteringViewItem.ionPageElement, newLeavingElement);\n this.routerOutletElement.removeChild(newLeavingElement);\n }\n } else {\n await runCommit(enteringViewItem.ionPageElement, undefined);\n }\n } else {\n await runCommit(enteringViewItem.ionPageElement, leavingViewItem?.ionPageElement);\n if (leavingViewItem && leavingViewItem.ionPageElement && !progressAnimation) {\n leavingViewItem.ionPageElement.classList.add('ion-page-hidden');\n leavingViewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n\n render() {\n const { children } = this.props;\n const ionRouterOutlet = React.Children.only(children) as React.ReactElement;\n this.ionRouterOutlet = ionRouterOutlet;\n\n const components = this.context.getChildrenToRender(this.id, this.ionRouterOutlet, this.props.routeInfo, () => {\n this.forceUpdate();\n });\n\n return (\n <StackContext.Provider value={this.stackContextValue}>\n {React.cloneElement(\n ionRouterOutlet as any,\n {\n ref: (node: HTMLIonRouterOutletElement) => {\n if (ionRouterOutlet.props.setRef) {\n ionRouterOutlet.props.setRef(node);\n }\n if (ionRouterOutlet.props.forwardedRef) {\n ionRouterOutlet.props.forwardedRef.current = node;\n }\n this.routerOutletElement = node;\n const { ref } = ionRouterOutlet as any;\n if (typeof ref === 'function') {\n ref(node);\n }\n },\n },\n components\n )}\n </StackContext.Provider>\n );\n }\n\n static get contextType() {\n return RouteManagerContext;\n }\n}\n\nexport default StackManager;\n\nfunction matchRoute(node: React.ReactNode, routeInfo: RouteInfo) {\n let matchedNode: React.ReactNode;\n React.Children.forEach(node as React.ReactElement, (child: React.ReactElement) => {\n const match = matchPath({\n pathname: routeInfo.pathname,\n componentProps: child.props,\n });\n if (match) {\n matchedNode = child;\n }\n });\n\n if (matchedNode) {\n return matchedNode;\n }\n // If we haven't found a node\n // try to find one that doesn't have a path or from prop, that will be our not found route\n React.Children.forEach(node as React.ReactElement, (child: React.ReactElement) => {\n if (!(child.props.path || child.props.from)) {\n matchedNode = child;\n }\n });\n\n return matchedNode;\n}\n\nfunction matchComponent(node: React.ReactElement, pathname: string, forceExact?: boolean) {\n return matchPath({\n pathname,\n componentProps: {\n ...node.props,\n exact: forceExact,\n },\n });\n}\n","import type {\n AnimationBuilder,\n RouteAction,\n RouteInfo,\n RouteManagerContextState,\n RouterDirection,\n ViewItem,\n} from '@ionic/react';\nimport { LocationHistory, NavManager, RouteManagerContext, generateId, getConfig } from '@ionic/react';\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport React from 'react';\nimport type { RouteComponentProps } from 'react-router-dom';\nimport { withRouter } from 'react-router-dom';\n\nimport { IonRouteInner } from './IonRouteInner';\nimport { ReactRouterViewStack } from './ReactRouterViewStack';\nimport StackManager from './StackManager';\n\nexport interface LocationState {\n direction?: RouterDirection;\n routerOptions?: { as?: string; unmount?: boolean };\n}\n\ninterface IonRouteProps extends RouteComponentProps<{}, {}, LocationState> {\n registerHistoryListener: (cb: (location: HistoryLocation<any>, action: HistoryAction) => void) => void;\n}\n\ninterface IonRouteState {\n routeInfo: RouteInfo;\n}\n\nclass IonRouterInner extends React.PureComponent<IonRouteProps, IonRouteState> {\n currentTab?: string;\n exitViewFromOtherOutletHandlers: ((pathname: string) => ViewItem | undefined)[] = [];\n incomingRouteParams?: Partial<RouteInfo>;\n locationHistory = new LocationHistory();\n viewStack = new ReactRouterViewStack();\n routeMangerContextState: RouteManagerContextState = {\n canGoBack: () => this.locationHistory.canGoBack(),\n clearOutlet: this.viewStack.clear,\n findViewItemByPathname: this.viewStack.findViewItemByPathname,\n getChildrenToRender: this.viewStack.getChildrenToRender,\n goBack: () => this.handleNavigateBack(),\n createViewItem: this.viewStack.createViewItem,\n findViewItemByRouteInfo: this.viewStack.findViewItemByRouteInfo,\n findLeavingViewItemByRouteInfo: this.viewStack.findLeavingViewItemByRouteInfo,\n addViewItem: this.viewStack.add,\n unMountViewItem: this.viewStack.remove,\n };\n\n constructor(props: IonRouteProps) {\n super(props);\n\n const routeInfo = {\n id: generateId('routeInfo'),\n pathname: this.props.location.pathname,\n search: this.props.location.search,\n };\n\n this.locationHistory.add(routeInfo);\n this.handleChangeTab = this.handleChangeTab.bind(this);\n this.handleResetTab = this.handleResetTab.bind(this);\n this.handleNativeBack = this.handleNativeBack.bind(this);\n this.handleNavigate = this.handleNavigate.bind(this);\n this.handleNavigateBack = this.handleNavigateBack.bind(this);\n this.props.registerHistoryListener(this.handleHistoryChange.bind(this));\n this.handleSetCurrentTab = this.handleSetCurrentTab.bind(this);\n\n this.state = {\n routeInfo,\n };\n }\n\n handleChangeTab(tab: string, path?: string, routeOptions?: any) {\n if (!path) {\n return;\n }\n\n const routeInfo = this.locationHistory.getCurrentRouteInfoForTab(tab);\n const [pathname, search] = path.split('?');\n if (routeInfo) {\n this.incomingRouteParams = { ...routeInfo, routeAction: 'push', routeDirection: 'none' };\n if (routeInfo.pathname === pathname) {\n this.incomingRouteParams.routeOptions = routeOptions;\n this.props.history.push(routeInfo.pathname + (routeInfo.search || ''));\n } else {\n this.incomingRouteParams.pathname = pathname;\n this.incomingRouteParams.search = search ? '?' + search : undefined;\n this.incomingRouteParams.routeOptions = routeOptions;\n this.props.history.push(pathname + (search ? '?' + search : ''));\n }\n } else {\n this.handleNavigate(pathname, 'push', 'none', undefined, routeOptions, tab);\n }\n }\n\n handleHistoryChange(location: HistoryLocation<LocationState>, action: HistoryAction) {\n let leavingLocationInfo: RouteInfo;\n if (this.incomingRouteParams) {\n if (this.incomingRouteParams.routeAction === 'replace') {\n leavingLocationInfo = this.locationHistory.previous();\n } else {\n leavingLocationInfo = this.locationHistory.current();\n }\n } else {\n leavingLocationInfo = this.locationHistory.current();\n }\n\n const leavingUrl = leavingLocationInfo.pathname + leavingLocationInfo.search;\n if (leavingUrl !== location.pathname) {\n if (!this.incomingRouteParams) {\n if (action === 'REPLACE') {\n this.incomingRouteParams = {\n routeAction: 'replace',\n routeDirection: 'none',\n tab: this.currentTab,\n };\n }\n if (action === 'POP') {\n const currentRoute = this.locationHistory.current();\n if (currentRoute && currentRoute.pushedByRoute) {\n const prevInfo = this.locationHistory.findLastLocation(currentRoute);\n this.incomingRouteParams = { ...prevInfo, routeAction: 'pop', routeDirection: 'back' };\n } else {\n this.incomingRouteParams = {\n routeAction: 'pop',\n routeDirection: 'none',\n tab: this.currentTab,\n };\n }\n }\n if (!this.incomingRouteParams) {\n this.incomingRouteParams = {\n routeAction: 'push',\n routeDirection: location.state?.direction || 'forward',\n routeOptions: location.state?.routerOptions,\n tab: this.currentTab,\n };\n }\n }\n\n let routeInfo: RouteInfo;\n\n if (this.incomingRouteParams?.id) {\n routeInfo = {\n ...(this.incomingRouteParams as RouteInfo),\n lastPathname: leavingLocationInfo.pathname,\n };\n this.locationHistory.add(routeInfo);\n } else {\n const isPushed =\n this.incomingRouteParams.routeAction === 'push' && this.incomingRouteParams.routeDirection === 'forward';\n routeInfo = {\n id: generateId('routeInfo'),\n ...this.incomingRouteParams,\n lastPathname: leavingLocationInfo.pathname,\n pathname: location.pathname,\n search: location.search,\n params: this.props.match.params,\n prevRouteLastPathname: leavingLocationInfo.lastPathname,\n };\n if (isPushed) {\n routeInfo.tab = leavingLocationInfo.tab;\n routeInfo.pushedByRoute = leavingLocationInfo.pathname;\n } else if (routeInfo.routeAction === 'pop') {\n const r = this.locationHistory.findLastLocation(routeInfo);\n routeInfo.pushedByRoute = r?.pushedByRoute;\n } else if (routeInfo.routeAction === 'push' && routeInfo.tab !== leavingLocationInfo.tab) {\n // If we are switching tabs grab the last route info for the tab and use its pushedByRoute\n const lastRoute = this.locationHistory.getCurrentRouteInfoForTab(routeInfo.tab);\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute;\n } else if (routeInfo.routeAction === 'replace') {\n // Make sure to set the lastPathname, etc.. to the current route so the page transitions out\n const currentRouteInfo = this.locationHistory.current();\n\n /**\n * If going from /home to /child, then replacing from\n * /child to /home, we don't want the route info to\n * say that /home was pushed by /home which is not correct.\n */\n const currentPushedBy = currentRouteInfo?.pushedByRoute;\n const pushedByRoute =\n currentPushedBy !== undefined && currentPushedBy !== routeInfo.pathname\n ? currentPushedBy\n : routeInfo.pushedByRoute;\n\n routeInfo.lastPathname = currentRouteInfo?.pathname || routeInfo.lastPathname;\n routeInfo.prevRouteLastPathname = currentRouteInfo?.lastPathname;\n routeInfo.pushedByRoute = pushedByRoute;\n\n /**\n * When replacing routes we should still prefer\n * any custom direction/animation that the developer\n * has specified when navigating first instead of relying\n * on previously used directions/animations.\n */\n routeInfo.routeDirection = routeInfo.routeDirection || currentRouteInfo?.routeDirection;\n routeInfo.routeAnimation = routeInfo.routeAnimation || currentRouteInfo?.routeAnimation;\n }\n\n this.locationHistory.add(routeInfo);\n }\n\n this.setState({\n routeInfo,\n });\n }\n\n this.incomingRouteParams = undefined;\n }\n\n /**\n * history@4.x uses goBack(), history@5.x uses back()\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just\n * assume back() is available.\n */\n handleNativeBack() {\n const history = this.props.history as any;\n const goBack = history.goBack || history.back;\n goBack();\n }\n\n handleNavigate(\n path: string,\n routeAction: RouteAction,\n routeDirection?: RouterDirection,\n routeAnimation?: AnimationBuilder,\n routeOptions?: any,\n tab?: string\n ) {\n this.incomingRouteParams = Object.assign(this.incomingRouteParams || {}, {\n routeAction,\n routeDirection,\n routeOptions,\n routeAnimation,\n tab,\n });\n\n if (routeAction === 'push') {\n this.props.history.push(path);\n } else {\n this.props.history.replace(path);\n }\n }\n\n handleNavigateBack(defaultHref: string | RouteInfo = '/', routeAnimation?: AnimationBuilder) {\n const config = getConfig();\n defaultHref = defaultHref ? defaultHref : config && config.get('backButtonDefaultHref' as any);\n const routeInfo = this.locationHistory.current();\n if (routeInfo && routeInfo.pushedByRoute) {\n const prevInfo = this.locationHistory.findLastLocation(routeInfo);\n if (prevInfo) {\n /**\n * This needs to be passed to handleNavigate\n * otherwise incomingRouteParams.routeAnimation\n * will be overridden.\n */\n const incomingAnimation = routeAnimation || routeInfo.routeAnimation;\n this.incomingRouteParams = {\n ...prevInfo,\n routeAction: 'pop',\n routeDirection: 'back',\n routeAnimation: incomingAnimation,\n };\n if (\n routeInfo.lastPathname === routeInfo.pushedByRoute ||\n /**\n * We need to exclude tab switches/tab\n * context changes here because tabbed\n * navigation is not linear, but router.back()\n * will go back in a linear fashion.\n */\n (prevInfo.pathname === routeInfo.pushedByRoute && routeInfo.tab === '' && prevInfo.tab === '')\n ) {\n /**\n * history@4.x uses goBack(), history@5.x uses back()\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just\n * assume back() is available.\n */\n const history = this.props.history as any;\n const goBack = history.goBack || history.back;\n goBack();\n } else {\n this.handleNavigate(prevInfo.pathname + (prevInfo.search || ''), 'pop', 'back', incomingAnimation);\n }\n } else {\n this.handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n } else {\n this.handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n }\n\n handleResetTab(tab: string, originalHref: string, originalRouteOptions: any) {\n const routeInfo = this.locationHistory.getFirstRouteInfoForTab(tab);\n if (routeInfo) {\n const newRouteInfo = { ...routeInfo };\n newRouteInfo.pathname = originalHref;\n newRouteInfo.routeOptions = originalRouteOptions;\n this.incomingRouteParams = { ...newRouteInfo, routeAction: 'pop', routeDirection: 'back' };\n this.props.history.push(newRouteInfo.pathname + (newRouteInfo.search || ''));\n }\n }\n\n handleSetCurrentTab(tab: string) {\n this.currentTab = tab;\n const ri = { ...this.locationHistory.current() };\n if (ri.tab !== tab) {\n ri.tab = tab;\n this.locationHistory.update(ri);\n }\n }\n\n render() {\n return (\n <RouteManagerContext.Provider value={this.routeMangerContextState}>\n <NavManager\n ionRoute={IonRouteInner}\n ionRedirect={{}}\n stackManager={StackManager}\n routeInfo={this.state.routeInfo!}\n onNativeBack={this.handleNativeBack}\n onNavigateBack={this.handleNavigateBack}\n onNavigate={this.handleNavigate}\n onSetCurrentTab={this.handleSetCurrentTab}\n onChangeTab={this.handleChangeTab}\n onResetTab={this.handleResetTab}\n locationHistory={this.locationHistory}\n >\n {this.props.children}\n </NavManager>\n </RouteManagerContext.Provider>\n );\n }\n}\n\nexport const IonRouter = withRouter(IonRouterInner);\nIonRouter.displayName = 'IonRouter';\n","import type { Action as HistoryAction, History, Location as HistoryLocation } from 'history';\nimport { createBrowserHistory as createHistory } from 'history';\nimport React from 'react';\nimport type { BrowserRouterProps } from 'react-router-dom';\nimport { Router } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\ninterface IonReactRouterProps extends BrowserRouterProps {\n history?: History;\n}\n\nexport class IonReactRouter extends React.Component<IonReactRouterProps> {\n historyListenHandler?: (location: HistoryLocation, action: HistoryAction) => void;\n history: History;\n\n constructor(props: IonReactRouterProps) {\n super(props);\n const { history, ...rest } = props;\n this.history = history || createHistory(rest);\n this.history.listen(this.handleHistoryChange.bind(this));\n this.registerHistoryListener = this.registerHistoryListener.bind(this);\n }\n\n /**\n * history@4.x passes separate location and action\n * params. history@5.x passes location and action\n * together as a single object.\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just assume\n * a single object with both location and action.\n */\n handleHistoryChange(location: HistoryLocation, action: HistoryAction) {\n const locationValue = (location as any).location || location;\n const actionValue = (location as any).action || action;\n if (this.historyListenHandler) {\n this.historyListenHandler(locationValue, actionValue);\n }\n }\n\n registerHistoryListener(cb: (location: HistoryLocation, action: HistoryAction) => void) {\n this.historyListenHandler = cb;\n }\n\n render() {\n const { children, ...props } = this.props;\n return (\n <Router history={this.history} {...props}>\n <IonRouter registerHistoryListener={this.registerHistoryListener}>{children}</IonRouter>\n </Router>\n );\n }\n}\n","import type { Action as HistoryAction, Location as HistoryLocation, MemoryHistory } from 'history';\nimport React from 'react';\nimport type { MemoryRouterProps } from 'react-router';\nimport { Router } from 'react-router';\n\nimport { IonRouter } from './IonRouter';\n\ninterface IonReactMemoryRouterProps extends MemoryRouterProps {\n history: MemoryHistory;\n}\n\nexport class IonReactMemoryRouter extends React.Component<IonReactMemoryRouterProps> {\n history: MemoryHistory;\n historyListenHandler?: (location: HistoryLocation, action: HistoryAction) => void;\n\n constructor(props: IonReactMemoryRouterProps) {\n super(props);\n this.history = props.history;\n this.history.listen(this.handleHistoryChange.bind(this));\n this.registerHistoryListener = this.registerHistoryListener.bind(this);\n }\n\n /**\n * history@4.x passes separate location and action\n * params. history@5.x passes location and action\n * together as a single object.\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just assume\n * a single object with both location and action.\n */\n handleHistoryChange(location: HistoryLocation, action: HistoryAction) {\n const locationValue = (location as any).location || location;\n const actionValue = (location as any).action || action;\n if (this.historyListenHandler) {\n this.historyListenHandler(locationValue, actionValue);\n }\n }\n\n registerHistoryListener(cb: (location: HistoryLocation, action: HistoryAction) => void) {\n this.historyListenHandler = cb;\n }\n\n render() {\n const { children, ...props } = this.props;\n return (\n <Router {...props}>\n <IonRouter registerHistoryListener={this.registerHistoryListener}>{children}</IonRouter>\n </Router>\n );\n }\n}\n","import type { Action as HistoryAction, History, Location as HistoryLocation } from 'history';\nimport { createHashHistory as createHistory } from 'history';\nimport React from 'react';\nimport type { BrowserRouterProps } from 'react-router-dom';\nimport { Router } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\ninterface IonReactHashRouterProps extends BrowserRouterProps {\n history?: History;\n}\n\nexport class IonReactHashRouter extends React.Component<IonReactHashRouterProps> {\n history: History;\n historyListenHandler?: (location: HistoryLocation, action: HistoryAction) => void;\n\n constructor(props: IonReactHashRouterProps) {\n super(props);\n const { history, ...rest } = props;\n this.history = history || createHistory(rest);\n this.history.listen(this.handleHistoryChange.bind(this));\n this.registerHistoryListener = this.registerHistoryListener.bind(this);\n }\n\n /**\n * history@4.x passes separate location and action\n * params. history@5.x passes location and action\n * together as a single object.\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just assume\n * a single object with both location and action.\n */\n handleHistoryChange(location: HistoryLocation, action: HistoryAction) {\n const locationValue = (location as any).location || location;\n const actionValue = (location as any).action || action;\n if (this.historyListenHandler) {\n this.historyListenHandler(locationValue, actionValue);\n }\n }\n\n registerHistoryListener(cb: (location: HistoryLocation, action: HistoryAction) => void) {\n this.historyListenHandler = cb;\n }\n\n render() {\n const { children, ...props } = this.props;\n return (\n <Router history={this.history} {...props}>\n <IonRouter registerHistoryListener={this.registerHistoryListener}>{children}</IonRouter>\n </Router>\n );\n }\n}\n"],"names":["reactRouterMatchPath","matchComponent","createHistory","Router"],"mappings":";;;;;;;AAIa,MAAA,aAAc,SAAQ,KAAK,CAAC,aAA4B,CAAA;IACnE,MAAM,GAAA;AACJ,QAAA,QACE,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,MAAA,CAAA,MAAA,CAAA,EACJ,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAUpB,GAAE,IAAI,CAAC,KAAa,CAAC,aAAa,KAAK,SAAS;AACjD,cAAE;AACE,gBAAA,aAAa,EAAG,IAAI,CAAC,KAAa,CAAC,aAAa;AACjD,aAAA;AACH,cAAE,EAAE,EAAC,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AAC,IAAI,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACxE;AAED;;;;;;;AAOG;IACH,mBAAmB,CAAC,QAAyB,EAAE,MAAqB,EAAA;AAClE,QAAA,MAAM,aAAa,GAAI,QAAgB,CAAC,QAAQ,IAAI,QAAQ,CAAC;AAC7D,QAAA,MAAM,WAAW,GAAI,QAAgB,CAAC,MAAM,IAAI,MAAM,CAAC;QACvD,IAAI,IAAI,CAAC,oBAAoB,EAAE;AAC7B,YAAA,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AACvD,SAAA;KACF;AAED,IAAA,uBAAuB,CAAC,EAA8D,EAAA;AACpF,QAAA,IAAI,CAAC,oBAAoB,GAAG,EAAE,CAAC;KAChC;IAED,MAAM,GAAA;AACJ,QAAA,MAAM,EAAyB,GAAA,IAAI,CAAC,KAAK,EAAnC,EAAE,QAAQ,EAAA,GAAA,EAAyB,EAApB,KAAK,GAApB,MAAA,CAAA,EAAA,EAAA,CAAA,UAAA,CAAsB,CAAa,CAAC;QAC1C,QACE,KAAC,CAAA,aAAA,CAAA,MAAM,EAAC,MAAA,CAAA,MAAA,CAAA,EAAA,OAAO,EAAE,IAAI,CAAC,OAAO,EAAA,EAAM,KAAK,CAAA;AACtC,YAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAA,EAAG,QAAQ,CAAa,CACjF,EACT;KACH;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/ReactRouter/IonRouteInner.tsx","../src/ReactRouter/utils/pathMatching.ts","../src/ReactRouter/utils/computeParentPath.ts","../src/ReactRouter/utils/pathNormalization.ts","../src/ReactRouter/utils/routeElements.ts","../src/ReactRouter/utils/viewItemUtils.ts","../src/ReactRouter/ReactRouterViewStack.tsx","../src/ReactRouter/clonePageElement.ts","../src/ReactRouter/StackManager.tsx","../src/ReactRouter/IonRouter.tsx","../src/ReactRouter/IonReactRouter.tsx","../src/ReactRouter/IonReactMemoryRouter.tsx","../src/ReactRouter/IonReactHashRouter.tsx"],"sourcesContent":["import type { IonRouteProps } from '@ionic/react';\nimport React from 'react';\nimport { Route } from 'react-router-dom';\n\nexport const IonRouteInner = ({ path, element }: IonRouteProps) => {\n return <Route path={path} element={element} />;\n};\n","import type { PathMatch } from 'react-router';\nimport { matchPath as reactRouterMatchPath } from 'react-router-dom';\n\n/**\n * Options for the matchPath function.\n */\ninterface MatchPathOptions {\n /**\n * The pathname to match against.\n */\n pathname: string;\n /**\n * The props to match against, they are identical to the matching props `Route` accepts.\n */\n componentProps: {\n path?: string;\n caseSensitive?: boolean;\n end?: boolean;\n index?: boolean;\n };\n}\n\n/**\n * The matchPath function is used only for matching paths, not rendering components or elements.\n * @see https://reactrouter.com/v6/utils/match-path\n */\nexport const matchPath = ({ pathname, componentProps }: MatchPathOptions): PathMatch<string> | null => {\n const { path, index, ...restProps } = componentProps;\n\n // Handle index routes\n if (index && !path) {\n // Index routes match when there's no additional path after the parent route\n // For example, in a nested outlet at /routing/*, the index route matches\n // when the relative path is empty (i.e., we're exactly at /routing)\n\n // If pathname is empty or just \"/\", it should match the index route\n if (pathname === '' || pathname === '/') {\n return {\n params: {},\n pathname: pathname,\n pathnameBase: pathname || '/',\n pattern: {\n path: '',\n caseSensitive: false,\n end: true,\n },\n };\n }\n\n // Otherwise, index routes don't match when there's additional path\n return null;\n }\n\n if (!path) {\n return null;\n }\n\n // For relative paths in nested routes (those that don't start with '/'),\n // use React Router's matcher against a normalized path.\n if (!path.startsWith('/')) {\n const matchOptions: Parameters<typeof reactRouterMatchPath>[0] = {\n path: `/${path}`,\n ...restProps,\n };\n\n if (matchOptions?.end === undefined) {\n matchOptions.end = !path.endsWith('*');\n }\n\n const normalizedPathname = pathname.startsWith('/') ? pathname : `/${pathname}`;\n const match = reactRouterMatchPath(matchOptions, normalizedPathname);\n\n if (match) {\n // Adjust the match to remove the leading '/' we added\n return {\n ...match,\n pathname: pathname,\n pathnameBase: match.pathnameBase === '/' ? '' : match.pathnameBase.slice(1),\n pattern: {\n ...match.pattern,\n path: path,\n },\n };\n }\n\n // No match found\n return null;\n }\n\n // For absolute paths, use React Router's matcher directly.\n // React Router v6 routes default to `end: true` unless the pattern\n // explicitly opts into wildcards with `*`. Mirror that behaviour so\n // matching parity stays aligned with <Route>.\n const matchOptions: Parameters<typeof reactRouterMatchPath>[0] = {\n path,\n ...restProps,\n };\n\n if (matchOptions?.end === undefined) {\n matchOptions.end = !path.endsWith('*');\n }\n\n return reactRouterMatchPath(matchOptions, pathname);\n};\n\n/**\n * Determines the portion of a pathname that a given route pattern should match against.\n * For absolute route patterns we return the full pathname. For relative patterns we\n * strip off the already-matched parent segments so React Router receives the remainder.\n */\nexport const derivePathnameToMatch = (fullPathname: string, routePath?: string): string => {\n if (!routePath || routePath === '' || routePath.startsWith('/')) {\n return fullPathname;\n }\n\n const trimmedPath = fullPathname.startsWith('/') ? fullPathname.slice(1) : fullPathname;\n if (!trimmedPath) {\n return '';\n }\n\n const fullSegments = trimmedPath.split('/').filter(Boolean);\n if (fullSegments.length === 0) {\n return '';\n }\n\n const routeSegments = routePath.split('/').filter(Boolean);\n if (routeSegments.length === 0) {\n return trimmedPath;\n }\n\n const wildcardIndex = routeSegments.findIndex((segment) => segment === '*' || segment === '**');\n\n if (wildcardIndex >= 0) {\n const baseSegments = routeSegments.slice(0, wildcardIndex);\n if (baseSegments.length === 0) {\n return trimmedPath;\n }\n\n const startIndex = fullSegments.findIndex((_, idx) =>\n baseSegments.every((seg, segIdx) => {\n const target = fullSegments[idx + segIdx];\n if (!target) {\n return false;\n }\n if (seg.startsWith(':')) {\n return true;\n }\n return target === seg;\n })\n );\n\n if (startIndex >= 0) {\n return fullSegments.slice(startIndex).join('/');\n }\n }\n\n if (routeSegments.length <= fullSegments.length) {\n return fullSegments.slice(fullSegments.length - routeSegments.length).join('/');\n }\n\n return fullSegments[fullSegments.length - 1] ?? trimmedPath;\n};\n","import type React from 'react';\n\nimport { matchPath } from './pathMatching';\n\n/**\n * Finds the longest common prefix among an array of paths.\n * Used to determine the scope of an outlet with absolute routes.\n *\n * @param paths An array of absolute path strings.\n * @returns The common prefix shared by all paths.\n */\nexport const computeCommonPrefix = (paths: string[]): string => {\n if (paths.length === 0) return '';\n if (paths.length === 1) {\n // For a single path, extract the directory-like prefix\n // e.g., /dynamic-routes/home -> /dynamic-routes\n const segments = paths[0].split('/').filter(Boolean);\n if (segments.length > 1) {\n return '/' + segments.slice(0, -1).join('/');\n }\n return '/' + segments[0];\n }\n\n // Split all paths into segments\n const segmentArrays = paths.map((p) => p.split('/').filter(Boolean));\n const minLength = Math.min(...segmentArrays.map((s) => s.length));\n\n const commonSegments: string[] = [];\n for (let i = 0; i < minLength; i++) {\n const segment = segmentArrays[0][i];\n // Skip segments with route parameters or wildcards\n if (segment.includes(':') || segment.includes('*')) {\n break;\n }\n const allMatch = segmentArrays.every((s) => s[i] === segment);\n if (allMatch) {\n commonSegments.push(segment);\n } else {\n break;\n }\n }\n\n return commonSegments.length > 0 ? '/' + commonSegments.join('/') : '';\n};\n\n/**\n * Checks if a route is a specific match (not wildcard or index).\n *\n * @param route The route element to check.\n * @param remainingPath The remaining path to match against.\n * @returns True if the route specifically matches the remaining path.\n */\nexport const isSpecificRouteMatch = (route: React.ReactElement, remainingPath: string): boolean => {\n const routePath = route.props.path;\n const isWildcardOnly = routePath === '*' || routePath === '/*';\n const isIndex = route.props.index;\n\n // Skip wildcards and index routes\n if (isIndex || isWildcardOnly) {\n return false;\n }\n\n return !!matchPath({\n pathname: remainingPath,\n componentProps: route.props,\n });\n};\n\n/**\n * Result of parent path computation.\n */\nexport interface ParentPathResult {\n parentPath: string | undefined;\n outletMountPath: string | undefined;\n}\n\ninterface RouteAnalysis {\n hasRelativeRoutes: boolean;\n hasIndexRoute: boolean;\n hasWildcardRoute: boolean;\n routeChildren: React.ReactElement[];\n}\n\n/**\n * Analyzes route children to determine their characteristics.\n *\n * @param routeChildren The route children to analyze.\n * @returns Analysis of the route characteristics.\n */\nexport const analyzeRouteChildren = (routeChildren: React.ReactElement[]): RouteAnalysis => {\n const hasRelativeRoutes = routeChildren.some((route) => {\n const path = route.props.path;\n return path && !path.startsWith('/') && path !== '*';\n });\n\n const hasIndexRoute = routeChildren.some((route) => route.props.index);\n\n const hasWildcardRoute = routeChildren.some((route) => {\n const routePath = route.props.path;\n return routePath === '*' || routePath === '/*';\n });\n\n return { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute, routeChildren };\n};\n\ninterface ComputeParentPathOptions {\n currentPathname: string;\n outletMountPath: string | undefined;\n routeChildren: React.ReactElement[];\n hasRelativeRoutes: boolean;\n hasIndexRoute: boolean;\n hasWildcardRoute: boolean;\n}\n\n/**\n * Computes the parent path for a nested outlet based on the current pathname\n * and the outlet's route configuration.\n *\n * The algorithm finds the shortest parent path where a route matches the remaining path.\n * Priority: specific routes > wildcard routes > index routes (only at mount point)\n *\n * @param options The options for computing the parent path.\n * @returns The computed parent path result.\n */\nexport const computeParentPath = (options: ComputeParentPathOptions): ParentPathResult => {\n const { currentPathname, outletMountPath, routeChildren, hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } =\n options;\n\n // If this outlet previously established a mount path and the current\n // pathname is outside of that scope, do not attempt to re-compute a new\n // parent path.\n if (outletMountPath && !currentPathname.startsWith(outletMountPath)) {\n return { parentPath: undefined, outletMountPath };\n }\n\n if ((hasRelativeRoutes || hasIndexRoute) && currentPathname.includes('/')) {\n const segments = currentPathname.split('/').filter(Boolean);\n\n if (segments.length >= 1) {\n // Find matches at each level, keeping track of the FIRST (shortest) match\n let firstSpecificMatch: string | undefined = undefined;\n let firstWildcardMatch: string | undefined = undefined;\n let indexMatchAtMount: string | undefined = undefined;\n\n for (let i = 1; i <= segments.length; i++) {\n const parentPath = '/' + segments.slice(0, i).join('/');\n const remainingPath = segments.slice(i).join('/');\n\n // Check for specific (non-wildcard, non-index) route matches\n const hasSpecificMatch = routeChildren.some((route) => isSpecificRouteMatch(route, remainingPath));\n if (hasSpecificMatch && !firstSpecificMatch) {\n firstSpecificMatch = parentPath;\n // Found a specific match - this is our answer for non-index routes\n break;\n }\n\n // Check if wildcard would match this remaining path\n // Only if remaining is non-empty (wildcard needs something to match)\n if (remainingPath !== '' && remainingPath !== '/' && hasWildcardRoute && !firstWildcardMatch) {\n // Check if any specific route could plausibly match this remaining path\n const remainingFirstSegment = remainingPath.split('/')[0];\n const couldAnyRouteMatch = routeChildren.some((route) => {\n const routePath = route.props.path as string | undefined;\n if (!routePath || routePath === '*' || routePath === '/*') return false;\n if (route.props.index) return false;\n\n const routeFirstSegment = routePath.split('/')[0].replace(/[*:]/g, '');\n if (!routeFirstSegment) return false;\n\n // Check for prefix overlap (either direction)\n return (\n routeFirstSegment.startsWith(remainingFirstSegment.slice(0, 3)) ||\n remainingFirstSegment.startsWith(routeFirstSegment.slice(0, 3))\n );\n });\n\n // Only save wildcard match if no specific route could match\n if (!couldAnyRouteMatch) {\n firstWildcardMatch = parentPath;\n // Continue looking - might find a specific match at a longer path\n }\n }\n\n // Check for index route match when remaining path is empty\n // BUT only at the outlet's mount path level\n if ((remainingPath === '' || remainingPath === '/') && hasIndexRoute) {\n // Index route matches when current path exactly matches the mount path\n // If we already have an outletMountPath, index should only match there\n if (outletMountPath) {\n if (parentPath === outletMountPath) {\n indexMatchAtMount = parentPath;\n }\n } else {\n // No mount path set yet - index would establish this as mount path\n // But only if we haven't found a better match\n indexMatchAtMount = parentPath;\n }\n }\n }\n\n // Determine the best parent path:\n // 1. Specific match (routes like tabs/*, favorites) - highest priority\n // 2. Wildcard match (route path=\"*\") - catches unmatched segments\n // 3. Index match - only valid at the outlet's mount point, not deeper\n let bestPath: string | undefined = undefined;\n\n if (firstSpecificMatch) {\n bestPath = firstSpecificMatch;\n } else if (firstWildcardMatch) {\n bestPath = firstWildcardMatch;\n } else if (indexMatchAtMount) {\n // Only use index match if no specific or wildcard matched\n // This handles the case where pathname exactly matches the mount path\n bestPath = indexMatchAtMount;\n }\n\n // Store the mount path when we first successfully match a route\n let newOutletMountPath = outletMountPath;\n if (!outletMountPath && bestPath) {\n newOutletMountPath = bestPath;\n }\n\n // If we have a mount path, verify the current pathname is within scope\n if (newOutletMountPath && !currentPathname.startsWith(newOutletMountPath)) {\n return { parentPath: undefined, outletMountPath: newOutletMountPath };\n }\n\n return { parentPath: bestPath, outletMountPath: newOutletMountPath };\n }\n }\n\n // Handle outlets with ONLY absolute routes (no relative routes or index routes)\n // Compute the common prefix of all absolute routes to determine the outlet's scope\n if (!hasRelativeRoutes && !hasIndexRoute) {\n const absolutePathRoutes = routeChildren.filter((route) => {\n const path = route.props.path;\n return path && path.startsWith('/');\n });\n\n if (absolutePathRoutes.length > 0) {\n const absolutePaths = absolutePathRoutes.map((r) => r.props.path as string);\n const commonPrefix = computeCommonPrefix(absolutePaths);\n\n if (commonPrefix && commonPrefix !== '/') {\n // Set the mount path based on common prefix of absolute routes\n const newOutletMountPath = outletMountPath || commonPrefix;\n\n // Check if current pathname is within scope\n if (!currentPathname.startsWith(commonPrefix)) {\n return { parentPath: undefined, outletMountPath: newOutletMountPath };\n }\n\n return { parentPath: commonPrefix, outletMountPath: newOutletMountPath };\n }\n }\n }\n\n return { parentPath: outletMountPath, outletMountPath };\n};\n","/**\n * Ensures the given path has a leading slash.\n *\n * @param value The path string to normalize.\n * @returns The path with a leading slash.\n */\nexport const ensureLeadingSlash = (value: string): string => {\n if (value === '') {\n return '/';\n }\n return value.startsWith('/') ? value : `/${value}`;\n};\n\n/**\n * Strips the trailing slash from a path, unless it's the root path.\n *\n * @param value The path string to normalize.\n * @returns The path without a trailing slash.\n */\nexport const stripTrailingSlash = (value: string): string => {\n return value.length > 1 && value.endsWith('/') ? value.slice(0, -1) : value;\n};\n\n/**\n * Normalizes a pathname for comparison by ensuring a leading slash\n * and removing trailing slashes.\n *\n * @param value The pathname to normalize, can be undefined.\n * @returns A normalized pathname string.\n */\nexport const normalizePathnameForComparison = (value: string | undefined): string => {\n if (!value || value === '') {\n return '/';\n }\n const withLeadingSlash = ensureLeadingSlash(value);\n return stripTrailingSlash(withLeadingSlash);\n};\n","import React from 'react';\nimport { Navigate, Route, Routes } from 'react-router-dom';\n\n/**\n * Extracts the children from a Routes wrapper component.\n * The use of `<Routes />` is encouraged with React Router v6.\n *\n * @param node The React node to extract Routes children from.\n * @returns The children of the Routes component, or undefined if not found.\n */\nexport const getRoutesChildren = (node: React.ReactNode): React.ReactNode | undefined => {\n let routesNode: React.ReactNode;\n React.Children.forEach(node as React.ReactElement, (child: React.ReactElement) => {\n if (child.type === Routes) {\n routesNode = child;\n }\n });\n\n if (routesNode) {\n // The children of the `<Routes />` component are most likely\n // (and should be) the `<Route />` components.\n return (routesNode as React.ReactElement).props.children;\n }\n return undefined;\n};\n\n/**\n * Extracts Route children from a node (either directly or from a Routes wrapper).\n *\n * @param children The children to extract routes from.\n * @returns An array of Route elements.\n */\nexport const extractRouteChildren = (children: React.ReactNode): React.ReactElement[] => {\n const routesChildren = getRoutesChildren(children) ?? children;\n return React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement => React.isValidElement(child) && child.type === Route\n );\n};\n\n/**\n * Checks if a React element is a Navigate component (redirect).\n *\n * @param element The element to check.\n * @returns True if the element is a Navigate component.\n */\nexport const isNavigateElement = (element: unknown): boolean => {\n return (\n React.isValidElement(element) &&\n (element.type === Navigate || (typeof element.type === 'function' && element.type.name === 'Navigate'))\n );\n};\n","import type { ViewItem } from '@ionic/react';\n\n/**\n * Sorts view items by route specificity (most specific first).\n * - Exact matches (no wildcards/params) come first\n * - Among wildcard routes, longer paths are more specific\n *\n * @param views The view items to sort.\n * @returns A new sorted array of view items.\n */\nexport const sortViewsBySpecificity = (views: ViewItem[]): ViewItem[] => {\n return [...views].sort((a, b) => {\n const pathA = a.routeData?.childProps?.path || '';\n const pathB = b.routeData?.childProps?.path || '';\n\n // Exact matches (no wildcards/params) come first\n const aHasWildcard = pathA.includes('*') || pathA.includes(':');\n const bHasWildcard = pathB.includes('*') || pathB.includes(':');\n\n if (!aHasWildcard && bHasWildcard) return -1;\n if (aHasWildcard && !bHasWildcard) return 1;\n\n // Among wildcard routes, longer paths are more specific\n return pathB.length - pathA.length;\n });\n};\n","/**\n * `ReactRouterViewStack` is a custom navigation manager used in Ionic React\n * apps to map React Router route elements (such as `<IonRoute>`) to \"view\n * items\" that Ionic can manage in a view stack. This is critical to maintain\n * Ionic’s animation, lifecycle, and history behavior across views.\n */\n\nimport type { RouteInfo, ViewItem } from '@ionic/react';\nimport { IonRoute, ViewLifeCycleManager, ViewStacks } from '@ionic/react';\nimport React from 'react';\nimport type { PathMatch } from 'react-router';\nimport { Navigate, UNSAFE_RouteContext as RouteContext } from 'react-router-dom';\n\nimport { analyzeRouteChildren, computeParentPath } from './utils/computeParentPath';\nimport { derivePathnameToMatch, matchPath } from './utils/pathMatching';\nimport { normalizePathnameForComparison } from './utils/pathNormalization';\nimport { extractRouteChildren, isNavigateElement } from './utils/routeElements';\nimport { sortViewsBySpecificity } from './utils/viewItemUtils';\n\n/**\n * Delay in milliseconds before removing a Navigate view item after a redirect.\n * This ensures the redirect navigation completes before the view is removed.\n */\nconst NAVIGATE_REDIRECT_DELAY_MS = 100;\n\n/**\n * Delay in milliseconds before cleaning up a view without an IonPage element.\n * This double-checks that the view is truly not needed before removal.\n */\nconst VIEW_CLEANUP_DELAY_MS = 200;\n\nconst createDefaultMatch = (\n fullPathname: string,\n routeProps: { path?: string; caseSensitive?: boolean; end?: boolean; index?: boolean }\n): PathMatch<string> => {\n const isIndexRoute = !!routeProps.index;\n const patternPath = routeProps.path ?? '';\n const pathnameBase = fullPathname === '' ? '/' : fullPathname;\n const computedEnd =\n routeProps.end !== undefined ? routeProps.end : patternPath !== '' ? !patternPath.endsWith('*') : true;\n\n return {\n params: {},\n pathname: isIndexRoute ? '' : fullPathname,\n pathnameBase,\n pattern: {\n path: patternPath,\n caseSensitive: routeProps.caseSensitive ?? false,\n end: isIndexRoute ? true : computedEnd,\n },\n };\n};\n\nconst computeRelativeToParent = (pathname: string, parentPath?: string): string | null => {\n if (!parentPath) return null;\n const normalizedParent = normalizePathnameForComparison(parentPath);\n const normalizedPathname = normalizePathnameForComparison(pathname);\n\n if (normalizedPathname === normalizedParent) {\n return '';\n }\n\n const withSlash = normalizedParent === '/' ? '/' : normalizedParent + '/';\n if (normalizedPathname.startsWith(withSlash)) {\n return normalizedPathname.slice(withSlash.length);\n }\n return null;\n};\n\nconst resolveIndexRouteMatch = (\n viewItem: ViewItem,\n pathname: string,\n parentPath?: string\n): PathMatch<string> | null => {\n if (!viewItem.routeData?.childProps?.index) {\n return null;\n }\n\n // Prefer computing against the parent path when available to align with RRv6 semantics\n const relative = computeRelativeToParent(pathname, parentPath);\n if (relative !== null) {\n // Index routes match only when there is no remaining path\n if (relative === '' || relative === '/') {\n return createDefaultMatch(parentPath || pathname, viewItem.routeData.childProps);\n }\n return null;\n }\n\n // Fallback: use previously computed match base for equality check\n const previousMatch = viewItem.routeData?.match;\n if (!previousMatch) {\n return null;\n }\n\n const normalizedPathname = normalizePathnameForComparison(pathname);\n const normalizedBase = normalizePathnameForComparison(previousMatch.pathnameBase || previousMatch.pathname || '');\n\n return normalizedPathname === normalizedBase ? previousMatch : null;\n};\n\nexport class ReactRouterViewStack extends ViewStacks {\n private viewItemCounter = 0;\n\n constructor() {\n super();\n }\n\n /**\n * Creates a new view item for the given outlet and react route element.\n * Associates route props with the matched route path for further lookups.\n */\n createViewItem = (outletId: string, reactElement: React.ReactElement, routeInfo: RouteInfo, page?: HTMLElement) => {\n const routePath = reactElement.props.path || '';\n\n // Check if we already have a view item for this exact route that we can reuse\n // Include wildcard routes like tabs/* since they should be reused\n // Also check unmounted items that might have been preserved for browser navigation\n const existingViewItem = this.getViewItemsForOutlet(outletId).find((v) => {\n const existingRouteProps = v.reactElement?.props ?? {};\n const existingPath = existingRouteProps.path || '';\n const existingElement = existingRouteProps.element;\n const newElement = reactElement.props.element;\n const existingIsIndexRoute = !!existingRouteProps.index;\n const newIsIndexRoute = !!reactElement.props.index;\n\n // For Navigate components, match by destination\n const existingIsNavigate = React.isValidElement(existingElement) && existingElement.type === Navigate;\n const newIsNavigate = React.isValidElement(newElement) && newElement.type === Navigate;\n if (existingIsNavigate && newIsNavigate) {\n const existingTo = (existingElement.props as { to?: string })?.to;\n const newTo = (newElement.props as { to?: string })?.to;\n if (existingTo === newTo) {\n return true;\n }\n }\n\n if (existingIsIndexRoute && newIsIndexRoute) {\n return true;\n }\n\n // Reuse view items with the same path\n // Special case: reuse tabs/* and other specific wildcard routes\n // Don't reuse index routes (empty path) or generic catch-all wildcards (*)\n if (existingPath === routePath && existingPath !== '' && existingPath !== '*') {\n // Parameterized routes need pathname matching to ensure /details/1 and /details/2\n // get separate view items. For wildcard routes (e.g., user/:userId/*), compare\n // pathnameBase to allow child path changes while preserving the parent view.\n const hasParams = routePath.includes(':');\n const isWildcard = routePath.includes('*');\n if (hasParams) {\n if (isWildcard) {\n const existingPathnameBase = v.routeData?.match?.pathnameBase;\n const newMatch = matchComponent(reactElement, routeInfo.pathname, false);\n const newPathnameBase = newMatch?.pathnameBase;\n if (existingPathnameBase !== newPathnameBase) {\n return false;\n }\n } else {\n const existingPathname = v.routeData?.match?.pathname;\n if (existingPathname !== routeInfo.pathname) {\n return false;\n }\n }\n }\n return true;\n }\n // Also reuse specific wildcard routes like tabs/*\n if (existingPath === routePath && existingPath.endsWith('/*') && existingPath !== '/*') {\n return true;\n }\n return false;\n });\n\n if (existingViewItem) {\n // Update and ensure the existing view item is properly configured\n existingViewItem.reactElement = reactElement;\n existingViewItem.mount = true;\n existingViewItem.ionPageElement = page || existingViewItem.ionPageElement;\n const updatedMatch =\n matchComponent(reactElement, routeInfo.pathname, false) ||\n existingViewItem.routeData?.match ||\n createDefaultMatch(routeInfo.pathname, reactElement.props);\n\n existingViewItem.routeData = {\n match: updatedMatch,\n childProps: reactElement.props,\n lastPathname: existingViewItem.routeData?.lastPathname, // Preserve navigation history\n };\n return existingViewItem;\n }\n\n this.viewItemCounter++;\n const id = `${outletId}-${this.viewItemCounter}`;\n\n const viewItem: ViewItem = {\n id,\n outletId,\n ionPageElement: page,\n reactElement,\n mount: true,\n ionRoute: true,\n };\n\n if (reactElement.type === IonRoute) {\n viewItem.disableIonPageManagement = reactElement.props.disableIonPageManagement;\n }\n\n const initialMatch =\n matchComponent(reactElement, routeInfo.pathname, true) ||\n createDefaultMatch(routeInfo.pathname, reactElement.props);\n\n viewItem.routeData = {\n match: initialMatch,\n childProps: reactElement.props,\n };\n\n this.add(viewItem);\n\n return viewItem;\n };\n\n /**\n * Renders a ViewLifeCycleManager for the given view item.\n * Handles cleanup if the view no longer matches.\n *\n * - Deactivates view if it no longer matches the current route\n * - Wraps the route element in <Routes> to support nested routing and ensure remounting\n * - Adds a unique key to <Routes> so React Router remounts routes when switching\n */\n private renderViewItem = (viewItem: ViewItem, routeInfo: RouteInfo, parentPath?: string) => {\n const routePath = viewItem.reactElement.props.path || '';\n let match = matchComponent(viewItem.reactElement, routeInfo.pathname);\n\n if (!match) {\n const indexMatch = resolveIndexRouteMatch(viewItem, routeInfo.pathname, parentPath);\n if (indexMatch) {\n match = indexMatch;\n }\n }\n\n // For parameterized routes, check if this is a navigation to a different path instance\n // In that case, we should NOT reuse this view - a new view should be created\n const isParameterRoute = routePath.includes(':');\n const previousMatch = viewItem.routeData?.match;\n const isSamePath = match?.pathname === previousMatch?.pathname;\n\n // Flag to indicate this view should not be reused for this different parameterized path\n const shouldSkipForDifferentParam = isParameterRoute && match && previousMatch && !isSamePath;\n\n // Don't deactivate views automatically - let the StackManager handle view lifecycle\n // This preserves views in the stack for navigation history like native apps\n // Views will be hidden/shown by the StackManager's transition logic instead of being unmounted\n\n // Special handling for Navigate components - they should unmount after redirecting\n const elementComponent = viewItem.reactElement?.props?.element;\n const isNavigateComponent = isNavigateElement(elementComponent);\n\n if (isNavigateComponent) {\n // Navigate components should only be mounted when they match\n // Once they redirect (no longer match), they should be removed completely\n // IMPORTANT: For index routes, we need to check indexMatch too since matchComponent\n // may not properly match index routes without explicit parent path context\n const indexMatch = viewItem.routeData?.childProps?.index\n ? resolveIndexRouteMatch(viewItem, routeInfo.pathname, parentPath)\n : null;\n const hasValidMatch = match || indexMatch;\n\n if (!hasValidMatch && viewItem.mount) {\n viewItem.mount = false;\n // Schedule removal of the Navigate view item after a short delay\n // This ensures the redirect completes before removal\n setTimeout(() => {\n this.remove(viewItem);\n }, NAVIGATE_REDIRECT_DELAY_MS);\n }\n }\n\n // Components that don't have IonPage elements and no longer match should be cleaned up\n // BUT we need to be careful not to remove them if they're part of browser navigation history\n // This handles components that perform immediate actions like programmatic navigation\n // EXCEPTION: Navigate components should ALWAYS remain mounted until they redirect\n // since they need to be rendered to trigger the navigation\n if (!match && viewItem.mount && !viewItem.ionPageElement && !isNavigateComponent) {\n // Check if this view item should be preserved for browser navigation\n // We'll keep it if it was recently active (within the last navigation)\n const shouldPreserve =\n viewItem.routeData.lastPathname === routeInfo.pathname ||\n viewItem.routeData.match?.pathname === routeInfo.lastPathname;\n\n if (!shouldPreserve) {\n // This view item doesn't match and doesn't have an IonPage\n // It's likely a utility component that performs an action and navigates away\n viewItem.mount = false;\n // Schedule removal to allow it to be recreated on next navigation\n setTimeout(() => {\n // Double-check before removing - the view might be needed again\n const stillNotNeeded = !viewItem.mount && !viewItem.ionPageElement;\n if (stillNotNeeded) {\n this.remove(viewItem);\n }\n }, VIEW_CLEANUP_DELAY_MS);\n } else {\n // Preserve it but unmount it for now\n viewItem.mount = false;\n }\n }\n\n // Reactivate view if it matches but was previously deactivated\n // Don't reactivate if this is a parameterized route navigating to a different path instance\n if (match && !viewItem.mount && !shouldSkipForDifferentParam) {\n viewItem.mount = true;\n viewItem.routeData.match = match;\n }\n\n // Deactivate wildcard routes and catch-all routes (empty path) when we have specific route matches\n // This prevents \"Not found\" or fallback pages from showing alongside valid routes\n if (routePath === '*' || routePath === '') {\n // Check if any other view in this outlet has a match for the current route\n const hasSpecificMatch = this.getViewItemsForOutlet(viewItem.outletId).some((v) => {\n if (v.id === viewItem.id) return false; // Skip self\n const vRoutePath = v.reactElement?.props?.path || '';\n if (vRoutePath === '*' || vRoutePath === '') return false; // Skip other wildcard/empty routes\n\n // Check if this view item would match the current route\n const vMatch = v.reactElement ? matchComponent(v.reactElement, routeInfo.pathname) : null;\n return !!vMatch;\n });\n\n if (hasSpecificMatch) {\n viewItem.mount = false;\n // Also hide the ion-page element immediately to prevent visual overlap\n if (viewItem.ionPageElement) {\n viewItem.ionPageElement.classList.add('ion-page-hidden');\n viewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n const routeElement = React.cloneElement(viewItem.reactElement);\n const componentElement = routeElement.props.element;\n // Don't update match for parameterized routes navigating to different path instances\n // This preserves the original match so that findViewItemByPath can correctly skip this view\n if (match && viewItem.routeData.match !== match && !shouldSkipForDifferentParam) {\n viewItem.routeData.match = match;\n }\n const routeMatch = shouldSkipForDifferentParam ? viewItem.routeData?.match : match || viewItem.routeData?.match;\n\n return (\n <RouteContext.Consumer key={`view-context-${viewItem.id}`}>\n {(parentContext) => {\n const parentMatches = parentContext?.matches ?? [];\n let accumulatedParentParams = parentMatches.reduce<Record<string, string | string[] | undefined>>(\n (acc, match) => {\n return { ...acc, ...match.params };\n },\n {}\n );\n\n // If parentMatches is empty, try to extract params from view items in other outlets.\n // This handles cases where React context propagation doesn't work as expected\n // for nested router outlets.\n if (parentMatches.length === 0 && Object.keys(accumulatedParentParams).length === 0) {\n const allViewItems = this.getAllViewItems();\n for (const otherViewItem of allViewItems) {\n // Skip view items from the same outlet\n if (otherViewItem.outletId === viewItem.outletId) continue;\n\n // Check if this view item's route could match the current pathname\n const otherMatch = otherViewItem.routeData?.match;\n if (otherMatch && otherMatch.params && Object.keys(otherMatch.params).length > 0) {\n // Check if the current pathname starts with this view item's matched pathname\n const matchedPathname = otherMatch.pathnameBase || otherMatch.pathname;\n if (matchedPathname && routeInfo.pathname.startsWith(matchedPathname)) {\n accumulatedParentParams = { ...accumulatedParentParams, ...otherMatch.params };\n }\n }\n }\n }\n\n const combinedParams = {\n ...accumulatedParentParams,\n ...(routeMatch?.params ?? {}),\n };\n\n // For relative route paths, we need to compute an absolute pathnameBase\n // by combining the parent's pathnameBase with the matched portion\n let absolutePathnameBase = routeMatch?.pathnameBase || routeInfo.pathname;\n const routePath = routeElement.props.path;\n const isRelativePath = routePath && !routePath.startsWith('/');\n const isIndexRoute = !!routeElement.props.index;\n\n if (isRelativePath || isIndexRoute) {\n // Get the parent's pathnameBase to build the absolute path\n const parentPathnameBase =\n parentMatches.length > 0 ? parentMatches[parentMatches.length - 1].pathnameBase : '/';\n\n // For relative paths, the matchPath returns a relative pathnameBase\n // We need to make it absolute by prepending the parent's base\n if (routeMatch?.pathnameBase && isRelativePath) {\n // Strip leading slash if present in the relative match\n const relativeBase = routeMatch.pathnameBase.startsWith('/')\n ? routeMatch.pathnameBase.slice(1)\n : routeMatch.pathnameBase;\n\n absolutePathnameBase =\n parentPathnameBase === '/' ? `/${relativeBase}` : `${parentPathnameBase}/${relativeBase}`;\n } else if (isIndexRoute) {\n // Index routes should use the parent's base as their base\n absolutePathnameBase = parentPathnameBase;\n }\n }\n\n const contextMatches = [\n ...parentMatches,\n {\n params: combinedParams,\n pathname: routeMatch?.pathname || routeInfo.pathname,\n pathnameBase: absolutePathnameBase,\n route: {\n id: viewItem.id,\n path: routeElement.props.path,\n element: componentElement,\n index: !!routeElement.props.index,\n caseSensitive: routeElement.props.caseSensitive,\n hasErrorBoundary: false,\n },\n },\n ];\n\n const routeContextValue = parentContext\n ? {\n ...parentContext,\n matches: contextMatches,\n }\n : {\n outlet: null,\n matches: contextMatches,\n isDataRoute: false,\n };\n\n return (\n <ViewLifeCycleManager\n key={`view-${viewItem.id}`}\n mount={viewItem.mount}\n removeView={() => this.remove(viewItem)}\n >\n <RouteContext.Provider value={routeContextValue}>{componentElement}</RouteContext.Provider>\n </ViewLifeCycleManager>\n );\n }}\n </RouteContext.Consumer>\n );\n };\n\n /**\n * Re-renders all active view items for the specified outlet.\n * Ensures React elements are updated with the latest match.\n *\n * 1. Iterates through children of IonRouterOutlet\n * 2. Updates each matching viewItem with the current child React element\n * (important for updating props or changes to elements)\n * 3. Returns a list of React components that will be rendered inside the outlet\n * Each view is wrapped in <ViewLifeCycleManager> to manage lifecycle and rendering\n */\n getChildrenToRender = (outletId: string, ionRouterOutlet: React.ReactElement, routeInfo: RouteInfo) => {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Determine parentPath for nested outlets to properly evaluate index routes\n let parentPath: string | undefined = undefined;\n try {\n // Only attempt parent path computation for non-root outlets\n if (outletId !== 'routerOutlet') {\n const routeChildren = extractRouteChildren(ionRouterOutlet.props.children);\n const { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } = analyzeRouteChildren(routeChildren);\n\n if (hasRelativeRoutes || hasIndexRoute) {\n const result = computeParentPath({\n currentPathname: routeInfo.pathname,\n outletMountPath: undefined,\n routeChildren,\n hasRelativeRoutes,\n hasIndexRoute,\n hasWildcardRoute,\n });\n parentPath = result.parentPath;\n }\n }\n } catch (e) {\n // Non-fatal: if we fail to compute parentPath, fall back to previous behavior\n }\n\n // Sync child elements with stored viewItems (e.g. to reflect new props)\n React.Children.forEach(ionRouterOutlet.props.children, (child: React.ReactElement) => {\n // Ensure the child is a valid React element since we\n // might have whitespace strings or other non-element children\n if (React.isValidElement(child)) {\n // Find view item by exact path match to avoid wildcard routes overwriting specific routes\n const childPath = (child.props as any).path;\n const viewItem = viewItems.find((v) => {\n const viewItemPath = v.reactElement?.props?.path;\n // Only update if paths match exactly (prevents wildcard routes from overwriting specific routes)\n return viewItemPath === childPath;\n });\n if (viewItem) {\n viewItem.reactElement = child;\n }\n }\n });\n\n // Filter out duplicate view items by ID (but keep all mounted items)\n const uniqueViewItems = viewItems.filter((viewItem, index, array) => {\n // Remove duplicates by ID (keep first occurrence)\n const isFirstOccurrence = array.findIndex((v) => v.id === viewItem.id) === index;\n return isFirstOccurrence;\n });\n\n // Filter out unmounted Navigate components to prevent them from being rendered\n // and triggering unwanted redirects\n const renderableViewItems = uniqueViewItems.filter((viewItem) => {\n const elementComponent = viewItem.reactElement?.props?.element;\n const isNavigateComponent = isNavigateElement(elementComponent);\n\n // Exclude unmounted Navigate components from rendering\n if (isNavigateComponent && !viewItem.mount) {\n return false;\n }\n\n // Filter out views that are unmounted, have no ionPageElement, and don't match the current route.\n // These are \"stale\" views from previous routes that should not be rendered.\n // Views WITH ionPageElement are handled by the normal lifecycle events.\n // Views that MATCH the current route should be kept (they might be transitioning).\n if (!viewItem.mount && !viewItem.ionPageElement) {\n // Check if this view's route path matches the current pathname\n const viewRoutePath = viewItem.reactElement?.props?.path as string | undefined;\n if (viewRoutePath) {\n // First try exact match using matchComponent\n const routeMatch = matchComponent(viewItem.reactElement, routeInfo.pathname);\n if (routeMatch) {\n // View matches current route, keep it\n return true;\n }\n\n // For parent routes (like /multiple-tabs or /routing), check if current pathname\n // starts with this route's path. This handles views with IonSplitPane/IonTabs\n // that don't have IonPage but should remain mounted while navigating within their children.\n const normalizedViewPath = normalizePathnameForComparison(viewRoutePath.replace(/\\/?\\*$/, '')); // Remove trailing wildcard\n const normalizedCurrentPath = normalizePathnameForComparison(routeInfo.pathname);\n\n // Check if current pathname is within this view's route hierarchy\n const isWithinRouteHierarchy =\n normalizedCurrentPath === normalizedViewPath || normalizedCurrentPath.startsWith(normalizedViewPath + '/');\n\n if (!isWithinRouteHierarchy) {\n // View is outside current route hierarchy, remove it\n setTimeout(() => {\n this.remove(viewItem);\n }, 0);\n return false;\n }\n }\n }\n\n return true;\n });\n\n const renderedItems = renderableViewItems.map((viewItem) => this.renderViewItem(viewItem, routeInfo, parentPath));\n return renderedItems;\n };\n\n /**\n * Finds a view item matching the current route, optionally updating its match state.\n */\n findViewItemByRouteInfo = (routeInfo: RouteInfo, outletId?: string, updateMatch?: boolean) => {\n const { viewItem, match } = this.findViewItemByPath(routeInfo.pathname, outletId);\n const shouldUpdateMatch = updateMatch === undefined || updateMatch === true;\n if (shouldUpdateMatch && viewItem && match) {\n viewItem.routeData.match = match;\n }\n return viewItem;\n };\n\n /**\n * Finds the view item that was previously active before a route change.\n */\n findLeavingViewItemByRouteInfo = (routeInfo: RouteInfo, outletId?: string, mustBeIonRoute = true) => {\n // If the lastPathname is not set, we cannot find a leaving view item\n if (!routeInfo.lastPathname) {\n return undefined;\n }\n\n const { viewItem } = this.findViewItemByPath(routeInfo.lastPathname, outletId, mustBeIonRoute);\n return viewItem;\n };\n\n /**\n * Finds a view item by pathname only, used in simpler queries.\n */\n findViewItemByPathname = (pathname: string, outletId?: string) => {\n const { viewItem } = this.findViewItemByPath(pathname, outletId);\n return viewItem;\n };\n\n /**\n * Core function that matches a given pathname against all view items.\n * Returns both the matched view item and match metadata.\n */\n private findViewItemByPath(pathname: string, outletId?: string, mustBeIonRoute?: boolean, allowDefaultMatch = true) {\n let viewItem: ViewItem | undefined;\n let match: PathMatch<string> | null = null;\n let viewStack: ViewItem[];\n\n if (outletId) {\n viewStack = sortViewsBySpecificity(this.getViewItemsForOutlet(outletId));\n viewStack.some(matchView);\n if (!viewItem && allowDefaultMatch) viewStack.some(matchDefaultRoute);\n } else {\n const viewItems = sortViewsBySpecificity(this.getAllViewItems());\n viewItems.some(matchView);\n if (!viewItem && allowDefaultMatch) viewItems.some(matchDefaultRoute);\n }\n\n // If we still have not found a view item for this outlet, try to find a matching\n // view item across all outlets and adopt it into the current outlet. This helps\n // recover when an outlet remounts and receives a new id, leaving views associated\n // with the previous outlet id.\n // Do not adopt across outlets; if we didn't find a view for this outlet,\n // defer to route matching to create a new one.\n\n return { viewItem, match };\n\n /**\n * Matches a route path with dynamic parameters (e.g. /tabs/:id)\n */\n function matchView(v: ViewItem) {\n if (mustBeIonRoute && !v.ionRoute) return false;\n\n const viewItemPath = v.routeData.childProps.path || '';\n const isIndexRoute = !!v.routeData.childProps.index;\n const previousMatch = v.routeData?.match;\n const result = v.reactElement ? matchComponent(v.reactElement, pathname) : null;\n\n if (!result) {\n const indexMatch = resolveIndexRouteMatch(v, pathname, undefined);\n if (indexMatch) {\n match = indexMatch;\n viewItem = v;\n return true;\n }\n }\n\n if (result) {\n const hasParams = result.params && Object.keys(result.params).length > 0;\n const isSamePath = result.pathname === previousMatch?.pathname;\n const isWildcardRoute = viewItemPath.includes('*');\n const isParameterRoute = viewItemPath.includes(':');\n\n // Don't allow view items with undefined paths to match specific routes\n // This prevents broken index route view items from interfering with navigation\n if (!viewItemPath && !isIndexRoute && pathname !== '/' && pathname !== '') {\n return false;\n }\n\n // For parameterized routes, check if we should reuse the view item.\n // Wildcard routes (e.g., user/:userId/*) compare pathnameBase to allow\n // child path changes while preserving the parent view.\n if (isParameterRoute && !isSamePath) {\n if (isWildcardRoute) {\n const isSameBase = result.pathnameBase === previousMatch?.pathnameBase;\n if (isSameBase) {\n match = result;\n viewItem = v;\n return true;\n }\n }\n return false;\n }\n\n // For routes without params, or when navigating to the exact same path,\n // or when there's no previous match, reuse the view item\n if (!hasParams || isSamePath || !previousMatch) {\n match = result;\n viewItem = v;\n return true;\n }\n\n // For wildcard routes (without params), only reuse if the pathname exactly matches\n if (isWildcardRoute && isSamePath) {\n match = result;\n viewItem = v;\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Matches a view with no path prop (default fallback route) or index route.\n */\n function matchDefaultRoute(v: ViewItem): boolean {\n const childProps = v.routeData.childProps;\n\n const isDefaultRoute = childProps.path === undefined || childProps.path === '';\n const isIndexRoute = !!childProps.index;\n\n if (isIndexRoute) {\n const indexMatch = resolveIndexRouteMatch(v, pathname, undefined);\n if (indexMatch) {\n match = indexMatch;\n viewItem = v;\n return true;\n }\n return false;\n }\n\n if (isDefaultRoute) {\n match = {\n params: {},\n pathname,\n pathnameBase: pathname === '' ? '/' : pathname,\n pattern: {\n path: '',\n caseSensitive: childProps.caseSensitive ?? false,\n end: true,\n },\n };\n viewItem = v;\n return true;\n }\n\n return false;\n }\n }\n\n /**\n * Clean up old, unmounted view items to prevent memory leaks\n */\n private cleanupStaleViewItems = (outletId: string) => {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Keep only the most recent mounted views and a few unmounted ones for history\n const maxUnmountedItems = 3;\n const unmountedItems = viewItems.filter((v) => !v.mount);\n\n if (unmountedItems.length > maxUnmountedItems) {\n // Remove oldest unmounted items\n const itemsToRemove = unmountedItems.slice(0, unmountedItems.length - maxUnmountedItems);\n itemsToRemove.forEach((item) => {\n this.remove(item);\n });\n }\n };\n\n /**\n * Override add to prevent duplicate view items with the same ID in the same outlet\n * But allow multiple view items for the same route path (for navigation history)\n */\n add = (viewItem: ViewItem) => {\n const existingViewItem = this.getViewItemsForOutlet(viewItem.outletId).find((v) => v.id === viewItem.id);\n\n if (existingViewItem) {\n return;\n }\n\n super.add(viewItem);\n\n this.cleanupStaleViewItems(viewItem.outletId);\n };\n\n /**\n * Override remove\n */\n remove = (viewItem: ViewItem) => {\n super.remove(viewItem);\n };\n}\n\n/**\n * Utility to apply matchPath to a React element and return its match state.\n */\nfunction matchComponent(node: React.ReactElement, pathname: string, allowFallback = false) {\n const routeProps = node?.props ?? {};\n const routePath: string | undefined = routeProps.path;\n const pathnameToMatch = derivePathnameToMatch(pathname, routePath);\n\n const match = matchPath({\n pathname: pathnameToMatch,\n componentProps: routeProps,\n });\n\n if (match || !allowFallback) {\n return match;\n }\n\n const isIndexRoute = !!routeProps.index;\n\n if (isIndexRoute) {\n return createDefaultMatch(pathname, routeProps);\n }\n\n if (!routePath || routePath === '') {\n return createDefaultMatch(pathname, routeProps);\n }\n\n return null;\n}\n","export function clonePageElement(leavingViewHtml: string | HTMLElement) {\n let html: string;\n if (typeof leavingViewHtml === 'string') {\n html = leavingViewHtml;\n } else {\n html = leavingViewHtml.outerHTML;\n }\n if (document) {\n const newEl = document.createElement('div');\n newEl.innerHTML = html;\n newEl.style.zIndex = '';\n // Remove an existing back button so the new element doesn't get two of them\n const ionBackButton = newEl.getElementsByTagName('ion-back-button');\n if (ionBackButton[0]) {\n ionBackButton[0].remove();\n }\n return newEl.firstChild as HTMLElement;\n }\n return undefined;\n}\n","/**\n * `StackManager` is responsible for managing page transitions, keeping track\n * of views (pages), and ensuring that navigation behaves like native apps —\n * particularly with animations and swipe gestures.\n */\n\nimport type { RouteInfo, StackContextState, ViewItem } from '@ionic/react';\nimport { RouteManagerContext, StackContext, generateId, getConfig } from '@ionic/react';\nimport React from 'react';\nimport { Route } from 'react-router-dom';\n\nimport { clonePageElement } from './clonePageElement';\nimport { analyzeRouteChildren, computeCommonPrefix, computeParentPath } from './utils/computeParentPath';\nimport { derivePathnameToMatch, matchPath } from './utils/pathMatching';\nimport { stripTrailingSlash } from './utils/pathNormalization';\nimport { extractRouteChildren, getRoutesChildren, isNavigateElement } from './utils/routeElements';\n\n/**\n * Delay in milliseconds before unmounting a view after a transition completes.\n * This ensures the page transition animation finishes before the view is removed.\n */\nconst VIEW_UNMOUNT_DELAY_MS = 250;\n\n/**\n * Delay in milliseconds to wait for an IonPage element to be mounted before\n * proceeding with a page transition.\n */\nconst ION_PAGE_WAIT_TIMEOUT_MS = 50;\n\ninterface StackManagerProps {\n routeInfo: RouteInfo;\n id?: string;\n}\n\nconst isViewVisible = (el: HTMLElement) =>\n !el.classList.contains('ion-page-invisible') && !el.classList.contains('ion-page-hidden');\n\n/**\n * Hides an ion-page element by adding hidden class and aria attribute.\n */\nconst hideIonPageElement = (element: HTMLElement | undefined): void => {\n if (element) {\n element.classList.add('ion-page-hidden');\n element.setAttribute('aria-hidden', 'true');\n }\n};\n\n/**\n * Shows an ion-page element by removing hidden class and aria attribute.\n */\nconst showIonPageElement = (element: HTMLElement | undefined): void => {\n if (element) {\n element.classList.remove('ion-page-hidden');\n element.removeAttribute('aria-hidden');\n }\n};\n\nexport class StackManager extends React.PureComponent<StackManagerProps> {\n id: string; // Unique id for the router outlet aka outletId\n context!: React.ContextType<typeof RouteManagerContext>;\n ionRouterOutlet?: React.ReactElement;\n routerOutletElement: HTMLIonRouterOutletElement | undefined;\n prevProps?: StackManagerProps;\n skipTransition: boolean;\n\n stackContextValue: StackContextState = {\n registerIonPage: this.registerIonPage.bind(this),\n isInOutlet: () => true,\n };\n\n private clearOutletTimeout: any;\n private pendingPageTransition = false;\n private waitingForIonPage = false;\n private ionPageWaitTimeout?: ReturnType<typeof setTimeout>;\n private outOfScopeUnmountTimeout?: ReturnType<typeof setTimeout>;\n /**\n * Track the last transition's entering and leaving view IDs to prevent\n * duplicate transitions during rapid navigation (e.g., Navigate redirects)\n */\n private lastTransition?: { enteringId: string; leavingId?: string };\n\n constructor(props: StackManagerProps) {\n super(props);\n this.registerIonPage = this.registerIonPage.bind(this);\n this.transitionPage = this.transitionPage.bind(this);\n this.handlePageTransition = this.handlePageTransition.bind(this);\n this.id = props.id || `routerOutlet-${generateId('routerOutlet')}`;\n this.prevProps = undefined;\n this.skipTransition = false;\n }\n\n private outletMountPath: string | undefined = undefined;\n\n /**\n * Determines the parent path that was matched to reach this outlet.\n * This helps with nested routing in React Router 6.\n *\n * The algorithm finds the shortest parent path where a route matches the remaining path.\n * Priority: specific routes > wildcard routes > index routes (only at mount point)\n */\n private getParentPath(): string | undefined {\n const currentPathname = this.props.routeInfo.pathname;\n\n // If this outlet previously established a mount path and the current\n // pathname is outside of that scope, do not attempt to re-compute a new\n // parent path. This prevents out-of-scope outlets from \"adopting\"\n // unrelated routes (e.g., matching their index route under /overlays).\n if (this.outletMountPath && !currentPathname.startsWith(this.outletMountPath)) {\n return undefined;\n }\n\n // If this is a nested outlet (has an explicit ID like \"main\"),\n // we need to figure out what part of the path was already matched\n if (this.id !== 'routerOutlet' && this.ionRouterOutlet) {\n const routeChildren = extractRouteChildren(this.ionRouterOutlet.props.children);\n const { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } = analyzeRouteChildren(routeChildren);\n\n const result = computeParentPath({\n currentPathname,\n outletMountPath: this.outletMountPath,\n routeChildren,\n hasRelativeRoutes,\n hasIndexRoute,\n hasWildcardRoute,\n });\n\n // Update the outlet mount path if it was set\n if (result.outletMountPath && !this.outletMountPath) {\n this.outletMountPath = result.outletMountPath;\n }\n\n return result.parentPath;\n }\n return this.outletMountPath;\n }\n\n /**\n * Finds the entering and leaving view items for a route transition,\n * handling special redirect cases.\n */\n private findViewItems(routeInfo: RouteInfo): {\n enteringViewItem: ViewItem | undefined;\n leavingViewItem: ViewItem | undefined;\n } {\n const enteringViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n let leavingViewItem = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id);\n\n // If we don't have a leaving view item, but the route info indicates\n // that the user has routed from a previous path, then the leaving view\n // can be found by the last known pathname.\n if (!leavingViewItem && routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n }\n\n // Special case for redirects: When a redirect happens inside a nested route,\n // the entering and leaving view might be the same (the container route like tabs/*).\n // In this case, we need to look at prevRouteLastPathname to find the actual\n // view we're transitioning away from.\n if (\n enteringViewItem &&\n leavingViewItem &&\n enteringViewItem === leavingViewItem &&\n routeInfo.routeAction === 'replace' &&\n routeInfo.prevRouteLastPathname\n ) {\n const actualLeavingView = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n if (actualLeavingView && actualLeavingView !== enteringViewItem) {\n leavingViewItem = actualLeavingView;\n }\n }\n\n // Also check if we're in a redirect scenario where entering and leaving are different\n // but we still need to handle the actual previous view.\n if (\n enteringViewItem &&\n !leavingViewItem &&\n routeInfo.routeAction === 'replace' &&\n routeInfo.prevRouteLastPathname\n ) {\n const actualLeavingView = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n if (actualLeavingView && actualLeavingView !== enteringViewItem) {\n leavingViewItem = actualLeavingView;\n }\n }\n\n return { enteringViewItem, leavingViewItem };\n }\n\n /**\n * Determines if the leaving view item should be unmounted after a transition.\n */\n private shouldUnmountLeavingView(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n if (!leavingViewItem) {\n return false;\n }\n\n if (routeInfo.routeAction === 'replace') {\n return true;\n }\n\n const isForwardPush = routeInfo.routeAction === 'push' && (routeInfo as any).routeDirection === 'forward';\n if (!isForwardPush && routeInfo.routeDirection !== 'none' && enteringViewItem !== leavingViewItem) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles the case when the outlet is out of scope (current route is outside mount path).\n * Returns true if the transition should be aborted.\n */\n private handleOutOfScopeOutlet(routeInfo: RouteInfo): boolean {\n if (!this.outletMountPath || routeInfo.pathname.startsWith(this.outletMountPath)) {\n return false;\n }\n\n // Clear any pending unmount timeout to avoid conflicts\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n\n // When an outlet is out of scope, unmount its views immediately\n const allViewsInOutlet = this.context.getViewItemsForOutlet ? this.context.getViewItemsForOutlet(this.id) : [];\n\n // Unmount and remove all views in this outlet immediately to avoid leftover content\n allViewsInOutlet.forEach((viewItem) => {\n hideIonPageElement(viewItem.ionPageElement);\n this.context.unMountViewItem(viewItem);\n });\n\n this.forceUpdate();\n return true;\n }\n\n /**\n * Handles the case when this is a nested outlet with relative routes but no valid parent path.\n * Returns true if the transition should be aborted.\n */\n private handleOutOfContextNestedOutlet(\n parentPath: string | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n if (this.id === 'routerOutlet' || parentPath !== undefined || !this.ionRouterOutlet) {\n return false;\n }\n\n const routesChildren =\n getRoutesChildren(this.ionRouterOutlet.props.children) ?? this.ionRouterOutlet.props.children;\n const routeChildren = React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement => React.isValidElement(child) && child.type === Route\n );\n\n const hasRelativeRoutes = routeChildren.some((route) => {\n const path = route.props.path;\n return path && !path.startsWith('/') && path !== '*';\n });\n\n if (hasRelativeRoutes) {\n // Hide any visible views in this outlet since it's out of scope\n hideIonPageElement(leavingViewItem?.ionPageElement);\n if (leavingViewItem) {\n leavingViewItem.mount = false;\n }\n this.forceUpdate();\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles the case when a nested outlet has no matching route.\n * Returns true if the transition should be aborted.\n */\n private handleNoMatchingRoute(\n enteringRoute: React.ReactElement | undefined,\n enteringViewItem: ViewItem | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n if (this.id === 'routerOutlet' || enteringRoute || enteringViewItem) {\n return false;\n }\n\n // Hide any visible views in this outlet since it has no matching route\n hideIonPageElement(leavingViewItem?.ionPageElement);\n if (leavingViewItem) {\n leavingViewItem.mount = false;\n }\n this.forceUpdate();\n return true;\n }\n\n /**\n * Handles the transition when entering view item has an ion-page element ready.\n */\n private handleReadyEnteringView(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined,\n shouldUnmountLeavingViewItem: boolean\n ): void {\n // Ensure the entering view is not hidden from previous navigations\n showIonPageElement(enteringViewItem.ionPageElement);\n\n // Handle same view item case (e.g., parameterized route changes)\n if (enteringViewItem === leavingViewItem) {\n const routePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n const isParameterizedRoute = routePath ? routePath.includes(':') : false;\n\n if (isParameterizedRoute) {\n // Refresh match metadata so the component receives updated params\n const updatedMatch = matchComponent(enteringViewItem.reactElement, routeInfo.pathname, true);\n if (updatedMatch) {\n enteringViewItem.routeData.match = updatedMatch;\n }\n\n const enteringEl = enteringViewItem.ionPageElement;\n if (enteringEl) {\n enteringEl.classList.remove('ion-page-hidden', 'ion-page-invisible');\n enteringEl.removeAttribute('aria-hidden');\n }\n\n this.forceUpdate();\n return;\n }\n }\n\n // Try to find leaving view using prev route info if still not found\n if (!leavingViewItem && this.props.routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(this.props.routeInfo.prevRouteLastPathname, this.id);\n }\n\n // Skip transition if entering view is visible and leaving view is not\n if (\n enteringViewItem.ionPageElement &&\n isViewVisible(enteringViewItem.ionPageElement) &&\n leavingViewItem !== undefined &&\n leavingViewItem.ionPageElement &&\n !isViewVisible(leavingViewItem.ionPageElement)\n ) {\n return;\n }\n\n // Check for duplicate transition\n const currentTransition = {\n enteringId: enteringViewItem.id,\n leavingId: leavingViewItem?.id,\n };\n\n if (\n leavingViewItem &&\n this.lastTransition &&\n this.lastTransition.leavingId &&\n this.lastTransition.enteringId === currentTransition.enteringId &&\n this.lastTransition.leavingId === currentTransition.leavingId\n ) {\n return;\n }\n\n this.lastTransition = currentTransition;\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem);\n\n // Handle unmounting the leaving view\n if (shouldUnmountLeavingViewItem && leavingViewItem && enteringViewItem !== leavingViewItem) {\n leavingViewItem.mount = false;\n this.handleLeavingViewUnmount(routeInfo, enteringViewItem, leavingViewItem);\n }\n }\n\n /**\n * Handles the delayed unmount of the leaving view item after a replace action.\n */\n private handleLeavingViewUnmount(routeInfo: RouteInfo, enteringViewItem: ViewItem, leavingViewItem: ViewItem): void {\n if (routeInfo.routeAction !== 'replace' || !leavingViewItem.ionPageElement) {\n return;\n }\n\n // Check if we should skip removal for nested outlet redirects\n const enteringRoutePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n const leavingRoutePath = leavingViewItem.reactElement?.props?.path as string | undefined;\n const isEnteringContainerRoute = enteringRoutePath && enteringRoutePath.endsWith('/*');\n const isLeavingSpecificRoute =\n leavingRoutePath &&\n leavingRoutePath !== '' &&\n leavingRoutePath !== '*' &&\n !leavingRoutePath.endsWith('/*') &&\n !leavingViewItem.reactElement?.props?.index;\n\n // Skip removal only for container-to-container transitions\n if (isEnteringContainerRoute && !isLeavingSpecificRoute) {\n return;\n }\n\n const viewToUnmount = leavingViewItem;\n setTimeout(() => {\n this.context.unMountViewItem(viewToUnmount);\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n\n /**\n * Handles the case when entering view has no ion-page element yet (waiting for render).\n */\n private handleWaitingForIonPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined,\n shouldUnmountLeavingViewItem: boolean\n ): void {\n const enteringRouteElement = enteringViewItem.reactElement?.props?.element;\n\n // Handle Navigate components (they never render an IonPage)\n if (isNavigateElement(enteringRouteElement)) {\n this.waitingForIonPage = false;\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n this.pendingPageTransition = false;\n\n // Hide the leaving view immediately for Navigate redirects\n hideIonPageElement(leavingViewItem?.ionPageElement);\n\n // Don't unmount if entering and leaving are the same view item\n if (shouldUnmountLeavingViewItem && leavingViewItem && enteringViewItem !== leavingViewItem) {\n leavingViewItem.mount = false;\n }\n\n this.forceUpdate();\n return;\n }\n\n // Hide leaving view while we wait for the entering view's IonPage to mount\n hideIonPageElement(leavingViewItem?.ionPageElement);\n\n this.waitingForIonPage = true;\n\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n }\n\n this.ionPageWaitTimeout = setTimeout(() => {\n this.ionPageWaitTimeout = undefined;\n\n if (!this.waitingForIonPage) {\n return;\n }\n this.waitingForIonPage = false;\n\n const latestEnteringView = this.context.findViewItemByRouteInfo(routeInfo, this.id) ?? enteringViewItem;\n const latestLeavingView = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id) ?? leavingViewItem;\n\n if (latestEnteringView?.ionPageElement) {\n this.transitionPage(routeInfo, latestEnteringView, latestLeavingView ?? undefined);\n\n if (shouldUnmountLeavingViewItem && latestLeavingView && latestEnteringView !== latestLeavingView) {\n latestLeavingView.mount = false;\n }\n\n this.forceUpdate();\n }\n }, ION_PAGE_WAIT_TIMEOUT_MS);\n\n this.forceUpdate();\n }\n\n /**\n * Gets the route info to use for finding views during swipe-to-go-back gestures.\n * This pattern is used in multiple places in setupRouterOutlet.\n */\n private getSwipeBackRouteInfo(): RouteInfo {\n const { routeInfo } = this.props;\n return this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as RouteInfo);\n }\n\n componentDidMount() {\n if (this.clearOutletTimeout) {\n /**\n * The clearOutlet integration with React Router is a bit hacky.\n * It uses a timeout to clear the outlet after a transition.\n * In React v18, components are mounted and unmounted in development mode\n * to check for side effects.\n *\n * This clearTimeout prevents the outlet from being cleared when the component is re-mounted,\n * which should only happen in development mode and as a result of a hot reload.\n */\n clearTimeout(this.clearOutletTimeout);\n }\n if (this.routerOutletElement) {\n this.setupRouterOutlet(this.routerOutletElement);\n this.handlePageTransition(this.props.routeInfo);\n }\n }\n\n componentDidUpdate(prevProps: StackManagerProps) {\n const { pathname } = this.props.routeInfo;\n const { pathname: prevPathname } = prevProps.routeInfo;\n\n if (pathname !== prevPathname) {\n this.prevProps = prevProps;\n this.handlePageTransition(this.props.routeInfo);\n } else if (this.pendingPageTransition) {\n this.handlePageTransition(this.props.routeInfo);\n this.pendingPageTransition = false;\n }\n }\n\n componentWillUnmount() {\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n this.waitingForIonPage = false;\n\n // Hide all views in this outlet before clearing.\n // This is critical for nested outlets - when the parent component unmounts,\n // the nested outlet's componentDidUpdate won't be called, so we must hide\n // the ion-page elements here to prevent them from remaining visible on top\n // of other content after navigation to a different route.\n const allViewsInOutlet = this.context.getViewItemsForOutlet ? this.context.getViewItemsForOutlet(this.id) : [];\n allViewsInOutlet.forEach((viewItem) => {\n hideIonPageElement(viewItem.ionPageElement);\n });\n\n this.clearOutletTimeout = this.context.clearOutlet(this.id);\n }\n\n /**\n * Sets the transition between pages within this router outlet.\n * This function determines the entering and leaving views based on the\n * provided route information and triggers the appropriate animation.\n * It also handles scenarios like initial loads, back navigation, and\n * navigation to the same view with different parameters.\n *\n * @param routeInfo It contains info about the current route,\n * the previous route, and the action taken (e.g., push, replace).\n *\n * @returns A promise that resolves when the transition is complete.\n * If no transition is needed or if the router outlet isn't ready,\n * the Promise may resolve immediately.\n */\n async handlePageTransition(routeInfo: RouteInfo) {\n // Wait for router outlet to mount\n if (!this.routerOutletElement || !this.routerOutletElement.commit) {\n this.pendingPageTransition = true;\n return;\n }\n\n // Find entering and leaving view items\n const viewItems = this.findViewItems(routeInfo);\n let enteringViewItem = viewItems.enteringViewItem;\n const leavingViewItem = viewItems.leavingViewItem;\n const shouldUnmountLeavingViewItem = this.shouldUnmountLeavingView(routeInfo, enteringViewItem, leavingViewItem);\n\n // Get parent path for nested outlets\n const parentPath = this.getParentPath();\n\n // Handle out-of-scope outlet (route outside mount path)\n if (this.handleOutOfScopeOutlet(routeInfo)) {\n return;\n }\n\n // Clear any pending out-of-scope unmount timeout\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n\n // Handle nested outlet with relative routes but no valid parent path\n if (this.handleOutOfContextNestedOutlet(parentPath, leavingViewItem)) {\n return;\n }\n\n // Find the matching route element\n const enteringRoute = findRouteByRouteInfo(\n this.ionRouterOutlet?.props.children,\n routeInfo,\n parentPath\n ) as React.ReactElement;\n\n // Handle nested outlet with no matching route\n if (this.handleNoMatchingRoute(enteringRoute, enteringViewItem, leavingViewItem)) {\n return;\n }\n\n // Create or update the entering view item\n if (enteringViewItem && enteringRoute) {\n enteringViewItem.reactElement = enteringRoute;\n } else if (enteringRoute) {\n enteringViewItem = this.context.createViewItem(this.id, enteringRoute, routeInfo);\n this.context.addViewItem(enteringViewItem);\n }\n\n // Handle transition based on ion-page element availability\n if (enteringViewItem && enteringViewItem.ionPageElement) {\n // Clear waiting state\n if (this.waitingForIonPage) {\n this.waitingForIonPage = false;\n }\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n\n this.handleReadyEnteringView(routeInfo, enteringViewItem, leavingViewItem, shouldUnmountLeavingViewItem);\n } else if (enteringViewItem && !enteringViewItem.ionPageElement) {\n // Wait for ion-page to mount\n this.handleWaitingForIonPage(routeInfo, enteringViewItem, leavingViewItem, shouldUnmountLeavingViewItem);\n return;\n } else if (!enteringViewItem && !enteringRoute) {\n // No view or route found - likely leaving to another outlet\n if (leavingViewItem) {\n hideIonPageElement(leavingViewItem.ionPageElement);\n if (shouldUnmountLeavingViewItem) {\n leavingViewItem.mount = false;\n }\n }\n }\n\n this.forceUpdate();\n }\n\n /**\n * Registers an `<IonPage>` DOM element with the `StackManager`.\n * This is called when `<IonPage>` has been mounted.\n *\n * @param page The element of the rendered `<IonPage>`.\n * @param routeInfo The route information that associates with `<IonPage>`.\n */\n registerIonPage(page: HTMLElement, routeInfo: RouteInfo) {\n this.waitingForIonPage = false;\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n this.pendingPageTransition = false;\n const foundView = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n if (foundView) {\n const oldPageElement = foundView.ionPageElement;\n foundView.ionPageElement = page;\n foundView.ionRoute = true;\n\n /**\n * React 18 will unmount and remount IonPage\n * elements in development mode when using createRoot.\n * This can cause duplicate page transitions to occur.\n */\n if (oldPageElement === page) {\n return;\n }\n }\n this.handlePageTransition(routeInfo);\n }\n\n /**\n * Configures the router outlet for the swipe-to-go-back gesture.\n *\n * @param routerOutlet The Ionic router outlet component: `<IonRouterOutlet>`.\n */\n async setupRouterOutlet(routerOutlet: HTMLIonRouterOutletElement) {\n const canStart = () => {\n const config = getConfig();\n // Check if swipe back is enabled in config (default to true for iOS mode)\n const swipeEnabled = config && config.get('swipeBackEnabled', routerOutlet.mode === 'ios');\n if (!swipeEnabled) {\n return false;\n }\n\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n const enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n\n const canStartSwipe =\n !!enteringViewItem &&\n // The root url '/' is treated as the first view item (but is never mounted),\n // so we do not want to swipe back to the root url.\n enteringViewItem.mount &&\n // When on the first page it is possible for findViewItemByRouteInfo to\n // return the exact same view you are currently on.\n // Make sure that we are not swiping back to the same instances of a view.\n enteringViewItem.routeData.match.pattern.path !== routeInfo.pathname;\n\n return canStartSwipe;\n };\n\n const onStart = async () => {\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n const enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n // When the gesture starts, kick off a transition controlled via swipe gesture\n if (enteringViewItem && leavingViewItem) {\n await this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back', true);\n }\n\n return Promise.resolve();\n };\n\n const onEnd = (shouldContinue: boolean) => {\n if (shouldContinue) {\n // User finished the swipe gesture, so complete the back navigation\n this.skipTransition = true;\n this.context.goBack();\n } else {\n // Swipe gesture was aborted - re-hide the page that was going to enter\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n const enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n // Don't hide if entering and leaving are the same (parameterized route edge case)\n if (enteringViewItem !== leavingViewItem && enteringViewItem?.ionPageElement !== undefined) {\n hideIonPageElement(enteringViewItem.ionPageElement);\n }\n }\n };\n\n routerOutlet.swipeHandler = {\n canStart,\n onStart,\n onEnd,\n };\n }\n\n /**\n * Animates the transition between the entering and leaving pages within the\n * router outlet.\n *\n * @param routeInfo Info about the current route.\n * @param enteringViewItem The view item that is entering.\n * @param leavingViewItem The view item that is leaving.\n * @param direction The direction of the transition.\n * @param progressAnimation Indicates if the transition is part of a\n * gesture controlled animation (e.g., swipe to go back).\n * Defaults to `false`.\n */\n async transitionPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem?: ViewItem,\n direction?: 'forward' | 'back',\n progressAnimation = false\n ) {\n const runCommit = async (enteringEl: HTMLElement, leavingEl?: HTMLElement) => {\n const skipTransition = this.skipTransition;\n\n /**\n * If the transition was handled\n * via the swipe to go back gesture,\n * then we do not want to perform\n * another transition.\n *\n * We skip adding ion-page or ion-page-invisible\n * because the entering view already exists in the DOM.\n * If we added the classes, there would be a flicker where\n * the view would be briefly hidden.\n */\n if (skipTransition) {\n /**\n * We need to reset skipTransition before\n * we call routerOutlet.commit otherwise\n * the transition triggered by the swipe\n * to go back gesture would reset it. In\n * that case you would see a duplicate\n * transition triggered by handlePageTransition\n * in componentDidUpdate.\n */\n this.skipTransition = false;\n } else {\n enteringEl.classList.add('ion-page');\n enteringEl.classList.add('ion-page-invisible');\n }\n\n await routerOutlet.commit(enteringEl, leavingEl, {\n duration: skipTransition || directionToUse === undefined ? 0 : undefined,\n direction: directionToUse,\n showGoBack: !!routeInfo.pushedByRoute,\n progressAnimation,\n animationBuilder: routeInfo.routeAnimation,\n });\n };\n\n const routerOutlet = this.routerOutletElement!;\n\n const routeInfoFallbackDirection =\n routeInfo.routeDirection === 'none' || routeInfo.routeDirection === 'root' ? undefined : routeInfo.routeDirection;\n const directionToUse = direction ?? routeInfoFallbackDirection;\n\n if (enteringViewItem && enteringViewItem.ionPageElement && this.routerOutletElement) {\n if (leavingViewItem && leavingViewItem.ionPageElement && enteringViewItem === leavingViewItem) {\n // If a page is transitioning to another version of itself\n // we clone it so we can have an animation to show\n // (e.g., `/user/1` → `/user/2`)\n const match = matchComponent(leavingViewItem.reactElement, routeInfo.pathname);\n if (match) {\n const newLeavingElement = clonePageElement(leavingViewItem.ionPageElement.outerHTML);\n if (newLeavingElement) {\n this.routerOutletElement.appendChild(newLeavingElement);\n await runCommit(enteringViewItem.ionPageElement, newLeavingElement);\n this.routerOutletElement.removeChild(newLeavingElement);\n }\n } else {\n /**\n * The route no longer matches the component type of the leaving view.\n * (e.g., `/user/1` → `/settings`)\n *\n * This can also occur in edge cases like rapid navigation\n * or during parent component re-renders that briefly cause\n * the view items to be the same instance before the final\n * route component is determined.\n */\n await runCommit(enteringViewItem.ionPageElement, undefined);\n }\n } else {\n await runCommit(enteringViewItem.ionPageElement, leavingViewItem?.ionPageElement);\n if (leavingViewItem && leavingViewItem.ionPageElement && !progressAnimation) {\n leavingViewItem.ionPageElement.classList.add('ion-page-hidden');\n leavingViewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n\n render() {\n const { children } = this.props;\n const ionRouterOutlet = React.Children.only(children) as React.ReactElement;\n // Store reference for use in getParentPath() and handlePageTransition()\n this.ionRouterOutlet = ionRouterOutlet;\n\n const components = this.context.getChildrenToRender(this.id, this.ionRouterOutlet, this.props.routeInfo, () => {\n // Callback triggers re-render when view items are modified during getChildrenToRender\n this.forceUpdate();\n });\n\n return (\n <StackContext.Provider value={this.stackContextValue}>\n {React.cloneElement(\n ionRouterOutlet as any,\n {\n ref: (node: HTMLIonRouterOutletElement) => {\n if (ionRouterOutlet.props.setRef) {\n // Needed to handle external refs from devs.\n ionRouterOutlet.props.setRef(node);\n }\n if (ionRouterOutlet.props.forwardedRef) {\n // Needed to handle external refs from devs.\n ionRouterOutlet.props.forwardedRef.current = node;\n }\n this.routerOutletElement = node;\n const { ref } = ionRouterOutlet as any;\n // Check for legacy refs.\n if (typeof ref === 'function') {\n ref(node);\n }\n },\n },\n components\n )}\n </StackContext.Provider>\n );\n }\n\n static get contextType() {\n return RouteManagerContext;\n }\n}\n\nexport default StackManager;\n\n/**\n * Finds the `<Route />` node matching the current route info.\n * If no `<Route />` can be matched, a fallback node is returned.\n * Routes are prioritized by specificity (most specific first).\n *\n * @param node The root node to search for `<Route />` nodes.\n * @param routeInfo The route information to match against.\n * @param parentPath The parent path that was matched by the parent outlet (for nested routing)\n */\nfunction findRouteByRouteInfo(node: React.ReactNode, routeInfo: RouteInfo, parentPath?: string) {\n let matchedNode: React.ReactNode;\n let fallbackNode: React.ReactNode;\n\n // `<Route />` nodes are rendered inside of a <Routes /> node\n const routesChildren = getRoutesChildren(node) ?? node;\n\n // Collect all route children\n const routeChildren = React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement => React.isValidElement(child) && child.type === Route\n );\n\n // Sort routes by specificity (most specific first)\n const sortedRoutes = routeChildren.sort((a, b) => {\n const pathA = a.props.path || '';\n const pathB = b.props.path || '';\n\n // Index routes come first\n if (a.props.index && !b.props.index) return -1;\n if (!a.props.index && b.props.index) return 1;\n\n // Wildcard-only routes (*) should come LAST\n const aIsWildcardOnly = pathA === '*';\n const bIsWildcardOnly = pathB === '*';\n\n if (!aIsWildcardOnly && bIsWildcardOnly) return -1;\n if (aIsWildcardOnly && !bIsWildcardOnly) return 1;\n\n // Exact matches (no wildcards/params) come before wildcard/param routes\n const aHasWildcard = pathA.includes('*') || pathA.includes(':');\n const bHasWildcard = pathB.includes('*') || pathB.includes(':');\n\n if (!aHasWildcard && bHasWildcard) return -1;\n if (aHasWildcard && !bHasWildcard) return 1;\n\n // Among routes with same wildcard status, longer paths are more specific\n if (pathA.length !== pathB.length) {\n return pathB.length - pathA.length;\n }\n\n return 0;\n });\n\n // For nested routes in React Router 6, we need to extract the relative path\n // that this outlet should be responsible for matching\n let pathnameToMatch = routeInfo.pathname;\n\n // Check if we have relative routes (routes that don't start with '/')\n const hasRelativeRoutes = sortedRoutes.some((r) => r.props.path && !r.props.path.startsWith('/'));\n const hasIndexRoute = sortedRoutes.some((r) => r.props.index);\n\n // SIMPLIFIED: Trust React Router 6's matching more, compute relative path when parent is known\n if ((hasRelativeRoutes || hasIndexRoute) && parentPath) {\n const parentPrefix = parentPath.replace('/*', '');\n const normalizedParent = stripTrailingSlash(parentPrefix);\n const normalizedPathname = stripTrailingSlash(routeInfo.pathname);\n\n // Only compute relative path if pathname is within parent scope\n if (normalizedPathname.startsWith(normalizedParent + '/') || normalizedPathname === normalizedParent) {\n const pathSegments = routeInfo.pathname.split('/').filter(Boolean);\n const parentSegments = normalizedParent.split('/').filter(Boolean);\n const relativeSegments = pathSegments.slice(parentSegments.length);\n pathnameToMatch = relativeSegments.join('/'); // Empty string is valid for index routes\n }\n }\n\n // Find the first matching route\n for (const child of sortedRoutes) {\n const match = matchPath({\n pathname: pathnameToMatch,\n componentProps: child.props,\n });\n\n if (match) {\n matchedNode = child;\n break;\n }\n }\n\n if (matchedNode) {\n return matchedNode;\n }\n\n // If we haven't found a node, try to find one that doesn't have a path prop (fallback route)\n // BUT only return the fallback if the current pathname is within the outlet's scope.\n // For outlets with absolute paths, compute the common prefix to determine scope.\n const absolutePathRoutes = routeChildren.filter((r) => r.props.path && r.props.path.startsWith('/'));\n\n // Determine if pathname is within scope before returning fallback\n let isPathnameInScope = true;\n\n if (absolutePathRoutes.length > 0) {\n // Find common prefix of all absolute paths to determine outlet scope\n const absolutePaths = absolutePathRoutes.map((r) => r.props.path as string);\n const commonPrefix = computeCommonPrefix(absolutePaths);\n\n // If we have a common prefix, check if the current pathname is within that scope\n if (commonPrefix && commonPrefix !== '/') {\n isPathnameInScope = routeInfo.pathname.startsWith(commonPrefix);\n }\n }\n\n // Only look for fallback route if pathname is within scope\n if (isPathnameInScope) {\n for (const child of routeChildren) {\n if (!child.props.path) {\n fallbackNode = child;\n break;\n }\n }\n }\n\n return matchedNode ?? fallbackNode;\n}\n\nfunction matchComponent(node: React.ReactElement, pathname: string, forceExact?: boolean) {\n const routePath: string | undefined = node?.props?.path;\n const pathnameToMatch = derivePathnameToMatch(pathname, routePath);\n\n return matchPath({\n pathname: pathnameToMatch,\n componentProps: {\n ...node.props,\n end: forceExact,\n },\n });\n}\n","/**\n * `IonRouter` is responsible for managing the application's navigation\n * state, tracking the history of visited routes, and coordinating\n * transitions between different views. It intercepts route changes from\n * React Router and translates them into actions that Ionic can understand\n * and animate.\n */\n\nimport type {\n AnimationBuilder,\n RouteAction,\n RouteInfo,\n RouteManagerContextState,\n RouterDirection,\n RouterOptions,\n} from '@ionic/react';\nimport { LocationHistory, NavManager, RouteManagerContext, generateId, getConfig } from '@ionic/react';\nimport type { Action as HistoryAction, Location } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nimport { IonRouteInner } from './IonRouteInner';\nimport { ReactRouterViewStack } from './ReactRouterViewStack';\nimport StackManager from './StackManager';\n\n// Use Location directly - state is typed as `unknown` in history v5\ntype HistoryLocation = Location;\n\nexport interface LocationState {\n direction?: RouterDirection;\n routerOptions?: RouterOptions;\n}\n\ninterface IonRouterProps {\n registerHistoryListener: (cb: (location: HistoryLocation, action: HistoryAction) => void) => void;\n}\n\ntype RouteParams = Record<string, string | string[] | undefined>;\ntype SafeRouteParams = Record<string, string | string[]>;\n\nconst filterUndefinedParams = (params: RouteParams): SafeRouteParams => {\n const result: SafeRouteParams = {};\n for (const key of Object.keys(params)) {\n const value = params[key];\n if (value !== undefined) {\n result[key] = value;\n }\n }\n return result;\n};\n\nconst areParamsEqual = (a?: RouteParams, b?: RouteParams) => {\n const paramsA = a || {};\n const paramsB = b || {};\n const keysA = Object.keys(paramsA);\n const keysB = Object.keys(paramsB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n return keysA.every((key) => {\n const valueA = paramsA[key];\n const valueB = paramsB[key];\n if (Array.isArray(valueA) && Array.isArray(valueB)) {\n if (valueA.length !== valueB.length) {\n return false;\n }\n return valueA.every((entry, idx) => entry === valueB[idx]);\n }\n return valueA === valueB;\n });\n};\n\nexport const IonRouter = ({ children, registerHistoryListener }: PropsWithChildren<IonRouterProps>) => {\n const location = useLocation();\n const navigate = useNavigate();\n\n const didMountRef = useRef(false);\n const locationHistory = useRef(new LocationHistory());\n const currentTab = useRef<string | undefined>(undefined);\n const viewStack = useRef(new ReactRouterViewStack());\n const incomingRouteParams = useRef<Partial<RouteInfo> | null>(null);\n\n const [routeInfo, setRouteInfo] = useState<RouteInfo>({\n id: generateId('routeInfo'),\n pathname: location.pathname,\n search: location.search,\n params: {},\n });\n\n useEffect(() => {\n if (didMountRef.current) {\n return;\n }\n\n // Seed the history stack with the initial location and begin listening\n // for future navigations once React has committed the mount. This avoids\n // duplicate entries when React StrictMode runs an extra render pre-commit.\n locationHistory.current.add(routeInfo);\n registerHistoryListener(handleHistoryChange);\n\n didMountRef.current = true;\n }, []);\n\n useEffect(() => {\n const activeView = viewStack.current.findViewItemByRouteInfo(routeInfo, undefined, true);\n const matchedParams = activeView?.routeData.match?.params as RouteParams | undefined;\n\n if (matchedParams) {\n const paramsCopy = filterUndefinedParams({ ...matchedParams });\n if (areParamsEqual(routeInfo.params as RouteParams | undefined, paramsCopy)) {\n return;\n }\n\n const updatedRouteInfo: RouteInfo = {\n ...routeInfo,\n params: paramsCopy,\n };\n locationHistory.current.update(updatedRouteInfo);\n setRouteInfo(updatedRouteInfo);\n }\n }, [routeInfo]);\n\n /**\n * Triggered whenever the history changes, either through user navigation\n * or programmatic changes. It transforms the raw browser history changes\n * into `RouteInfo` objects, which are needed Ionic's animations and\n * navigation patterns.\n *\n * @param location The current location object from the history.\n * @param action The action that triggered the history change.\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n let leavingLocationInfo: RouteInfo;\n /**\n * A programmatic navigation was triggered.\n * e.g., `<Redirect />`, `history.push()`, or `handleNavigate()`\n */\n if (incomingRouteParams.current) {\n /**\n * The current history entry is overwritten, so the previous entry\n * is the one we are leaving.\n */\n if (incomingRouteParams.current?.routeAction === 'replace') {\n leavingLocationInfo = locationHistory.current.previous();\n } else {\n // If the action is 'push' or 'pop', we want to use the current route.\n leavingLocationInfo = locationHistory.current.current();\n }\n } else {\n /**\n * An external navigation was triggered\n * e.g., browser back/forward button or direct link\n *\n * The leaving location is the current route.\n */\n leavingLocationInfo = locationHistory.current.current();\n }\n\n const leavingUrl = leavingLocationInfo.pathname + leavingLocationInfo.search;\n if (leavingUrl !== location.pathname) {\n if (!incomingRouteParams.current) {\n // Determine if the destination is a tab route by checking if it matches\n // the pattern of tab routes (containing /tabs/ in the path)\n const isTabRoute = /\\/tabs(\\/|$)/.test(location.pathname);\n const tabToUse = isTabRoute ? currentTab.current : undefined;\n\n // If we're leaving tabs entirely, clear the current tab\n if (!isTabRoute && currentTab.current) {\n currentTab.current = undefined;\n }\n\n /**\n * A `REPLACE` action can be triggered by React Router's\n * `<Redirect />` component.\n */\n if (action === 'REPLACE') {\n incomingRouteParams.current = {\n routeAction: 'replace',\n routeDirection: 'none',\n tab: tabToUse,\n };\n }\n /**\n * A `POP` action can be triggered by the browser's back/forward\n * button.\n */\n if (action === 'POP') {\n const currentRoute = locationHistory.current.current();\n /**\n * Check if the current route was \"pushed\" by a previous route\n * (indicates a linear history path).\n */\n if (currentRoute && currentRoute.pushedByRoute) {\n const prevInfo = locationHistory.current.findLastLocation(currentRoute);\n incomingRouteParams.current = { ...prevInfo, routeAction: 'pop', routeDirection: 'back' };\n // It's a non-linear history path like a direct link.\n } else {\n incomingRouteParams.current = {\n routeAction: 'pop',\n routeDirection: 'none',\n tab: tabToUse,\n };\n }\n }\n if (!incomingRouteParams.current) {\n const state = location.state as LocationState | null;\n incomingRouteParams.current = {\n routeAction: 'push',\n routeDirection: state?.direction || 'forward',\n routeOptions: state?.routerOptions,\n tab: tabToUse,\n };\n }\n }\n\n let routeInfo: RouteInfo;\n\n // If we're navigating away from tabs to a non-tab route, clear the current tab\n if (!/\\/tabs(\\/|$)/.test(location.pathname) && currentTab.current) {\n currentTab.current = undefined;\n }\n\n /**\n * An existing id indicates that it's re-activating an existing route.\n * e.g., tab switching or navigating back to a previous route\n */\n if (incomingRouteParams.current?.id) {\n routeInfo = {\n ...(incomingRouteParams.current as RouteInfo),\n lastPathname: leavingLocationInfo.pathname,\n };\n locationHistory.current.add(routeInfo);\n /**\n * A new route is being created since it's not re-activating\n * an existing route.\n */\n } else {\n const isPushed =\n incomingRouteParams.current?.routeAction === 'push' &&\n incomingRouteParams.current.routeDirection === 'forward';\n routeInfo = {\n id: generateId('routeInfo'),\n ...incomingRouteParams.current,\n lastPathname: leavingLocationInfo.pathname, // The URL we just came from\n pathname: location.pathname, // The current (destination) URL\n search: location.search,\n params: incomingRouteParams.current?.params\n ? filterUndefinedParams(incomingRouteParams.current.params as RouteParams)\n : {},\n prevRouteLastPathname: leavingLocationInfo.lastPathname,\n };\n if (isPushed) {\n // Only inherit tab from leaving route if we don't already have one.\n // This preserves tab context for same-tab navigation while allowing cross-tab navigation.\n routeInfo.tab = routeInfo.tab || leavingLocationInfo.tab;\n routeInfo.pushedByRoute = leavingLocationInfo.pathname;\n // Triggered by a browser back button or handleNavigateBack.\n } else if (routeInfo.routeAction === 'pop') {\n // Find the route that pushed this one.\n const r = locationHistory.current.findLastLocation(routeInfo);\n routeInfo.pushedByRoute = r?.pushedByRoute;\n // Navigating to a new tab.\n } else if (routeInfo.routeAction === 'push' && routeInfo.tab !== leavingLocationInfo.tab) {\n /**\n * If we are switching tabs grab the last route info for the\n * tab and use its `pushedByRoute`.\n */\n const lastRoute = locationHistory.current.getCurrentRouteInfoForTab(routeInfo.tab);\n /**\n * Tab bar switches (direction 'none') should not create cross-tab back\n * navigation. Only inherit pushedByRoute from the tab's own history.\n */\n if (routeInfo.routeDirection === 'none') {\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute;\n } else {\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute ?? leavingLocationInfo.pathname;\n }\n // Triggered by `history.replace()` or a `<Redirect />` component, etc.\n } else if (routeInfo.routeAction === 'replace') {\n /**\n * Make sure to set the `lastPathname`, etc.. to the current route\n * so the page transitions out.\n */\n const currentRouteInfo = locationHistory.current.current();\n\n /**\n * Special handling for `replace` to ensure correct `pushedByRoute`\n * and `lastPathname`.\n *\n * If going from `/home` to `/child`, then replacing from\n * `/child` to `/home`, we don't want the route info to\n * say that `/home` was pushed by `/home` which is not correct.\n */\n const currentPushedBy = currentRouteInfo?.pushedByRoute;\n const pushedByRoute =\n currentPushedBy !== undefined && currentPushedBy !== routeInfo.pathname\n ? currentPushedBy\n : routeInfo.pushedByRoute;\n\n routeInfo.lastPathname = currentRouteInfo?.pathname || routeInfo.lastPathname;\n routeInfo.prevRouteLastPathname = currentRouteInfo?.lastPathname;\n routeInfo.pushedByRoute = pushedByRoute;\n\n /**\n * When replacing routes we should still prefer\n * any custom direction/animation that the developer\n * has specified when navigating first instead of relying\n * on previously used directions/animations.\n */\n routeInfo.routeDirection = routeInfo.routeDirection || currentRouteInfo?.routeDirection;\n routeInfo.routeAnimation = routeInfo.routeAnimation || currentRouteInfo?.routeAnimation;\n }\n\n locationHistory.current.add(routeInfo);\n }\n setRouteInfo(routeInfo);\n }\n\n incomingRouteParams.current = null;\n };\n\n /**\n * Resets the specified tab to its initial, root route.\n *\n * @param tab The tab to reset.\n * @param originalHref The original href for the tab.\n * @param originalRouteOptions The original route options for the tab.\n */\n const handleResetTab = (tab: string, originalHref: string, originalRouteOptions: any) => {\n const routeInfo = locationHistory.current.getFirstRouteInfoForTab(tab);\n if (routeInfo) {\n const newRouteInfo = { ...routeInfo };\n newRouteInfo.pathname = originalHref;\n newRouteInfo.routeOptions = originalRouteOptions;\n incomingRouteParams.current = { ...newRouteInfo, routeAction: 'pop', routeDirection: 'back' };\n navigate(newRouteInfo.pathname + (newRouteInfo.search || ''));\n }\n };\n\n /**\n * Handles tab changes.\n *\n * @param tab The tab to switch to.\n * @param path The new path for the tab.\n * @param routeOptions Additional route options.\n */\n const handleChangeTab = (tab: string, path?: string, routeOptions?: any) => {\n if (!path) {\n return;\n }\n\n const routeInfo = locationHistory.current.getCurrentRouteInfoForTab(tab);\n const [pathname, search] = path.split('?');\n // User has navigated to the current tab before.\n if (routeInfo) {\n const routeParams = {\n ...routeInfo,\n routeAction: 'push' as RouteAction,\n routeDirection: 'none' as RouterDirection,\n };\n /**\n * User is navigating to the same tab.\n * e.g., `/tabs/home` → `/tabs/home`\n */\n if (routeInfo.pathname === pathname) {\n incomingRouteParams.current = {\n ...routeParams,\n routeOptions,\n };\n\n navigate(routeInfo.pathname + (routeInfo.search || ''));\n /**\n * User is navigating to a different tab.\n * e.g., `/tabs/home` → `/tabs/settings`\n */\n } else {\n incomingRouteParams.current = {\n ...routeParams,\n pathname,\n search: search ? '?' + search : undefined,\n routeOptions,\n };\n\n navigate(pathname + (search ? '?' + search : ''));\n }\n // User has not navigated to this tab before.\n } else {\n handleNavigate(pathname, 'push', 'none', undefined, routeOptions, tab);\n }\n };\n\n /**\n * Set the current active tab in `locationHistory`.\n * This is crucial for maintaining tab history since each tab has\n * its own navigation stack.\n *\n * @param tab The tab to set as active.\n */\n const handleSetCurrentTab = (tab: string) => {\n currentTab.current = tab;\n const ri = { ...locationHistory.current.current() };\n if (ri.tab !== tab) {\n ri.tab = tab;\n locationHistory.current.update(ri);\n }\n };\n\n /**\n * Handles the native back button press.\n * It's usually called when a user presses the platform-native back action.\n */\n const handleNativeBack = () => {\n navigate(-1);\n };\n\n /**\n * Used to manage the back navigation within the Ionic React's routing\n * system. It's deeply integrated with Ionic's view lifecycle, animations,\n * and its custom history tracking (`locationHistory`) to provide a\n * native-like transition and maintain correct application state.\n *\n * @param defaultHref The fallback URL to navigate to if there's no\n * previous entry in the `locationHistory` stack.\n * @param routeAnimation A custom animation builder to override the\n * default \"back\" animation.\n */\n const handleNavigateBack = (defaultHref: string | RouteInfo = '/', routeAnimation?: AnimationBuilder) => {\n const config = getConfig();\n defaultHref = defaultHref ? defaultHref : config && config.get('backButtonDefaultHref' as any);\n const routeInfo = locationHistory.current.current();\n // It's a linear navigation.\n if (routeInfo && routeInfo.pushedByRoute) {\n const prevInfo = locationHistory.current.findLastLocation(routeInfo);\n if (prevInfo) {\n /**\n * This needs to be passed to handleNavigate\n * otherwise incomingRouteParams.routeAnimation\n * will be overridden.\n */\n const incomingAnimation = routeAnimation || routeInfo.routeAnimation;\n incomingRouteParams.current = {\n ...prevInfo,\n routeAction: 'pop',\n routeDirection: 'back',\n routeAnimation: incomingAnimation,\n };\n /**\n * Check if it's a simple linear back navigation (not tabbed).\n * e.g., `/home` → `/settings` → back to `/home`\n */\n const condition1 = routeInfo.lastPathname === routeInfo.pushedByRoute;\n const condition2 = prevInfo.pathname === routeInfo.pushedByRoute && routeInfo.tab === '' && prevInfo.tab === '';\n if (condition1 || condition2) {\n navigate(-1);\n } else {\n /**\n * It's a non-linear back navigation.\n * e.g., direct link or tab switch or nested navigation with redirects\n */\n handleNavigate(prevInfo.pathname + (prevInfo.search || ''), 'pop', 'back', incomingAnimation);\n }\n /**\n * `pushedByRoute` exists, but no corresponding previous entry in\n * the history stack.\n */\n } else {\n handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n /**\n * No `pushedByRoute` (e.g., initial page load or tab root).\n * Tabs with no back history should not navigate.\n */\n } else {\n if (routeInfo && routeInfo.tab) {\n return;\n }\n handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n };\n\n /**\n * Used to programmatically navigate through the app.\n *\n * @param path The path to navigate to.\n * @param routeAction The action to take (push, replace, etc.).\n * @param routeDirection The direction of the navigation (forward,\n * back, etc.).\n * @param routeAnimation The animation to use for the transition.\n * @param routeOptions Additional options for the route.\n * @param tab The tab to navigate to, if applicable.\n */\n const handleNavigate = (\n path: string,\n routeAction: RouteAction,\n routeDirection?: RouterDirection,\n routeAnimation?: AnimationBuilder,\n routeOptions?: any,\n tab?: string\n ) => {\n const normalizedRouteDirection =\n routeAction === 'push' && routeDirection === undefined ? 'forward' : routeDirection;\n\n // When navigating from tabs context, we need to determine if the destination\n // is also within tabs. If not, we should clear the tab context.\n let navigationTab = tab;\n\n // If no explicit tab is provided and we're in a tab context,\n // check if the destination path is outside of the current tab context\n if (!tab && currentTab.current && path) {\n // Get the current route info to understand where we are\n const currentRoute = locationHistory.current.current();\n\n // If we're navigating from a tab route to a completely different path structure,\n // we should clear the tab context. This is a simplified check that assumes\n // tab routes share a common parent path.\n if (currentRoute && currentRoute.pathname) {\n // Extract the base tab path (e.g., /routing/tabs from /routing/tabs/home)\n const tabBaseMatch = currentRoute.pathname.match(/^(.*\\/tabs)/);\n if (tabBaseMatch) {\n const tabBasePath = tabBaseMatch[1];\n // If the new path doesn't start with the tab base path, we're leaving tabs\n if (!path.startsWith(tabBasePath)) {\n currentTab.current = undefined;\n navigationTab = undefined;\n } else {\n // Still within tabs, preserve the tab context\n navigationTab = currentTab.current;\n }\n }\n }\n }\n\n const baseParams = incomingRouteParams.current ?? {};\n incomingRouteParams.current = {\n ...baseParams,\n routeAction,\n routeDirection: normalizedRouteDirection,\n routeOptions,\n routeAnimation,\n tab: navigationTab,\n };\n\n navigate(path, { replace: routeAction !== 'push' });\n };\n\n const routeMangerContextValue: RouteManagerContextState = {\n canGoBack: () => locationHistory.current.canGoBack(),\n clearOutlet: viewStack.current.clear,\n findViewItemByPathname: viewStack.current.findViewItemByPathname,\n getChildrenToRender: viewStack.current.getChildrenToRender,\n getViewItemsForOutlet: viewStack.current.getViewItemsForOutlet.bind(viewStack.current),\n goBack: () => handleNavigateBack(),\n createViewItem: viewStack.current.createViewItem,\n findViewItemByRouteInfo: viewStack.current.findViewItemByRouteInfo,\n findLeavingViewItemByRouteInfo: viewStack.current.findLeavingViewItemByRouteInfo,\n addViewItem: viewStack.current.add,\n unMountViewItem: viewStack.current.remove,\n };\n\n return (\n <RouteManagerContext.Provider value={routeMangerContextValue}>\n <NavManager\n ionRoute={IonRouteInner}\n ionRedirect={{}}\n stackManager={StackManager}\n routeInfo={routeInfo}\n onNativeBack={handleNativeBack}\n onNavigateBack={handleNavigateBack}\n onNavigate={handleNavigate}\n onSetCurrentTab={handleSetCurrentTab}\n onChangeTab={handleChangeTab}\n onResetTab={handleResetTab}\n locationHistory={locationHistory.current}\n >\n {children}\n </NavManager>\n </RouteManagerContext.Provider>\n );\n};\n\nIonRouter.displayName = 'IonRouter';\n","/**\n * `IonReactRouter` facilitates the integration of Ionic's specific\n * navigation and UI management with the standard React Router mechanisms,\n * allowing an inner Ionic-specific router (`IonRouter`) to react to\n * navigation events.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useCallback } from 'react';\nimport type { BrowserRouterProps } from 'react-router-dom';\nimport { BrowserRouter, useLocation, useNavigationType } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\n/**\n * This component acts as a bridge to ensure React Router hooks like\n * `useLocation` and `useNavigationType` are called within the valid\n * context of a `<BrowserRouter>`.\n *\n * It was split from `IonReactRouter` because these hooks must be\n * descendants of a `<Router>` component, which `BrowserRouter` provides.\n */\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = useCallback((cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n }, []);\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param loc The current browser history location object.\n * @param act The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = useCallback((loc: HistoryLocation, act: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(loc, act);\n }\n }, []);\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType, handleHistoryChange]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactRouter = ({ children, ...browserRouterProps }: PropsWithChildren<BrowserRouterProps>) => {\n return (\n <BrowserRouter {...browserRouterProps}>\n <RouterContent>{children}</RouterContent>\n </BrowserRouter>\n );\n};\n","/**\n * `IonReactMemoryRouter` provides a way to use `react-router` in\n * environments where a traditional browser history (like `BrowserRouter`)\n * isn't available or desirable.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef } from 'react';\nimport type { MemoryRouterProps } from 'react-router';\nimport { MemoryRouter, useLocation, useNavigationType } from 'react-router';\n\nimport { IonRouter } from './IonRouter';\n\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = (cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n };\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param location The current browser history location object.\n * @param action The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(location, action);\n }\n };\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactMemoryRouter = ({ children, ...routerProps }: PropsWithChildren<MemoryRouterProps>) => {\n return (\n <MemoryRouter {...routerProps}>\n <RouterContent>{children}</RouterContent>\n </MemoryRouter>\n );\n};\n","/**\n * `IonReactHashRouter` provides a way to use hash-based routing in Ionic\n * React applications.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef } from 'react';\nimport type { HashRouterProps } from 'react-router-dom';\nimport { HashRouter, useLocation, useNavigationType } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = (cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n };\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param location The current browser history location object.\n * @param action The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(location, action);\n }\n };\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactHashRouter = ({ children, ...routerProps }: PropsWithChildren<HashRouterProps>) => {\n return (\n <HashRouter {...routerProps}>\n <RouterContent>{children}</RouterContent>\n </HashRouter>\n );\n};\n"],"names":["reactRouterMatchPath","matchComponent","RouteContext","RouterContent","useLocation","useNavigationType"],"mappings":";;;;;;AAIO,MAAM,aAAa,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAiB,KAAI;IAChE,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAA,CAAI;AAChD,CAAC;;ACgBD;;;AAGG;AACI,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAoB,KAA8B;AACpG,IAAA,MAAM,EAAE,IAAI,EAAE,KAAK,EAAA,GAAmB,cAAc,EAA5B,SAAS,GAAA,MAAA,CAAK,cAAc,E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