2dde0bc85d7e82002675420378b53355a495b5555c246574a380723f999b1fe3.json 90 KB

1
  1. {"ast":null,"code":"import _asyncToGenerator from \"F:/workspace/huinongbao-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\n/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { r as registerInstance, d as createEvent, i as getElement, h, f as Host } from './index-28849c61.js';\nimport { c as componentOnReady, o as debounce } from './helpers-da915de8.js';\nimport { o as openURL, c as createColorClasses } from './theme-01f3f29c.js';\nimport { b as getIonMode } from './ionic-global-c81d82ab.js';\nconst Route = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteDataChanged = createEvent(this, \"ionRouteDataChanged\", 7);\n this.url = '';\n this.component = undefined;\n this.componentProps = undefined;\n this.beforeLeave = undefined;\n this.beforeEnter = undefined;\n }\n onUpdate(newValue) {\n this.ionRouteDataChanged.emit(newValue);\n }\n onComponentProps(newValue, oldValue) {\n if (newValue === oldValue) {\n return;\n }\n const keys1 = newValue ? Object.keys(newValue) : [];\n const keys2 = oldValue ? Object.keys(oldValue) : [];\n if (keys1.length !== keys2.length) {\n this.onUpdate(newValue);\n return;\n }\n for (const key of keys1) {\n if (newValue[key] !== oldValue[key]) {\n this.onUpdate(newValue);\n return;\n }\n }\n }\n connectedCallback() {\n this.ionRouteDataChanged.emit();\n }\n static get watchers() {\n return {\n \"url\": [\"onUpdate\"],\n \"component\": [\"onUpdate\"],\n \"componentProps\": [\"onComponentProps\"]\n };\n }\n};\nconst RouteRedirect = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteRedirectChanged = createEvent(this, \"ionRouteRedirectChanged\", 7);\n this.from = undefined;\n this.to = undefined;\n }\n propDidChange() {\n this.ionRouteRedirectChanged.emit();\n }\n connectedCallback() {\n this.ionRouteRedirectChanged.emit();\n }\n static get watchers() {\n return {\n \"from\": [\"propDidChange\"],\n \"to\": [\"propDidChange\"]\n };\n }\n};\nconst ROUTER_INTENT_NONE = 'root';\nconst ROUTER_INTENT_FORWARD = 'forward';\nconst ROUTER_INTENT_BACK = 'back';\n\n/** Join the non empty segments with \"/\". */\nconst generatePath = segments => {\n const path = segments.filter(s => s.length > 0).join('/');\n return '/' + path;\n};\nconst generateUrl = (segments, useHash, queryString) => {\n let url = generatePath(segments);\n if (useHash) {\n url = '#' + url;\n }\n if (queryString !== undefined) {\n url += '?' + queryString;\n }\n return url;\n};\nconst writeSegments = (history, root, useHash, segments, direction, state, queryString) => {\n const url = generateUrl([...parsePath(root).segments, ...segments], useHash, queryString);\n if (direction === ROUTER_INTENT_FORWARD) {\n history.pushState(state, '', url);\n } else {\n history.replaceState(state, '', url);\n }\n};\n/**\n * Transforms a chain to a list of segments.\n *\n * Notes:\n * - parameter segments of the form :param are replaced with their value,\n * - null is returned when a value is missing for any parameter segment.\n */\nconst chainToSegments = chain => {\n const segments = [];\n for (const route of chain) {\n for (const segment of route.segments) {\n if (segment[0] === ':') {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n const param = route.params && route.params[segment.slice(1)];\n if (!param) {\n return null;\n }\n segments.push(param);\n } else if (segment !== '') {\n segments.push(segment);\n }\n }\n }\n return segments;\n};\n/**\n * Removes the prefix segments from the path segments.\n *\n * Return:\n * - null when the path segments do not start with the passed prefix,\n * - the path segments after the prefix otherwise.\n */\nconst removePrefix = (prefix, segments) => {\n if (prefix.length > segments.length) {\n return null;\n }\n if (prefix.length <= 1 && prefix[0] === '') {\n return segments;\n }\n for (let i = 0; i < prefix.length; i++) {\n if (prefix[i] !== segments[i]) {\n return null;\n }\n }\n if (segments.length === prefix.length) {\n return [''];\n }\n return segments.slice(prefix.length);\n};\nconst readSegments = (loc, root, useHash) => {\n const prefix = parsePath(root).segments;\n const pathname = useHash ? loc.hash.slice(1) : loc.pathname;\n const segments = parsePath(pathname).segments;\n return removePrefix(prefix, segments);\n};\n/**\n * Parses the path to:\n * - segments an array of '/' separated parts,\n * - queryString (undefined when no query string).\n */\nconst parsePath = path => {\n let segments = [''];\n let queryString;\n if (path != null) {\n const qsStart = path.indexOf('?');\n if (qsStart > -1) {\n queryString = path.substring(qsStart + 1);\n path = path.substring(0, qsStart);\n }\n segments = path.split('/').map(s => s.trim()).filter(s => s.length > 0);\n if (segments.length === 0) {\n segments = [''];\n }\n }\n return {\n segments,\n queryString\n };\n};\nconst printRoutes = routes => {\n console.group(`[ion-core] ROUTES[${routes.length}]`);\n for (const chain of routes) {\n const segments = [];\n chain.forEach(r => segments.push(...r.segments));\n const ids = chain.map(r => r.id);\n console.debug(`%c ${generatePath(segments)}`, 'font-weight: bold; padding-left: 20px', '=>\\t', `(${ids.join(', ')})`);\n }\n console.groupEnd();\n};\nconst printRedirects = redirects => {\n console.group(`[ion-core] REDIRECTS[${redirects.length}]`);\n for (const redirect of redirects) {\n if (redirect.to) {\n console.debug('FROM: ', `$c ${generatePath(redirect.from)}`, 'font-weight: bold', ' TO: ', `$c ${generatePath(redirect.to.segments)}`, 'font-weight: bold');\n }\n }\n console.groupEnd();\n};\n\n/**\n * Activates the passed route chain.\n *\n * There must be exactly one outlet per route entry in the chain.\n *\n * The methods calls setRouteId on each of the outlet with the corresponding route entry in the chain.\n * setRouteId will create or select the view in the outlet.\n */\nconst _writeNavState = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (root, chain, direction, index, changed = false, animation) {\n try {\n // find next navigation outlet in the DOM\n const outlet = searchNavNode(root);\n // make sure we can continue interacting the DOM, otherwise abort\n if (index >= chain.length || !outlet) {\n return changed;\n }\n yield new Promise(resolve => componentOnReady(outlet, resolve));\n const route = chain[index];\n const result = yield outlet.setRouteId(route.id, route.params, direction, animation);\n // if the outlet changed the page, reset navigation to neutral (no direction)\n // this means nested outlets will not animate\n if (result.changed) {\n direction = ROUTER_INTENT_NONE;\n changed = true;\n }\n // recursively set nested outlets\n changed = yield _writeNavState(result.element, chain, direction, index + 1, changed, animation);\n // once all nested outlets are visible let's make the parent visible too,\n // using markVisible prevents flickering\n if (result.markVisible) {\n yield result.markVisible();\n }\n return changed;\n } catch (e) {\n console.error(e);\n return false;\n }\n });\n return function writeNavState(_x, _x2, _x3, _x4) {\n return _ref.apply(this, arguments);\n };\n}();\n/**\n * Recursively walks the outlet in the DOM.\n *\n * The function returns a list of RouteID corresponding to each of the outlet and the last outlet without a RouteID.\n */\nconst readNavState = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator(function* (root) {\n const ids = [];\n let outlet;\n let node = root;\n // eslint-disable-next-line no-cond-assign\n while (outlet = searchNavNode(node)) {\n const id = yield outlet.getRouteId();\n if (id) {\n node = id.element;\n id.element = undefined;\n ids.push(id);\n } else {\n break;\n }\n }\n return {\n ids,\n outlet\n };\n });\n return function readNavState(_x5) {\n return _ref2.apply(this, arguments);\n };\n}();\nconst waitUntilNavNode = () => {\n if (searchNavNode(document.body)) {\n return Promise.resolve();\n }\n return new Promise(resolve => {\n window.addEventListener('ionNavWillLoad', () => resolve(), {\n once: true\n });\n });\n};\n/** Selector for all the outlets supported by the router. */\nconst OUTLET_SELECTOR = ':not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet';\nconst searchNavNode = root => {\n if (!root) {\n return undefined;\n }\n if (root.matches(OUTLET_SELECTOR)) {\n return root;\n }\n const outlet = root.querySelector(OUTLET_SELECTOR);\n return outlet !== null && outlet !== void 0 ? outlet : undefined;\n};\n\n/**\n * Returns whether the given redirect matches the given path segments.\n *\n * A redirect matches when the segments of the path and redirect.from are equal.\n * Note that segments are only checked until redirect.from contains a '*' which matches any path segment.\n * The path ['some', 'path', 'to', 'page'] matches both ['some', 'path', 'to', 'page'] and ['some', 'path', '*'].\n */\nconst matchesRedirect = (segments, redirect) => {\n const {\n from,\n to\n } = redirect;\n if (to === undefined) {\n return false;\n }\n if (from.length > segments.length) {\n return false;\n }\n for (let i = 0; i < from.length; i++) {\n const expected = from[i];\n if (expected === '*') {\n return true;\n }\n if (expected !== segments[i]) {\n return false;\n }\n }\n return from.length === segments.length;\n};\n/** Returns the first redirect matching the path segments or undefined when no match found. */\nconst findRouteRedirect = (segments, redirects) => {\n return redirects.find(redirect => matchesRedirect(segments, redirect));\n};\nconst matchesIDs = (ids, chain) => {\n const len = Math.min(ids.length, chain.length);\n let score = 0;\n for (let i = 0; i < len; i++) {\n const routeId = ids[i];\n const routeChain = chain[i];\n // Skip results where the route id does not match the chain at the same index\n if (routeId.id.toLowerCase() !== routeChain.id) {\n break;\n }\n if (routeId.params) {\n const routeIdParams = Object.keys(routeId.params);\n // Only compare routes with the chain that have the same number of parameters.\n if (routeIdParams.length === routeChain.segments.length) {\n // Maps the route's params into a path based on the path variable names,\n // to compare against the route chain format.\n //\n // Before:\n // ```ts\n // {\n // params: {\n // s1: 'a',\n // s2: 'b'\n // }\n // }\n // ```\n //\n // After:\n // ```ts\n // [':s1',':s2']\n // ```\n //\n const pathWithParams = routeIdParams.map(key => `:${key}`);\n for (let j = 0; j < pathWithParams.length; j++) {\n // Skip results where the path variable is not a match\n if (pathWithParams[j].toLowerCase() !== routeChain.segments[j]) {\n break;\n }\n // Weight path matches for the same index higher.\n score++;\n }\n }\n }\n // Weight id matches\n score++;\n }\n return score;\n};\n/**\n * Matches the segments against the chain.\n *\n * Returns:\n * - null when there is no match,\n * - a chain with the params properties updated with the parameter segments on match.\n */\nconst matchesSegments = (segments, chain) => {\n const inputSegments = new RouterSegments(segments);\n let matchesDefault = false;\n let allparams;\n for (let i = 0; i < chain.length; i++) {\n const chainSegments = chain[i].segments;\n if (chainSegments[0] === '') {\n matchesDefault = true;\n } else {\n for (const segment of chainSegments) {\n const data = inputSegments.next();\n // data param\n if (segment[0] === ':') {\n if (data === '') {\n return null;\n }\n allparams = allparams || [];\n const params = allparams[i] || (allparams[i] = {});\n params[segment.slice(1)] = data;\n } else if (data !== segment) {\n return null;\n }\n }\n matchesDefault = false;\n }\n }\n const matches = matchesDefault ? matchesDefault === (inputSegments.next() === '') : true;\n if (!matches) {\n return null;\n }\n if (allparams) {\n return chain.map((route, i) => ({\n id: route.id,\n segments: route.segments,\n params: mergeParams(route.params, allparams[i]),\n beforeEnter: route.beforeEnter,\n beforeLeave: route.beforeLeave\n }));\n }\n return chain;\n};\n/**\n * Merges the route parameter objects.\n * Returns undefined when both parameters are undefined.\n */\nconst mergeParams = (a, b) => {\n return a || b ? Object.assign(Object.assign({}, a), b) : undefined;\n};\n/**\n * Finds the best match for the ids in the chains.\n *\n * Returns the best match or null when no match is found.\n * When a chain is returned the parameters are updated from the RouteIDs.\n * That is they contain both the componentProps of the <ion-route> and the parameter segment.\n */\nconst findChainForIDs = (ids, chains) => {\n let match = null;\n let maxMatches = 0;\n for (const chain of chains) {\n const score = matchesIDs(ids, chain);\n if (score > maxMatches) {\n match = chain;\n maxMatches = score;\n }\n }\n if (match) {\n return match.map((route, i) => {\n var _a;\n return {\n id: route.id,\n segments: route.segments,\n params: mergeParams(route.params, (_a = ids[i]) === null || _a === void 0 ? void 0 : _a.params)\n };\n });\n }\n return null;\n};\n/**\n * Finds the best match for the segments in the chains.\n *\n * Returns the best match or null when no match is found.\n * When a chain is returned the parameters are updated from the segments.\n * That is they contain both the componentProps of the <ion-route> and the parameter segments.\n */\nconst findChainForSegments = (segments, chains) => {\n let match = null;\n let bestScore = 0;\n for (const chain of chains) {\n const matchedChain = matchesSegments(segments, chain);\n if (matchedChain !== null) {\n const score = computePriority(matchedChain);\n if (score > bestScore) {\n bestScore = score;\n match = matchedChain;\n }\n }\n }\n return match;\n};\n/**\n * Computes the priority of a chain.\n *\n * Parameter segments are given a lower priority over fixed segments.\n *\n * Considering the following 2 chains matching the path /path/to/page:\n * - /path/to/:where\n * - /path/to/page\n *\n * The second one will be given a higher priority because \"page\" is a fixed segment (vs \":where\", a parameter segment).\n */\nconst computePriority = chain => {\n let score = 1;\n let level = 1;\n for (const route of chain) {\n for (const segment of route.segments) {\n if (segment[0] === ':') {\n score += Math.pow(1, level);\n } else if (segment !== '') {\n score += Math.pow(2, level);\n }\n level++;\n }\n }\n return score;\n};\nclass RouterSegments {\n constructor(segments) {\n this.segments = segments.slice();\n }\n next() {\n if (this.segments.length > 0) {\n return this.segments.shift();\n }\n return '';\n }\n}\nconst readProp = (el, prop) => {\n if (prop in el) {\n return el[prop];\n }\n if (el.hasAttribute(prop)) {\n return el.getAttribute(prop);\n }\n return null;\n};\n/**\n * Extracts the redirects (that is <ion-route-redirect> elements inside the root).\n *\n * The redirects are returned as a list of RouteRedirect.\n */\nconst readRedirects = root => {\n return Array.from(root.children).filter(el => el.tagName === 'ION-ROUTE-REDIRECT').map(el => {\n const to = readProp(el, 'to');\n return {\n from: parsePath(readProp(el, 'from')).segments,\n to: to == null ? undefined : parsePath(to)\n };\n });\n};\n/**\n * Extracts all the routes (that is <ion-route> elements inside the root).\n *\n * The routes are returned as a list of chains - the flattened tree.\n */\nconst readRoutes = root => {\n return flattenRouterTree(readRouteNodes(root));\n};\n/**\n * Reads the route nodes as a tree modeled after the DOM tree of <ion-route> elements.\n *\n * Note: routes without a component are ignored together with their children.\n */\nconst readRouteNodes = node => {\n return Array.from(node.children).filter(el => el.tagName === 'ION-ROUTE' && el.component).map(el => {\n const component = readProp(el, 'component');\n return {\n segments: parsePath(readProp(el, 'url')).segments,\n id: component.toLowerCase(),\n params: el.componentProps,\n beforeLeave: el.beforeLeave,\n beforeEnter: el.beforeEnter,\n children: readRouteNodes(el)\n };\n });\n};\n/**\n * Flattens a RouterTree in a list of chains.\n *\n * Each chain represents a path from the root node to a terminal node.\n */\nconst flattenRouterTree = nodes => {\n const chains = [];\n for (const node of nodes) {\n flattenNode([], chains, node);\n }\n return chains;\n};\n/** Flattens a route node recursively and push each branch to the chains list. */\nconst flattenNode = (chain, chains, node) => {\n chain = [...chain, {\n id: node.id,\n segments: node.segments,\n params: node.params,\n beforeLeave: node.beforeLeave,\n beforeEnter: node.beforeEnter\n }];\n if (node.children.length === 0) {\n chains.push(chain);\n return;\n }\n for (const child of node.children) {\n flattenNode(chain, chains, child);\n }\n};\nconst Router = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteWillChange = createEvent(this, \"ionRouteWillChange\", 7);\n this.ionRouteDidChange = createEvent(this, \"ionRouteDidChange\", 7);\n this.previousPath = null;\n this.busy = false;\n this.state = 0;\n this.lastState = 0;\n this.root = '/';\n this.useHash = true;\n }\n componentWillLoad() {\n var _this = this;\n return _asyncToGenerator(function* () {\n yield waitUntilNavNode();\n const canProceed = yield _this.runGuards(_this.getSegments());\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n const {\n redirect\n } = canProceed;\n const path = parsePath(redirect);\n _this.setSegments(path.segments, ROUTER_INTENT_NONE, path.queryString);\n yield _this.writeNavStateRoot(path.segments, ROUTER_INTENT_NONE);\n }\n } else {\n yield _this.onRoutesChanged();\n }\n })();\n }\n componentDidLoad() {\n window.addEventListener('ionRouteRedirectChanged', debounce(this.onRedirectChanged.bind(this), 10));\n window.addEventListener('ionRouteDataChanged', debounce(this.onRoutesChanged.bind(this), 100));\n }\n onPopState() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n const direction = _this2.historyDirection();\n let segments = _this2.getSegments();\n const canProceed = yield _this2.runGuards(segments);\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n segments = parsePath(canProceed.redirect).segments;\n } else {\n return false;\n }\n }\n return _this2.writeNavStateRoot(segments, direction);\n })();\n }\n onBackButton(ev) {\n ev.detail.register(0, processNextHandler => {\n this.back();\n processNextHandler();\n });\n }\n /** @internal */\n canTransition() {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n const canProceed = yield _this3.runGuards();\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n return canProceed.redirect;\n } else {\n return false;\n }\n }\n return true;\n })();\n }\n /**\n * Navigate to the specified path.\n *\n * @param path The path to navigate to.\n * @param direction The direction of the animation. Defaults to `\"forward\"`.\n */\n push(path, direction = 'forward', animation) {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n var _a;\n if (path.startsWith('.')) {\n const currentPath = (_a = _this4.previousPath) !== null && _a !== void 0 ? _a : '/';\n // Convert currentPath to an URL by pre-pending a protocol and a host to resolve the relative path.\n const url = new URL(path, `https://host/${currentPath}`);\n path = url.pathname + url.search;\n }\n let parsedPath = parsePath(path);\n const canProceed = yield _this4.runGuards(parsedPath.segments);\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n parsedPath = parsePath(canProceed.redirect);\n } else {\n return false;\n }\n }\n _this4.setSegments(parsedPath.segments, direction, parsedPath.queryString);\n return _this4.writeNavStateRoot(parsedPath.segments, direction, animation);\n })();\n }\n /** Go back to previous page in the window.history. */\n back() {\n window.history.back();\n return Promise.resolve(this.waitPromise);\n }\n /** @internal */\n printDebug() {\n var _this5 = this;\n return _asyncToGenerator(function* () {\n printRoutes(readRoutes(_this5.el));\n printRedirects(readRedirects(_this5.el));\n })();\n }\n /** @internal */\n navChanged(direction) {\n var _this6 = this;\n return _asyncToGenerator(function* () {\n if (_this6.busy) {\n console.warn('[ion-router] router is busy, navChanged was cancelled');\n return false;\n }\n const {\n ids,\n outlet\n } = yield readNavState(window.document.body);\n const routes = readRoutes(_this6.el);\n const chain = findChainForIDs(ids, routes);\n if (!chain) {\n console.warn('[ion-router] no matching URL for ', ids.map(i => i.id));\n return false;\n }\n const segments = chainToSegments(chain);\n if (!segments) {\n console.warn('[ion-router] router could not match path because some required param is missing');\n return false;\n }\n _this6.setSegments(segments, direction);\n yield _this6.safeWriteNavState(outlet, chain, ROUTER_INTENT_NONE, segments, null, ids.length);\n return true;\n })();\n }\n /** This handler gets called when a `ion-route-redirect` component is added to the DOM or if the from or to property of such node changes. */\n onRedirectChanged() {\n const segments = this.getSegments();\n if (segments && findRouteRedirect(segments, readRedirects(this.el))) {\n this.writeNavStateRoot(segments, ROUTER_INTENT_NONE);\n }\n }\n /** This handler gets called when a `ion-route` component is added to the DOM or if the from or to property of such node changes. */\n onRoutesChanged() {\n return this.writeNavStateRoot(this.getSegments(), ROUTER_INTENT_NONE);\n }\n historyDirection() {\n var _a;\n const win = window;\n if (win.history.state === null) {\n this.state++;\n win.history.replaceState(this.state, win.document.title, (_a = win.document.location) === null || _a === void 0 ? void 0 : _a.href);\n }\n const state = win.history.state;\n const lastState = this.lastState;\n this.lastState = state;\n if (state > lastState || state >= lastState && lastState > 0) {\n return ROUTER_INTENT_FORWARD;\n }\n if (state < lastState) {\n return ROUTER_INTENT_BACK;\n }\n return ROUTER_INTENT_NONE;\n }\n writeNavStateRoot(segments, direction, animation) {\n var _this7 = this;\n return _asyncToGenerator(function* () {\n if (!segments) {\n console.error('[ion-router] URL is not part of the routing set');\n return false;\n }\n // lookup redirect rule\n const redirects = readRedirects(_this7.el);\n const redirect = findRouteRedirect(segments, redirects);\n let redirectFrom = null;\n if (redirect) {\n const {\n segments: toSegments,\n queryString\n } = redirect.to;\n _this7.setSegments(toSegments, direction, queryString);\n redirectFrom = redirect.from;\n segments = toSegments;\n }\n // lookup route chain\n const routes = readRoutes(_this7.el);\n const chain = findChainForSegments(segments, routes);\n if (!chain) {\n console.error('[ion-router] the path does not match any route');\n return false;\n }\n // write DOM give\n return _this7.safeWriteNavState(document.body, chain, direction, segments, redirectFrom, 0, animation);\n })();\n }\n safeWriteNavState(node, chain, direction, segments, redirectFrom, index = 0, animation) {\n var _this8 = this;\n return _asyncToGenerator(function* () {\n const unlock = yield _this8.lock();\n let changed = false;\n try {\n changed = yield _this8.writeNavState(node, chain, direction, segments, redirectFrom, index, animation);\n } catch (e) {\n console.error(e);\n }\n unlock();\n return changed;\n })();\n }\n lock() {\n var _this9 = this;\n return _asyncToGenerator(function* () {\n const p = _this9.waitPromise;\n let resolve;\n _this9.waitPromise = new Promise(r => resolve = r);\n if (p !== undefined) {\n yield p;\n }\n return resolve;\n })();\n }\n /**\n * Executes the beforeLeave hook of the source route and the beforeEnter hook of the target route if they exist.\n *\n * When the beforeLeave hook does not return true (to allow navigating) then that value is returned early and the beforeEnter is executed.\n * Otherwise the beforeEnterHook hook of the target route is executed.\n */\n runGuards(to = this.getSegments(), from) {\n var _this10 = this;\n return _asyncToGenerator(function* () {\n if (from === undefined) {\n from = parsePath(_this10.previousPath).segments;\n }\n if (!to || !from) {\n return true;\n }\n const routes = readRoutes(_this10.el);\n const fromChain = findChainForSegments(from, routes);\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n const beforeLeaveHook = fromChain && fromChain[fromChain.length - 1].beforeLeave;\n const canLeave = beforeLeaveHook ? yield beforeLeaveHook() : true;\n if (canLeave === false || typeof canLeave === 'object') {\n return canLeave;\n }\n const toChain = findChainForSegments(to, routes);\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n const beforeEnterHook = toChain && toChain[toChain.length - 1].beforeEnter;\n return beforeEnterHook ? beforeEnterHook() : true;\n })();\n }\n writeNavState(node, chain, direction, segments, redirectFrom, index = 0, animation) {\n var _this11 = this;\n return _asyncToGenerator(function* () {\n if (_this11.busy) {\n console.warn('[ion-router] router is busy, transition was cancelled');\n return false;\n }\n _this11.busy = true;\n // generate route event and emit will change\n const routeEvent = _this11.routeChangeEvent(segments, redirectFrom);\n if (routeEvent) {\n _this11.ionRouteWillChange.emit(routeEvent);\n }\n const changed = yield _writeNavState(node, chain, direction, index, false, animation);\n _this11.busy = false;\n // emit did change\n if (routeEvent) {\n _this11.ionRouteDidChange.emit(routeEvent);\n }\n return changed;\n })();\n }\n setSegments(segments, direction, queryString) {\n this.state++;\n writeSegments(window.history, this.root, this.useHash, segments, direction, this.state, queryString);\n }\n getSegments() {\n return readSegments(window.location, this.root, this.useHash);\n }\n routeChangeEvent(toSegments, redirectFromSegments) {\n const from = this.previousPath;\n const to = generatePath(toSegments);\n this.previousPath = to;\n if (to === from) {\n return null;\n }\n const redirectedFrom = redirectFromSegments ? generatePath(redirectFromSegments) : null;\n return {\n from,\n redirectedFrom,\n to\n };\n }\n get el() {\n return getElement(this);\n }\n};\nconst routerLinkCss = \":host{--background:transparent;--color:var(--ion-color-primary, #0054e9);background:var(--background);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}a{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit}\";\nconst IonRouterLinkStyle0 = routerLinkCss;\nconst RouterLink = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.onClick = ev => {\n openURL(this.href, ev, this.routerDirection, this.routerAnimation);\n };\n this.color = undefined;\n this.href = undefined;\n this.rel = undefined;\n this.routerDirection = 'forward';\n this.routerAnimation = undefined;\n this.target = undefined;\n }\n render() {\n const mode = getIonMode(this);\n const attrs = {\n href: this.href,\n rel: this.rel,\n target: this.target\n };\n return h(Host, {\n key: '529ceed5beaf92d7b4cc315c82f449eac18310e8',\n onClick: this.onClick,\n class: createColorClasses(this.color, {\n [mode]: true,\n 'ion-activatable': true\n })\n }, h(\"a\", Object.assign({\n key: 'd5f1f8b256695d70bdafd20ff3d1b625963fa2da'\n }, attrs), h(\"slot\", {\n key: '613fcdb36a71e076f989551ea21f1d5c118b1cd2'\n })));\n }\n};\nRouterLink.style = IonRouterLinkStyle0;\nexport { Route as ion_route, RouteRedirect as ion_route_redirect, Router as ion_router, RouterLink as ion_router_link };","map":{"version":3,"names":["r","registerInstance","d","createEvent","i","getElement","h","f","Host","c","componentOnReady","o","debounce","openURL","createColorClasses","b","getIonMode","Route","constructor","hostRef","ionRouteDataChanged","url","component","undefined","componentProps","beforeLeave","beforeEnter","onUpdate","newValue","emit","onComponentProps","oldValue","keys1","Object","keys","keys2","length","key","connectedCallback","watchers","RouteRedirect","ionRouteRedirectChanged","from","to","propDidChange","ROUTER_INTENT_NONE","ROUTER_INTENT_FORWARD","ROUTER_INTENT_BACK","generatePath","segments","path","filter","s","join","generateUrl","useHash","queryString","writeSegments","history","root","direction","state","parsePath","pushState","replaceState","chainToSegments","chain","route","segment","param","params","slice","push","removePrefix","prefix","readSegments","loc","pathname","hash","qsStart","indexOf","substring","split","map","trim","printRoutes","routes","console","group","forEach","ids","id","debug","groupEnd","printRedirects","redirects","redirect","writeNavState","_ref","_asyncToGenerator","index","changed","animation","outlet","searchNavNode","Promise","resolve","result","setRouteId","element","markVisible","e","error","_x","_x2","_x3","_x4","apply","arguments","readNavState","_ref2","node","getRouteId","_x5","waitUntilNavNode","document","body","window","addEventListener","once","OUTLET_SELECTOR","matches","querySelector","matchesRedirect","expected","findRouteRedirect","find","matchesIDs","len","Math","min","score","routeId","routeChain","toLowerCase","routeIdParams","pathWithParams","j","matchesSegments","inputSegments","RouterSegments","matchesDefault","allparams","chainSegments","data","next","mergeParams","a","assign","findChainForIDs","chains","match","maxMatches","_a","findChainForSegments","bestScore","matchedChain","computePriority","level","pow","shift","readProp","el","prop","hasAttribute","getAttribute","readRedirects","Array","children","tagName","readRoutes","flattenRouterTree","readRouteNodes","nodes","flattenNode","child","Router","ionRouteWillChange","ionRouteDidChange","previousPath","busy","lastState","componentWillLoad","_this","canProceed","runGuards","getSegments","setSegments","writeNavStateRoot","onRoutesChanged","componentDidLoad","onRedirectChanged","bind","onPopState","_this2","historyDirection","onBackButton","ev","detail","register","processNextHandler","back","canTransition","_this3","_this4","startsWith","currentPath","URL","search","parsedPath","waitPromise","printDebug","_this5","navChanged","_this6","warn","safeWriteNavState","win","title","location","href","_this7","redirectFrom","toSegments","_this8","unlock","lock","_this9","p","_this10","fromChain","beforeLeaveHook","canLeave","toChain","beforeEnterHook","_this11","routeEvent","routeChangeEvent","redirectFromSegments","redirectedFrom","routerLinkCss","IonRouterLinkStyle0","RouterLink","onClick","routerDirection","routerAnimation","color","rel","target","render","mode","attrs","class","style","ion_route","ion_route_redirect","ion_router","ion_router_link"],"sources":["F:/workspace/huinongbao-app/node_modules/@ionic/core/dist/esm/ion-route_4.entry.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { r as registerInstance, d as createEvent, i as getElement, h, f as Host } from './index-28849c61.js';\nimport { c as componentOnReady, o as debounce } from './helpers-da915de8.js';\nimport { o as openURL, c as createColorClasses } from './theme-01f3f29c.js';\nimport { b as getIonMode } from './ionic-global-c81d82ab.js';\n\nconst Route = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteDataChanged = createEvent(this, \"ionRouteDataChanged\", 7);\n this.url = '';\n this.component = undefined;\n this.componentProps = undefined;\n this.beforeLeave = undefined;\n this.beforeEnter = undefined;\n }\n onUpdate(newValue) {\n this.ionRouteDataChanged.emit(newValue);\n }\n onComponentProps(newValue, oldValue) {\n if (newValue === oldValue) {\n return;\n }\n const keys1 = newValue ? Object.keys(newValue) : [];\n const keys2 = oldValue ? Object.keys(oldValue) : [];\n if (keys1.length !== keys2.length) {\n this.onUpdate(newValue);\n return;\n }\n for (const key of keys1) {\n if (newValue[key] !== oldValue[key]) {\n this.onUpdate(newValue);\n return;\n }\n }\n }\n connectedCallback() {\n this.ionRouteDataChanged.emit();\n }\n static get watchers() { return {\n \"url\": [\"onUpdate\"],\n \"component\": [\"onUpdate\"],\n \"componentProps\": [\"onComponentProps\"]\n }; }\n};\n\nconst RouteRedirect = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteRedirectChanged = createEvent(this, \"ionRouteRedirectChanged\", 7);\n this.from = undefined;\n this.to = undefined;\n }\n propDidChange() {\n this.ionRouteRedirectChanged.emit();\n }\n connectedCallback() {\n this.ionRouteRedirectChanged.emit();\n }\n static get watchers() { return {\n \"from\": [\"propDidChange\"],\n \"to\": [\"propDidChange\"]\n }; }\n};\n\nconst ROUTER_INTENT_NONE = 'root';\nconst ROUTER_INTENT_FORWARD = 'forward';\nconst ROUTER_INTENT_BACK = 'back';\n\n/** Join the non empty segments with \"/\". */\nconst generatePath = (segments) => {\n const path = segments.filter((s) => s.length > 0).join('/');\n return '/' + path;\n};\nconst generateUrl = (segments, useHash, queryString) => {\n let url = generatePath(segments);\n if (useHash) {\n url = '#' + url;\n }\n if (queryString !== undefined) {\n url += '?' + queryString;\n }\n return url;\n};\nconst writeSegments = (history, root, useHash, segments, direction, state, queryString) => {\n const url = generateUrl([...parsePath(root).segments, ...segments], useHash, queryString);\n if (direction === ROUTER_INTENT_FORWARD) {\n history.pushState(state, '', url);\n }\n else {\n history.replaceState(state, '', url);\n }\n};\n/**\n * Transforms a chain to a list of segments.\n *\n * Notes:\n * - parameter segments of the form :param are replaced with their value,\n * - null is returned when a value is missing for any parameter segment.\n */\nconst chainToSegments = (chain) => {\n const segments = [];\n for (const route of chain) {\n for (const segment of route.segments) {\n if (segment[0] === ':') {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n const param = route.params && route.params[segment.slice(1)];\n if (!param) {\n return null;\n }\n segments.push(param);\n }\n else if (segment !== '') {\n segments.push(segment);\n }\n }\n }\n return segments;\n};\n/**\n * Removes the prefix segments from the path segments.\n *\n * Return:\n * - null when the path segments do not start with the passed prefix,\n * - the path segments after the prefix otherwise.\n */\nconst removePrefix = (prefix, segments) => {\n if (prefix.length > segments.length) {\n return null;\n }\n if (prefix.length <= 1 && prefix[0] === '') {\n return segments;\n }\n for (let i = 0; i < prefix.length; i++) {\n if (prefix[i] !== segments[i]) {\n return null;\n }\n }\n if (segments.length === prefix.length) {\n return [''];\n }\n return segments.slice(prefix.length);\n};\nconst readSegments = (loc, root, useHash) => {\n const prefix = parsePath(root).segments;\n const pathname = useHash ? loc.hash.slice(1) : loc.pathname;\n const segments = parsePath(pathname).segments;\n return removePrefix(prefix, segments);\n};\n/**\n * Parses the path to:\n * - segments an array of '/' separated parts,\n * - queryString (undefined when no query string).\n */\nconst parsePath = (path) => {\n let segments = [''];\n let queryString;\n if (path != null) {\n const qsStart = path.indexOf('?');\n if (qsStart > -1) {\n queryString = path.substring(qsStart + 1);\n path = path.substring(0, qsStart);\n }\n segments = path\n .split('/')\n .map((s) => s.trim())\n .filter((s) => s.length > 0);\n if (segments.length === 0) {\n segments = [''];\n }\n }\n return { segments, queryString };\n};\n\nconst printRoutes = (routes) => {\n console.group(`[ion-core] ROUTES[${routes.length}]`);\n for (const chain of routes) {\n const segments = [];\n chain.forEach((r) => segments.push(...r.segments));\n const ids = chain.map((r) => r.id);\n console.debug(`%c ${generatePath(segments)}`, 'font-weight: bold; padding-left: 20px', '=>\\t', `(${ids.join(', ')})`);\n }\n console.groupEnd();\n};\nconst printRedirects = (redirects) => {\n console.group(`[ion-core] REDIRECTS[${redirects.length}]`);\n for (const redirect of redirects) {\n if (redirect.to) {\n console.debug('FROM: ', `$c ${generatePath(redirect.from)}`, 'font-weight: bold', ' TO: ', `$c ${generatePath(redirect.to.segments)}`, 'font-weight: bold');\n }\n }\n console.groupEnd();\n};\n\n/**\n * Activates the passed route chain.\n *\n * There must be exactly one outlet per route entry in the chain.\n *\n * The methods calls setRouteId on each of the outlet with the corresponding route entry in the chain.\n * setRouteId will create or select the view in the outlet.\n */\nconst writeNavState = async (root, chain, direction, index, changed = false, animation) => {\n try {\n // find next navigation outlet in the DOM\n const outlet = searchNavNode(root);\n // make sure we can continue interacting the DOM, otherwise abort\n if (index >= chain.length || !outlet) {\n return changed;\n }\n await new Promise((resolve) => componentOnReady(outlet, resolve));\n const route = chain[index];\n const result = await outlet.setRouteId(route.id, route.params, direction, animation);\n // if the outlet changed the page, reset navigation to neutral (no direction)\n // this means nested outlets will not animate\n if (result.changed) {\n direction = ROUTER_INTENT_NONE;\n changed = true;\n }\n // recursively set nested outlets\n changed = await writeNavState(result.element, chain, direction, index + 1, changed, animation);\n // once all nested outlets are visible let's make the parent visible too,\n // using markVisible prevents flickering\n if (result.markVisible) {\n await result.markVisible();\n }\n return changed;\n }\n catch (e) {\n console.error(e);\n return false;\n }\n};\n/**\n * Recursively walks the outlet in the DOM.\n *\n * The function returns a list of RouteID corresponding to each of the outlet and the last outlet without a RouteID.\n */\nconst readNavState = async (root) => {\n const ids = [];\n let outlet;\n let node = root;\n // eslint-disable-next-line no-cond-assign\n while ((outlet = searchNavNode(node))) {\n const id = await outlet.getRouteId();\n if (id) {\n node = id.element;\n id.element = undefined;\n ids.push(id);\n }\n else {\n break;\n }\n }\n return { ids, outlet };\n};\nconst waitUntilNavNode = () => {\n if (searchNavNode(document.body)) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n window.addEventListener('ionNavWillLoad', () => resolve(), { once: true });\n });\n};\n/** Selector for all the outlets supported by the router. */\nconst OUTLET_SELECTOR = ':not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet';\nconst searchNavNode = (root) => {\n if (!root) {\n return undefined;\n }\n if (root.matches(OUTLET_SELECTOR)) {\n return root;\n }\n const outlet = root.querySelector(OUTLET_SELECTOR);\n return outlet !== null && outlet !== void 0 ? outlet : undefined;\n};\n\n/**\n * Returns whether the given redirect matches the given path segments.\n *\n * A redirect matches when the segments of the path and redirect.from are equal.\n * Note that segments are only checked until redirect.from contains a '*' which matches any path segment.\n * The path ['some', 'path', 'to', 'page'] matches both ['some', 'path', 'to', 'page'] and ['some', 'path', '*'].\n */\nconst matchesRedirect = (segments, redirect) => {\n const { from, to } = redirect;\n if (to === undefined) {\n return false;\n }\n if (from.length > segments.length) {\n return false;\n }\n for (let i = 0; i < from.length; i++) {\n const expected = from[i];\n if (expected === '*') {\n return true;\n }\n if (expected !== segments[i]) {\n return false;\n }\n }\n return from.length === segments.length;\n};\n/** Returns the first redirect matching the path segments or undefined when no match found. */\nconst findRouteRedirect = (segments, redirects) => {\n return redirects.find((redirect) => matchesRedirect(segments, redirect));\n};\nconst matchesIDs = (ids, chain) => {\n const len = Math.min(ids.length, chain.length);\n let score = 0;\n for (let i = 0; i < len; i++) {\n const routeId = ids[i];\n const routeChain = chain[i];\n // Skip results where the route id does not match the chain at the same index\n if (routeId.id.toLowerCase() !== routeChain.id) {\n break;\n }\n if (routeId.params) {\n const routeIdParams = Object.keys(routeId.params);\n // Only compare routes with the chain that have the same number of parameters.\n if (routeIdParams.length === routeChain.segments.length) {\n // Maps the route's params into a path based on the path variable names,\n // to compare against the route chain format.\n //\n // Before:\n // ```ts\n // {\n // params: {\n // s1: 'a',\n // s2: 'b'\n // }\n // }\n // ```\n //\n // After:\n // ```ts\n // [':s1',':s2']\n // ```\n //\n const pathWithParams = routeIdParams.map((key) => `:${key}`);\n for (let j = 0; j < pathWithParams.length; j++) {\n // Skip results where the path variable is not a match\n if (pathWithParams[j].toLowerCase() !== routeChain.segments[j]) {\n break;\n }\n // Weight path matches for the same index higher.\n score++;\n }\n }\n }\n // Weight id matches\n score++;\n }\n return score;\n};\n/**\n * Matches the segments against the chain.\n *\n * Returns:\n * - null when there is no match,\n * - a chain with the params properties updated with the parameter segments on match.\n */\nconst matchesSegments = (segments, chain) => {\n const inputSegments = new RouterSegments(segments);\n let matchesDefault = false;\n let allparams;\n for (let i = 0; i < chain.length; i++) {\n const chainSegments = chain[i].segments;\n if (chainSegments[0] === '') {\n matchesDefault = true;\n }\n else {\n for (const segment of chainSegments) {\n const data = inputSegments.next();\n // data param\n if (segment[0] === ':') {\n if (data === '') {\n return null;\n }\n allparams = allparams || [];\n const params = allparams[i] || (allparams[i] = {});\n params[segment.slice(1)] = data;\n }\n else if (data !== segment) {\n return null;\n }\n }\n matchesDefault = false;\n }\n }\n const matches = matchesDefault ? matchesDefault === (inputSegments.next() === '') : true;\n if (!matches) {\n return null;\n }\n if (allparams) {\n return chain.map((route, i) => ({\n id: route.id,\n segments: route.segments,\n params: mergeParams(route.params, allparams[i]),\n beforeEnter: route.beforeEnter,\n beforeLeave: route.beforeLeave,\n }));\n }\n return chain;\n};\n/**\n * Merges the route parameter objects.\n * Returns undefined when both parameters are undefined.\n */\nconst mergeParams = (a, b) => {\n return a || b ? Object.assign(Object.assign({}, a), b) : undefined;\n};\n/**\n * Finds the best match for the ids in the chains.\n *\n * Returns the best match or null when no match is found.\n * When a chain is returned the parameters are updated from the RouteIDs.\n * That is they contain both the componentProps of the <ion-route> and the parameter segment.\n */\nconst findChainForIDs = (ids, chains) => {\n let match = null;\n let maxMatches = 0;\n for (const chain of chains) {\n const score = matchesIDs(ids, chain);\n if (score > maxMatches) {\n match = chain;\n maxMatches = score;\n }\n }\n if (match) {\n return match.map((route, i) => {\n var _a;\n return ({\n id: route.id,\n segments: route.segments,\n params: mergeParams(route.params, (_a = ids[i]) === null || _a === void 0 ? void 0 : _a.params),\n });\n });\n }\n return null;\n};\n/**\n * Finds the best match for the segments in the chains.\n *\n * Returns the best match or null when no match is found.\n * When a chain is returned the parameters are updated from the segments.\n * That is they contain both the componentProps of the <ion-route> and the parameter segments.\n */\nconst findChainForSegments = (segments, chains) => {\n let match = null;\n let bestScore = 0;\n for (const chain of chains) {\n const matchedChain = matchesSegments(segments, chain);\n if (matchedChain !== null) {\n const score = computePriority(matchedChain);\n if (score > bestScore) {\n bestScore = score;\n match = matchedChain;\n }\n }\n }\n return match;\n};\n/**\n * Computes the priority of a chain.\n *\n * Parameter segments are given a lower priority over fixed segments.\n *\n * Considering the following 2 chains matching the path /path/to/page:\n * - /path/to/:where\n * - /path/to/page\n *\n * The second one will be given a higher priority because \"page\" is a fixed segment (vs \":where\", a parameter segment).\n */\nconst computePriority = (chain) => {\n let score = 1;\n let level = 1;\n for (const route of chain) {\n for (const segment of route.segments) {\n if (segment[0] === ':') {\n score += Math.pow(1, level);\n }\n else if (segment !== '') {\n score += Math.pow(2, level);\n }\n level++;\n }\n }\n return score;\n};\nclass RouterSegments {\n constructor(segments) {\n this.segments = segments.slice();\n }\n next() {\n if (this.segments.length > 0) {\n return this.segments.shift();\n }\n return '';\n }\n}\n\nconst readProp = (el, prop) => {\n if (prop in el) {\n return el[prop];\n }\n if (el.hasAttribute(prop)) {\n return el.getAttribute(prop);\n }\n return null;\n};\n/**\n * Extracts the redirects (that is <ion-route-redirect> elements inside the root).\n *\n * The redirects are returned as a list of RouteRedirect.\n */\nconst readRedirects = (root) => {\n return Array.from(root.children)\n .filter((el) => el.tagName === 'ION-ROUTE-REDIRECT')\n .map((el) => {\n const to = readProp(el, 'to');\n return {\n from: parsePath(readProp(el, 'from')).segments,\n to: to == null ? undefined : parsePath(to),\n };\n });\n};\n/**\n * Extracts all the routes (that is <ion-route> elements inside the root).\n *\n * The routes are returned as a list of chains - the flattened tree.\n */\nconst readRoutes = (root) => {\n return flattenRouterTree(readRouteNodes(root));\n};\n/**\n * Reads the route nodes as a tree modeled after the DOM tree of <ion-route> elements.\n *\n * Note: routes without a component are ignored together with their children.\n */\nconst readRouteNodes = (node) => {\n return Array.from(node.children)\n .filter((el) => el.tagName === 'ION-ROUTE' && el.component)\n .map((el) => {\n const component = readProp(el, 'component');\n return {\n segments: parsePath(readProp(el, 'url')).segments,\n id: component.toLowerCase(),\n params: el.componentProps,\n beforeLeave: el.beforeLeave,\n beforeEnter: el.beforeEnter,\n children: readRouteNodes(el),\n };\n });\n};\n/**\n * Flattens a RouterTree in a list of chains.\n *\n * Each chain represents a path from the root node to a terminal node.\n */\nconst flattenRouterTree = (nodes) => {\n const chains = [];\n for (const node of nodes) {\n flattenNode([], chains, node);\n }\n return chains;\n};\n/** Flattens a route node recursively and push each branch to the chains list. */\nconst flattenNode = (chain, chains, node) => {\n chain = [\n ...chain,\n {\n id: node.id,\n segments: node.segments,\n params: node.params,\n beforeLeave: node.beforeLeave,\n beforeEnter: node.beforeEnter,\n },\n ];\n if (node.children.length === 0) {\n chains.push(chain);\n return;\n }\n for (const child of node.children) {\n flattenNode(chain, chains, child);\n }\n};\n\nconst Router = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteWillChange = createEvent(this, \"ionRouteWillChange\", 7);\n this.ionRouteDidChange = createEvent(this, \"ionRouteDidChange\", 7);\n this.previousPath = null;\n this.busy = false;\n this.state = 0;\n this.lastState = 0;\n this.root = '/';\n this.useHash = true;\n }\n async componentWillLoad() {\n await waitUntilNavNode();\n const canProceed = await this.runGuards(this.getSegments());\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n const { redirect } = canProceed;\n const path = parsePath(redirect);\n this.setSegments(path.segments, ROUTER_INTENT_NONE, path.queryString);\n await this.writeNavStateRoot(path.segments, ROUTER_INTENT_NONE);\n }\n }\n else {\n await this.onRoutesChanged();\n }\n }\n componentDidLoad() {\n window.addEventListener('ionRouteRedirectChanged', debounce(this.onRedirectChanged.bind(this), 10));\n window.addEventListener('ionRouteDataChanged', debounce(this.onRoutesChanged.bind(this), 100));\n }\n async onPopState() {\n const direction = this.historyDirection();\n let segments = this.getSegments();\n const canProceed = await this.runGuards(segments);\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n segments = parsePath(canProceed.redirect).segments;\n }\n else {\n return false;\n }\n }\n return this.writeNavStateRoot(segments, direction);\n }\n onBackButton(ev) {\n ev.detail.register(0, (processNextHandler) => {\n this.back();\n processNextHandler();\n });\n }\n /** @internal */\n async canTransition() {\n const canProceed = await this.runGuards();\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n return canProceed.redirect;\n }\n else {\n return false;\n }\n }\n return true;\n }\n /**\n * Navigate to the specified path.\n *\n * @param path The path to navigate to.\n * @param direction The direction of the animation. Defaults to `\"forward\"`.\n */\n async push(path, direction = 'forward', animation) {\n var _a;\n if (path.startsWith('.')) {\n const currentPath = (_a = this.previousPath) !== null && _a !== void 0 ? _a : '/';\n // Convert currentPath to an URL by pre-pending a protocol and a host to resolve the relative path.\n const url = new URL(path, `https://host/${currentPath}`);\n path = url.pathname + url.search;\n }\n let parsedPath = parsePath(path);\n const canProceed = await this.runGuards(parsedPath.segments);\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n parsedPath = parsePath(canProceed.redirect);\n }\n else {\n return false;\n }\n }\n this.setSegments(parsedPath.segments, direction, parsedPath.queryString);\n return this.writeNavStateRoot(parsedPath.segments, direction, animation);\n }\n /** Go back to previous page in the window.history. */\n back() {\n window.history.back();\n return Promise.resolve(this.waitPromise);\n }\n /** @internal */\n async printDebug() {\n printRoutes(readRoutes(this.el));\n printRedirects(readRedirects(this.el));\n }\n /** @internal */\n async navChanged(direction) {\n if (this.busy) {\n console.warn('[ion-router] router is busy, navChanged was cancelled');\n return false;\n }\n const { ids, outlet } = await readNavState(window.document.body);\n const routes = readRoutes(this.el);\n const chain = findChainForIDs(ids, routes);\n if (!chain) {\n console.warn('[ion-router] no matching URL for ', ids.map((i) => i.id));\n return false;\n }\n const segments = chainToSegments(chain);\n if (!segments) {\n console.warn('[ion-router] router could not match path because some required param is missing');\n return false;\n }\n this.setSegments(segments, direction);\n await this.safeWriteNavState(outlet, chain, ROUTER_INTENT_NONE, segments, null, ids.length);\n return true;\n }\n /** This handler gets called when a `ion-route-redirect` component is added to the DOM or if the from or to property of such node changes. */\n onRedirectChanged() {\n const segments = this.getSegments();\n if (segments && findRouteRedirect(segments, readRedirects(this.el))) {\n this.writeNavStateRoot(segments, ROUTER_INTENT_NONE);\n }\n }\n /** This handler gets called when a `ion-route` component is added to the DOM or if the from or to property of such node changes. */\n onRoutesChanged() {\n return this.writeNavStateRoot(this.getSegments(), ROUTER_INTENT_NONE);\n }\n historyDirection() {\n var _a;\n const win = window;\n if (win.history.state === null) {\n this.state++;\n win.history.replaceState(this.state, win.document.title, (_a = win.document.location) === null || _a === void 0 ? void 0 : _a.href);\n }\n const state = win.history.state;\n const lastState = this.lastState;\n this.lastState = state;\n if (state > lastState || (state >= lastState && lastState > 0)) {\n return ROUTER_INTENT_FORWARD;\n }\n if (state < lastState) {\n return ROUTER_INTENT_BACK;\n }\n return ROUTER_INTENT_NONE;\n }\n async writeNavStateRoot(segments, direction, animation) {\n if (!segments) {\n console.error('[ion-router] URL is not part of the routing set');\n return false;\n }\n // lookup redirect rule\n const redirects = readRedirects(this.el);\n const redirect = findRouteRedirect(segments, redirects);\n let redirectFrom = null;\n if (redirect) {\n const { segments: toSegments, queryString } = redirect.to;\n this.setSegments(toSegments, direction, queryString);\n redirectFrom = redirect.from;\n segments = toSegments;\n }\n // lookup route chain\n const routes = readRoutes(this.el);\n const chain = findChainForSegments(segments, routes);\n if (!chain) {\n console.error('[ion-router] the path does not match any route');\n return false;\n }\n // write DOM give\n return this.safeWriteNavState(document.body, chain, direction, segments, redirectFrom, 0, animation);\n }\n async safeWriteNavState(node, chain, direction, segments, redirectFrom, index = 0, animation) {\n const unlock = await this.lock();\n let changed = false;\n try {\n changed = await this.writeNavState(node, chain, direction, segments, redirectFrom, index, animation);\n }\n catch (e) {\n console.error(e);\n }\n unlock();\n return changed;\n }\n async lock() {\n const p = this.waitPromise;\n let resolve;\n this.waitPromise = new Promise((r) => (resolve = r));\n if (p !== undefined) {\n await p;\n }\n return resolve;\n }\n /**\n * Executes the beforeLeave hook of the source route and the beforeEnter hook of the target route if they exist.\n *\n * When the beforeLeave hook does not return true (to allow navigating) then that value is returned early and the beforeEnter is executed.\n * Otherwise the beforeEnterHook hook of the target route is executed.\n */\n async runGuards(to = this.getSegments(), from) {\n if (from === undefined) {\n from = parsePath(this.previousPath).segments;\n }\n if (!to || !from) {\n return true;\n }\n const routes = readRoutes(this.el);\n const fromChain = findChainForSegments(from, routes);\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n const beforeLeaveHook = fromChain && fromChain[fromChain.length - 1].beforeLeave;\n const canLeave = beforeLeaveHook ? await beforeLeaveHook() : true;\n if (canLeave === false || typeof canLeave === 'object') {\n return canLeave;\n }\n const toChain = findChainForSegments(to, routes);\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n const beforeEnterHook = toChain && toChain[toChain.length - 1].beforeEnter;\n return beforeEnterHook ? beforeEnterHook() : true;\n }\n async writeNavState(node, chain, direction, segments, redirectFrom, index = 0, animation) {\n if (this.busy) {\n console.warn('[ion-router] router is busy, transition was cancelled');\n return false;\n }\n this.busy = true;\n // generate route event and emit will change\n const routeEvent = this.routeChangeEvent(segments, redirectFrom);\n if (routeEvent) {\n this.ionRouteWillChange.emit(routeEvent);\n }\n const changed = await writeNavState(node, chain, direction, index, false, animation);\n this.busy = false;\n // emit did change\n if (routeEvent) {\n this.ionRouteDidChange.emit(routeEvent);\n }\n return changed;\n }\n setSegments(segments, direction, queryString) {\n this.state++;\n writeSegments(window.history, this.root, this.useHash, segments, direction, this.state, queryString);\n }\n getSegments() {\n return readSegments(window.location, this.root, this.useHash);\n }\n routeChangeEvent(toSegments, redirectFromSegments) {\n const from = this.previousPath;\n const to = generatePath(toSegments);\n this.previousPath = to;\n if (to === from) {\n return null;\n }\n const redirectedFrom = redirectFromSegments ? generatePath(redirectFromSegments) : null;\n return {\n from,\n redirectedFrom,\n to,\n };\n }\n get el() { return getElement(this); }\n};\n\nconst routerLinkCss = \":host{--background:transparent;--color:var(--ion-color-primary, #0054e9);background:var(--background);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}a{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit}\";\nconst IonRouterLinkStyle0 = routerLinkCss;\n\nconst RouterLink = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.onClick = (ev) => {\n openURL(this.href, ev, this.routerDirection, this.routerAnimation);\n };\n this.color = undefined;\n this.href = undefined;\n this.rel = undefined;\n this.routerDirection = 'forward';\n this.routerAnimation = undefined;\n this.target = undefined;\n }\n render() {\n const mode = getIonMode(this);\n const attrs = {\n href: this.href,\n rel: this.rel,\n target: this.target,\n };\n return (h(Host, { key: '529ceed5beaf92d7b4cc315c82f449eac18310e8', onClick: this.onClick, class: createColorClasses(this.color, {\n [mode]: true,\n 'ion-activatable': true,\n }) }, h(\"a\", Object.assign({ key: 'd5f1f8b256695d70bdafd20ff3d1b625963fa2da' }, attrs), h(\"slot\", { key: '613fcdb36a71e076f989551ea21f1d5c118b1cd2' }))));\n }\n};\nRouterLink.style = IonRouterLinkStyle0;\n\nexport { Route as ion_route, RouteRedirect as ion_route_redirect, Router as ion_router, RouterLink as ion_router_link };\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,CAAC,IAAIC,gBAAgB,EAAEC,CAAC,IAAIC,WAAW,EAAEC,CAAC,IAAIC,UAAU,EAAEC,CAAC,E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