one 2.11.2 → 2.11.4
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/cjs/Root.cjs +1 -0
- package/dist/cjs/Root.native.cjs +1 -0
- package/dist/cjs/Root.native.js +1 -0
- package/dist/cjs/Root.native.js.map +1 -1
- package/dist/cjs/cli/buildPage.cjs +6 -1
- package/dist/cjs/cli/buildPage.native.cjs +6 -1
- package/dist/cjs/cli/buildPage.native.js +6 -1
- package/dist/cjs/cli/buildPage.native.js.map +1 -1
- package/dist/cjs/fork/useLinking.cjs +7 -1
- package/dist/cjs/router/router.cjs +3 -1
- package/dist/cjs/router/router.native.cjs +3 -1
- package/dist/cjs/router/router.native.js +3 -1
- package/dist/cjs/router/router.native.js.map +1 -1
- package/dist/esm/Root.mjs +1 -0
- package/dist/esm/Root.mjs.map +1 -1
- package/dist/esm/Root.native.js +1 -0
- package/dist/esm/Root.native.js.map +1 -1
- package/dist/esm/cli/buildPage.mjs +6 -1
- package/dist/esm/cli/buildPage.mjs.map +1 -1
- package/dist/esm/cli/buildPage.native.js +6 -1
- package/dist/esm/cli/buildPage.native.js.map +1 -1
- package/dist/esm/fork/useLinking.mjs +7 -1
- package/dist/esm/fork/useLinking.mjs.map +1 -1
- package/dist/esm/router/router.mjs +3 -1
- package/dist/esm/router/router.mjs.map +1 -1
- package/dist/esm/router/router.native.js +3 -1
- package/dist/esm/router/router.native.js.map +1 -1
- package/package.json +16 -16
- package/src/Root.tsx +2 -0
- package/src/cli/buildPage.ts +7 -2
- package/src/fork/useLinking.ts +13 -1
- package/src/router/router.ts +11 -3
- package/types/Root.d.ts.map +1 -1
- package/types/fork/useLinking.d.ts.map +1 -1
- package/types/router/router.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.native.js","names":[],"sources":["cjs/router/router.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar router_exports = {};\n__export(router_exports, {\n\tcanDismiss: () => canDismiss,\n\tcanGoBack: () => canGoBack,\n\tcleanup: () => cleanup,\n\tconsumePendingNavigationAction: () => consumePendingNavigationAction,\n\tdismiss: () => dismiss,\n\tdismissAll: () => dismissAll,\n\tgetPreloadHistory: () => getPreloadHistory,\n\tgetSafeWindowPathname: () => import_path3.getSafeWindowPathname,\n\tgetSortedRoutes: () => getSortedRoutes,\n\tgetValidationState: () => getValidationState,\n\tgoBack: () => goBack,\n\thandleNavigationContainerStateChange: () => handleNavigationContainerStateChange,\n\thasAttemptedToHideSplash: () => hasAttemptedToHideSplash,\n\tinitClientMatches: () => initClientMatches,\n\tinitialPathname: () => initialPathname,\n\tinitialState: () => initialState,\n\tinitialize: () => initialize,\n\tisRouteProtected: () => isRouteProtected,\n\tlastIntendedPathname: () => lastIntendedPathname,\n\tlinkTo: () => linkTo,\n\tnavigate: () => navigate,\n\tnavigationRef: () => navigationRef,\n\tnormalizeLoaderPath: () => normalizeLoaderPath,\n\tpreloadRoute: () => preloadRoute,\n\tpreloadedLoaderData: () => preloadedLoaderData,\n\tpreloadingLoader: () => preloadingLoader,\n\tpush: () => push,\n\tregisterProtectedRoutes: () => registerProtectedRoutes,\n\treplace: () => replace,\n\tresolveProtectedHref: () => resolveProtectedHref,\n\trootComponent: () => rootComponent,\n\trootState: () => rootState,\n\trootStateSnapshot: () => rootStateSnapshot,\n\trouteInfo: () => routeInfo,\n\trouteInfoSnapshot: () => routeInfoSnapshot,\n\trouteNode: () => routeNode,\n\tsetLoadingState: () => setLoadingState,\n\tsetParams: () => setParams,\n\tsetValidationState: () => setValidationState,\n\tsnapshot: () => snapshot,\n\tsubscribeToLoadingState: () => subscribeToLoadingState,\n\tsubscribeToRootState: () => subscribeToRootState,\n\tsubscribeToStore: () => subscribeToStore,\n\tsubscribeToValidationState: () => subscribeToValidationState,\n\tunregisterProtectedRoutes: () => unregisterProtectedRoutes,\n\tupdateState: () => updateState,\n\tuseOneRouter: () => useOneRouter,\n\tuseStoreRootState: () => useStoreRootState,\n\tuseStoreRouteInfo: () => useStoreRouteInfo,\n\tuseValidationState: () => useValidationState\n});\nmodule.exports = __toCommonJS(router_exports);\nvar import_native = require(\"@react-navigation/native\");\nvar import_react = require(\"react\");\nvar import_registry = require(\"../devtools/registry\");\nvar import_href = require(\"../link/href\");\nvar import_openExternalURL = require(\"../link/openExternalURL\");\nvar import_path = require(\"../link/path\");\nvar import_useBlocker = require(\"../useBlocker\");\nvar import_assertIsReady = require(\"../utils/assertIsReady\");\nvar import_cleanUrl = require(\"../utils/cleanUrl\");\nrequire(\"../utils/dynamicImport\");\nvar import_platform = require(\"../utils/platform\");\nvar import_skewProtection = require(\"../skewProtection\");\nvar import_url = require(\"../utils/url\");\nvar import_validateParams = require(\"../validateParams\");\nvar import_findRouteNode = require(\"./findRouteNode\");\nvar import_getRouteInfo = require(\"./getRouteInfo\");\nvar import_isStateAwaitingNavigatorMount = require(\"./isStateAwaitingNavigatorMount\");\nrequire(\"./getRouteArtifactPath\");\nvar import_getRoutes = require(\"./getRoutes\");\nvar import_lastAction = require(\"./lastAction\");\nvar import_linkingConfig = require(\"./linkingConfig\");\nvar import_path2 = require(\"./path\");\nvar import_sortRoutes = require(\"./sortRoutes\");\nvar import_useScreens = require(\"./useScreens\");\nrequire(\"./useViteRoutes\");\nvar import_getNavigateAction = require(\"./utils/getNavigateAction\");\nvar import_getNativeStackReplaceAction = require(\"./utils/getNativeStackReplaceAction\");\nvar import_useMatches = require(\"../useMatches\");\nvar import_interceptRoutes = require(\"./interceptRoutes\");\nvar import_Navigator = require(\"../views/Navigator\");\nvar import_notFoundState = require(\"../notFoundState\");\nvar import_path3 = require(\"./path\");\nvar routeNode = null;\nvar rootComponent;\nvar protectedRouteRegistry = /* @__PURE__ */ new Map();\nfunction registerProtectedRoutes(contextKey, guardedRedirects) {\n\tif (guardedRedirects.size === 0) protectedRouteRegistry.delete(contextKey);\n\telse protectedRouteRegistry.set(contextKey, guardedRedirects);\n}\nfunction unregisterProtectedRoutes(contextKey) {\n\tprotectedRouteRegistry.delete(contextKey);\n}\nfunction getProtectedRedirect(href) {\n\tvar normalizedHref = (0, import_findRouteNode.extractPathnameFromHref)(href).replace(/^\\/+|\\/+$/g, \"\");\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = protectedRouteRegistry[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar [contextKey, guardedRedirects] = _step.value;\n\t\t\tvar normalizedContextKey = contextKey.replace(/^\\/+|\\/+$/g, \"\");\n\t\t\tif (!normalizedContextKey || normalizedHref === normalizedContextKey || normalizedHref.startsWith(`${normalizedContextKey}/`)) {\n\t\t\t\tvar routeName = normalizedHref.slice(normalizedContextKey.length).replace(/^\\//, \"\").split(\"/\")[0] || \"index\";\n\t\t\t\tvar normalizedRouteName = routeName.replace(/\\/index$/, \"\");\n\t\t\t\tif (guardedRedirects.has(routeName)) return guardedRedirects.get(routeName);\n\t\t\t\tif (guardedRedirects.has(normalizedRouteName)) return guardedRedirects.get(normalizedRouteName);\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn false;\n}\nfunction resolveProtectedHref(href) {\n\tvar target = href;\n\tvar visited = /* @__PURE__ */ new Set();\n\twhile (!visited.has(target)) {\n\t\tvisited.add(target);\n\t\tvar redirectTo = getProtectedRedirect(target);\n\t\tif (redirectTo === false) return target;\n\t\tif (redirectTo === void 0) return;\n\t\ttarget = (0, import_href.resolveHref)(redirectTo);\n\t}\n}\nfunction isRouteProtected(href) {\n\treturn getProtectedRedirect(href) !== false;\n}\nvar hasAttemptedToHideSplash = false;\nvar initialState;\nvar rootState;\nvar initialPathname;\nvar lastIntendedPathname;\nvar nextState;\nvar routeInfo;\nvar splashScreenAnimationFrame;\nvar pendingNavigationPathname;\nvar pendingNavigationAction;\nvar navigationRef = null;\nvar rootStateSubscribers = /* @__PURE__ */ new Set();\nvar loadingStateSubscribers = /* @__PURE__ */ new Set();\nvar storeSubscribers = /* @__PURE__ */ new Set();\nvar currentMatches = [];\nvar validationState = { status: \"idle\" };\nvar validationStateSubscribers = /* @__PURE__ */ new Set();\nfunction subscribeToValidationState(subscriber) {\n\tvalidationStateSubscribers.add(subscriber);\n\treturn function() {\n\t\treturn validationStateSubscribers.delete(subscriber);\n\t};\n}\nfunction setValidationState(state) {\n\tvalidationState = state;\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = validationStateSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar subscriber = _step.value;\n\t\t\tsubscriber(state);\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n}\nfunction getValidationState() {\n\treturn validationState;\n}\nfunction useValidationState() {\n\treturn (0, import_react.useSyncExternalStore)(subscribeToValidationState, getValidationState, getValidationState);\n}\nvar cachedRouteNode = null;\nvar cachedRootComponent = null;\nvar cachedContext = null;\nfunction initialize(context, ref, initialLocation, linking) {\n\tcleanUpState();\n\tif (context !== cachedContext || !cachedRouteNode) {\n\t\tcachedRouteNode = (0, import_getRoutes.getRoutes)(context, {\n\t\t\tignoreEntryPoints: true,\n\t\t\tplatform: import_platform.PLATFORM\n\t\t});\n\t\tcachedRootComponent = cachedRouteNode ? (0, import_useScreens.getQualifiedRouteComponent)(cachedRouteNode) : import_react.Fragment;\n\t\tcachedContext = context;\n\t}\n\trouteNode = cachedRouteNode;\n\trootComponent = cachedRootComponent || import_react.Fragment;\n\tif (!routeNode && process.env.NODE_ENV === \"production\") throw new Error(\"No routes found\");\n\tif (process.env.ONE_DEBUG_ROUTER && routeNode) {\n\t\tvar _routeNode_slots;\n\t\tvar formatRouteTree = function formatRouteTree1(node) {\n\t\t\tvar indent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"\", isLast = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;\n\t\t\tvar _node_slots;\n\t\t\tvar prefix = indent + (isLast ? \"└─ \" : \"├─ \");\n\t\t\tvar childIndent = indent + (isLast ? \" \" : \"│ \");\n\t\t\tvar dynamicBadge = node.dynamic ? ` [${node.dynamic.map(function(d) {\n\t\t\t\treturn d.name;\n\t\t\t}).join(\", \")}]` : \"\";\n\t\t\tvar typeBadge = node.type !== \"layout\" ? ` (${node.type})` : \"\";\n\t\t\tvar slotsBadge = ((_node_slots = node.slots) === null || _node_slots === void 0 ? void 0 : _node_slots.size) ? ` {@${Array.from(node.slots.keys()).join(\", @\")}}` : \"\";\n\t\t\tvar line = `${prefix}${node.route || \"/\"}${dynamicBadge}${typeBadge}${slotsBadge}`;\n\t\t\tvar visibleChildren = node.children.filter(function(child2) {\n\t\t\t\treturn !child2.internal;\n\t\t\t});\n\t\t\tfor (var i = 0; i < visibleChildren.length; i++) {\n\t\t\t\tvar child = visibleChildren[i];\n\t\t\t\tvar childIsLast = i === visibleChildren.length - 1;\n\t\t\t\tline += \"\\n\" + formatRouteTree(child, childIndent, childIsLast);\n\t\t\t}\n\t\t\treturn line;\n\t\t};\n\t\tconsole.info(`[one] \\u{1F4CD} Route structure:\n${formatRouteTree(routeNode)}`);\n\t\tif ((_routeNode_slots = routeNode.slots) === null || _routeNode_slots === void 0 ? void 0 : _routeNode_slots.size) {\n\t\t\tconsole.info(`[one] \\u{1F4E6} Slots on root layout:`);\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = routeNode.slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar [slotName, slotConfig] = _step.value;\n\t\t\t\t\tvar _slotConfig_defaultRoute;\n\t\t\t\t\tconsole.info(` @${slotName}:`, {\n\t\t\t\t\t\tdefaultRoute: (_slotConfig_defaultRoute = slotConfig.defaultRoute) === null || _slotConfig_defaultRoute === void 0 ? void 0 : _slotConfig_defaultRoute.route,\n\t\t\t\t\t\tinterceptRoutes: slotConfig.interceptRoutes.map(function(r) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\troute: r.route,\n\t\t\t\t\t\t\t\tintercept: r.intercept\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t})\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tnavigationRef = ref;\n\tsetupLinkingAndRouteInfo(initialLocation, linking);\n\tsubscribeToNavigationChanges();\n}\nfunction cleanUpState() {\n\tinitialState = void 0;\n\tinitialPathname = void 0;\n\tlastIntendedPathname = void 0;\n\trootState = void 0;\n\tnextState = void 0;\n\trouteInfo = void 0;\n\tpendingNavigationPathname = void 0;\n\tpendingNavigationAction = void 0;\n\t(0, import_linkingConfig.resetLinking)();\n\trootStateSubscribers.clear();\n\tstoreSubscribers.clear();\n}\nfunction setupLinkingAndRouteInfo(initialLocation, linking) {\n\tvar _ref;\n\tinitialState = (0, import_linkingConfig.setupLinking)(routeNode, initialLocation, linking);\n\tinitialPathname = (_ref = initialLocation === null || initialLocation === void 0 ? void 0 : initialLocation.pathname) !== null && _ref !== void 0 ? _ref : (0, import_path2.getSafeWindowPathname)();\n\tif (initialState) {\n\t\trootState = initialState;\n\t\trouteInfo = (0, import_getRouteInfo.getRouteInfo)(initialState);\n\t} else routeInfo = {\n\t\tunstable_globalHref: \"\",\n\t\tpathname: \"\",\n\t\tisIndex: false,\n\t\tparams: {},\n\t\tsegments: []\n\t};\n}\nfunction handleNavigationContainerStateChange(navState) {\n\tif (!navState) return;\n\tvar state = { ...navState };\n\tif (state.key) {\n\t\tif (hashes[state.key]) {\n\t\t\tstate.hash = hashes[state.key];\n\t\t\tdelete hashes[state.key];\n\t\t}\n\t}\n\tif (!hasAttemptedToHideSplash) {\n\t\thasAttemptedToHideSplash = true;\n\t\tsplashScreenAnimationFrame = requestAnimationFrame(function() {});\n\t}\n\tif (shouldKeepPendingNavigationState(state)) return;\n\tif (nextOptions) {\n\t\tstate = {\n\t\t\t...state,\n\t\t\tlinkOptions: nextOptions\n\t\t};\n\t\tnextOptions = null;\n\t}\n\tvar shouldUpdateSubscribers = nextState === state;\n\tnextState = void 0;\n\tif (state && state !== rootState) {\n\t\tupdateState(state, void 0);\n\t\tshouldUpdateSubscribers = true;\n\t}\n\tif (shouldUpdateSubscribers) (0, import_react.startTransition)(function() {\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = rootStateSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar subscriber = _step.value;\n\t\t\t\tsubscriber(state);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t});\n}\nfunction subscribeToNavigationChanges() {\n\t(0, import_react.startTransition)(function() {\n\t\tupdateSnapshot();\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = storeSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar subscriber = _step.value;\n\t\t\t\tsubscriber();\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t});\n}\nfunction navigate(url, options) {\n\treturn linkTo((0, import_href.resolveHref)(url), \"NAVIGATE\", options);\n}\nfunction push(url, options) {\n\treturn linkTo((0, import_href.resolveHref)(url), \"PUSH\", options);\n}\nfunction dismiss(count) {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} dismiss${count ? ` (${count})` : \"\"}`);\n\tnavigationRef === null || navigationRef === void 0 || navigationRef.dispatch(import_native.StackActions.pop(count));\n}\nfunction replace(url, options) {\n\treturn linkTo((0, import_href.resolveHref)(url), \"REPLACE\", options);\n}\nfunction setParams() {\n\tvar params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\tvar _navigationRef_current;\n\t(0, import_assertIsReady.assertIsReady)(navigationRef);\n\treturn navigationRef === null || navigationRef === void 0 ? void 0 : (_navigationRef_current = navigationRef.current) === null || _navigationRef_current === void 0 ? void 0 : _navigationRef_current.setParams(\n\t\t// @ts-ignore\n\t\tparams\n\t);\n}\nfunction dismissAll() {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} dismissAll`);\n\tnavigationRef === null || navigationRef === void 0 || navigationRef.dispatch(import_native.StackActions.popToTop());\n}\nfunction goBack() {\n\tvar _navigationRef_current;\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} goBack`);\n\t(0, import_assertIsReady.assertIsReady)(navigationRef);\n\tnavigationRef === null || navigationRef === void 0 || (_navigationRef_current = navigationRef.current) == null || _navigationRef_current.goBack();\n}\nfunction canGoBack() {\n\tvar _ref;\n\tvar _navigationRef_current;\n\tif (!navigationRef.isReady()) return false;\n\treturn (_ref = navigationRef === null || navigationRef === void 0 ? void 0 : (_navigationRef_current = navigationRef.current) === null || _navigationRef_current === void 0 ? void 0 : _navigationRef_current.canGoBack()) !== null && _ref !== void 0 ? _ref : false;\n}\nfunction canDismiss() {\n\tvar state = rootState;\n\twhile (state) {\n\t\tvar _state_routes_state_index, _state_routes;\n\t\tif (state.type === \"stack\" && state.routes.length > 1) return true;\n\t\tif (state.index === void 0) return false;\n\t\tstate = (_state_routes = state.routes) === null || _state_routes === void 0 ? void 0 : (_state_routes_state_index = _state_routes[state.index]) === null || _state_routes_state_index === void 0 ? void 0 : _state_routes_state_index.state;\n\t}\n\treturn false;\n}\nfunction getSortedRoutes() {\n\tif (!routeNode) throw new Error(\"No routes\");\n\treturn routeNode.children.filter(function(route) {\n\t\treturn !route.internal;\n\t}).sort(import_sortRoutes.sortRoutes);\n}\nfunction updateState(state) {\n\tvar nextStateParam = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : state;\n\trootState = state;\n\tnextState = nextStateParam;\n\tif ((0, import_isStateAwaitingNavigatorMount.isStateAwaitingNavigatorMount)(state, routeNode)) {\n\t\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F9ED} keeping ${routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname}: a navigator has not mounted`);\n\t\treturn;\n\t}\n\tvar nextRouteInfo = (0, import_getRouteInfo.getRouteInfo)(state);\n\tif (pendingNavigationPathname === nextRouteInfo.pathname) pendingNavigationPathname = void 0;\n\tif (!deepEqual(routeInfo, nextRouteInfo)) {\n\t\tif (process.env.ONE_DEBUG_ROUTER) {\n\t\t\tvar from = (routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname) || \"(initial)\";\n\t\t\tvar to = nextRouteInfo.pathname;\n\t\t\tvar params = Object.keys(nextRouteInfo.params || {}).length ? nextRouteInfo.params : void 0;\n\t\t\tconsole.info(`[one] \\u{1F9ED} ${from} \\u2192 ${to}`, params ? { params } : \"\");\n\t\t}\n\t\trouteInfo = nextRouteInfo;\n\t\tvar params1 = (0, import_findRouteNode.extractParamsFromState)(state);\n\t\tvar newMatches = buildNativeMatches(state, nextRouteInfo.pathname, params1);\n\t\tcurrentMatches = newMatches;\n\t\t(0, import_useMatches.setClientMatches)(newMatches);\n\t}\n\tif (process.env.NODE_ENV === \"development\" && typeof window !== \"undefined\") window.__oneDevtools = Object.assign(window.__oneDevtools || {}, {\n\t\trouteInfo: nextRouteInfo,\n\t\trootState: state,\n\t\trouteNode,\n\t\tgetRoutes: function getRoutes2() {\n\t\t\treturn (routeNode === null || routeNode === void 0 ? void 0 : routeNode.children) || [];\n\t\t},\n\t\tgetLoaderTimingHistory: function getLoaderTimingHistory() {\n\t\t\tvar _ref;\n\t\t\tvar _devtoolsRegistry_getLoaderTimingHistory;\n\t\t\treturn (_ref = (_devtoolsRegistry_getLoaderTimingHistory = import_registry.devtoolsRegistry.getLoaderTimingHistory) === null || _devtoolsRegistry_getLoaderTimingHistory === void 0 ? void 0 : _devtoolsRegistry_getLoaderTimingHistory.call(import_registry.devtoolsRegistry)) !== null && _ref !== void 0 ? _ref : [];\n\t\t},\n\t\tgetPreloadHistory\n\t});\n}\nfunction consumePendingNavigationAction() {\n\tvar action = pendingNavigationAction;\n\tpendingNavigationAction = void 0;\n\treturn action;\n}\nfunction subscribeToRootState(subscriber) {\n\trootStateSubscribers.add(subscriber);\n\treturn function() {\n\t\trootStateSubscribers.delete(subscriber);\n\t};\n}\nfunction notifyRootStateSubscribers(state) {\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = rootStateSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar subscriber = _step.value;\n\t\t\tsubscriber(state);\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n}\nfunction subscribeToStore(subscriber) {\n\tstoreSubscribers.add(subscriber);\n\treturn function() {\n\t\tstoreSubscribers.delete(subscriber);\n\t};\n}\nfunction subscribeToLoadingState(subscriber) {\n\tloadingStateSubscribers.add(subscriber);\n\treturn function() {\n\t\tloadingStateSubscribers.delete(subscriber);\n\t};\n}\nfunction setLoadingState(state) {\n\t(0, import_react.startTransition)(function() {\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = loadingStateSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar listener = _step.value;\n\t\t\t\tlistener(state);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t});\n}\nvar currentSnapshot = null;\nfunction updateSnapshot() {\n\tcurrentSnapshot = getSnapshot();\n}\nfunction snapshot() {\n\treturn currentSnapshot;\n}\nfunction getSnapshot() {\n\treturn {\n\t\tlinkTo,\n\t\trouteNode,\n\t\trootComponent,\n\t\tlinking: (0, import_linkingConfig.getResolvedLinking)(),\n\t\thasAttemptedToHideSplash,\n\t\tinitialState,\n\t\trootState,\n\t\tnextState,\n\t\trouteInfo,\n\t\tsplashScreenAnimationFrame,\n\t\tnavigationRef,\n\t\trootStateSubscribers,\n\t\tstoreSubscribers\n\t};\n}\nfunction rootStateSnapshot() {\n\treturn rootState;\n}\nfunction routeInfoSnapshot() {\n\treturn routeInfo;\n}\nfunction getBrowserPathname() {\n\tvar pathname = (0, import_path2.getSafeWindowPathname)();\n\treturn pathname === void 0 ? void 0 : (0, import_path2.normalizeRoutePathname)(pathname);\n}\nfunction shouldKeepPendingNavigationState(currentState) {\n\tif (!pendingNavigationPathname) return false;\n\treturn (0, import_getRouteInfo.getRouteInfo)(currentState).pathname !== pendingNavigationPathname;\n}\nfunction shouldPreserveInitialRouteInfo(currentState) {\n\tif (!initialState || !(routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname)) return false;\n\tvar nextPathname = (0, import_getRouteInfo.getRouteInfo)(currentState).pathname;\n\tif (nextPathname === routeInfo.pathname) return false;\n\tif (nextPathname && nextPathname === pendingNavigationPathname) return false;\n\tvar browserPathname = getBrowserPathname();\n\tif (nextPathname && browserPathname && nextPathname === browserPathname) return false;\n\treturn true;\n}\nfunction useOneRouter() {\n\tvar state = (0, import_react.useSyncExternalStore)(subscribeToStore, snapshot, snapshot);\n\treturn (0, import_react.useDeferredValue)(state);\n}\nfunction syncStoreRootState() {\n\tif (!navigationRef) throw new Error(`No navigationRef, possible duplicate One dep`);\n\tif (navigationRef.isReady()) {\n\t\tvar currentState = navigationRef.getRootState();\n\t\tif (rootState !== currentState) {\n\t\t\tif (shouldKeepPendingNavigationState(currentState)) return;\n\t\t\tif (shouldPreserveInitialRouteInfo(currentState)) return;\n\t\t\tupdateState(currentState);\n\t\t}\n\t}\n}\nfunction useRootStateSnapshot(snapshot2) {\n\tvar [state, rerender] = (0, import_react.useReducer)(snapshot2, void 0, snapshot2);\n\t(0, import_react.useEffect)(function() {\n\t\tvar unsubscribe = subscribeToRootState(rerender);\n\t\trerender();\n\t\treturn unsubscribe;\n\t}, []);\n\tvar browserPath = (0, import_path2.getSafeWindowPath)();\n\treturn browserPath !== void 0 && (routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.unstable_globalHref) === browserPath + window.location.hash ? snapshot2() : state;\n}\nfunction useStoreRootState() {\n\tsyncStoreRootState();\n\treturn (0, import_react.useDeferredValue)(useRootStateSnapshot(rootStateSnapshot));\n}\nfunction useStoreRouteInfo() {\n\tsyncStoreRootState();\n\treturn useRootStateSnapshot(routeInfoSnapshot);\n}\nfunction cleanup() {\n\tif (splashScreenAnimationFrame) cancelAnimationFrame(splashScreenAnimationFrame);\n}\nvar preloadingLoader = {};\nvar preloadedLoaderData = {};\nvar cssInjectFunctions = {};\nvar preloadHistory = [];\nfunction getPreloadHistory() {\n\treturn preloadHistory;\n}\nfunction preloadRoute(href) {\n\targuments.length > 1 && arguments[1] !== void 0 && arguments[1];\n}\nfunction isSsrHref(href) {\n\tvar _findRouteNodeFromState;\n\tvar linking = (0, import_linkingConfig.getResolvedLinking)();\n\tif (!(linking === null || linking === void 0 ? void 0 : linking.getStateFromPath) || !routeNode) return false;\n\tvar state = linking.getStateFromPath(href, linking.config);\n\treturn ((_findRouteNodeFromState = (0, import_findRouteNode.findRouteNodeFromState)(state, routeNode)) === null || _findRouteNodeFromState === void 0 ? void 0 : _findRouteNodeFromState.type) === \"ssr\";\n}\nfunction normalizeLoaderPath(href) {\n\tvar url = new URL(href, \"http://example.com\");\n\tvar path = url.pathname.replace(/\\/index$/, \"\").replace(/\\/$/, \"\") || \"/\";\n\treturn url.search && isSsrHref(href) ? (0, import_cleanUrl.toLoaderKey)(path, url.search) : path;\n}\nfunction buildClientMatches(href, matchingNode, params, loaderData) {\n\tvar pathname = (0, import_findRouteNode.extractPathnameFromHref)(href);\n\tvar routeId = (matchingNode === null || matchingNode === void 0 ? void 0 : matchingNode.contextKey) || pathname;\n\tvar layoutMatches = currentMatches.filter(function(m) {\n\t\treturn m.routeId.includes(\"_layout\");\n\t});\n\tvar pageMatch = {\n\t\trouteId,\n\t\tpathname,\n\t\tparams,\n\t\tloaderData\n\t};\n\treturn [...layoutMatches, pageMatch];\n}\nfunction buildNativeMatches(state, pathname, params) {\n\treturn (0, import_findRouteNode.findAllRouteNodesFromState)(state, routeNode).map(function(node) {\n\t\treturn {\n\t\t\trouteId: node.contextKey || pathname,\n\t\t\tpathname,\n\t\t\tparams,\n\t\t\tloaderData: void 0\n\t\t};\n\t});\n}\nfunction initClientMatches(matches) {\n\tcurrentMatches = matches;\n\t(0, import_useMatches.setClientMatches)(matches);\n}\nasync function linkTo(href, event, options) {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F517} ${event || \"NAVIGATE\"} ${href}`);\n\t(0, import_interceptRoutes.setNavigationType)(\"soft\");\n\t(0, import_notFoundState.clearNotFoundState)();\n\tif (href[0] === \"#\") return;\n\tif ((0, import_url.shouldLinkExternally)(href)) {\n\t\t(0, import_openExternalURL.openExternalURL)(href);\n\t\treturn;\n\t}\n\tif ((0, import_skewProtection.isVersionStale)()) {\n\t\twindow.location.href = href;\n\t\treturn;\n\t}\n\tif ((0, import_useBlocker.checkBlocker)(href, event === \"REPLACE\" ? \"replace\" : \"push\")) return;\n\tvar protectedHref = resolveProtectedHref(href);\n\tif (!protectedHref) return;\n\tif (protectedHref !== href) return linkTo(protectedHref, \"REPLACE\", options);\n\tvar currentLayoutNode = routeNode;\n\tvar currentPath = (routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname) || \"/\";\n\tvar interceptResult = (0, import_interceptRoutes.findInterceptRoute)(href, currentLayoutNode, currentPath);\n\tif (interceptResult) {\n\t\tvar { interceptRoute, slotName, layoutContextKey, params } = interceptResult;\n\t\tvar scopedSlotKey = `${layoutContextKey}:${slotName}`;\n\t\t(0, import_interceptRoutes.storeInterceptState)(scopedSlotKey, interceptRoute, params);\n\t\t(0, import_interceptRoutes.updateURLWithoutNavigation)(href);\n\t\t(0, import_Navigator.setSlotState)(scopedSlotKey, {\n\t\t\tactiveRouteKey: interceptRoute.contextKey,\n\t\t\tactiveRouteNode: interceptRoute,\n\t\t\tparams,\n\t\t\tisIntercepted: true\n\t\t});\n\t\treturn;\n\t}\n\t(0, import_assertIsReady.assertIsReady)(navigationRef);\n\tvar current = navigationRef.current;\n\tif (current == null) throw new Error(\"Couldn't find a navigation object. Is your component inside NavigationContainer?\");\n\tvar linking = (0, import_linkingConfig.getResolvedLinking)();\n\tif (!linking) throw new Error(\"Attempted to link to route when no routes are present\");\n\t(0, import_lastAction.setLastAction)();\n\tif (href === \"..\" || href === \"../\") {\n\t\tcurrent.goBack();\n\t\treturn;\n\t}\n\tif (href.startsWith(\".\")) {\n\t\tvar _ref;\n\t\tvar _routeInfo_segments;\n\t\tvar base = (_ref = routeInfo === null || routeInfo === void 0 ? void 0 : (_routeInfo_segments = routeInfo.segments) === null || _routeInfo_segments === void 0 ? void 0 : _routeInfo_segments.map(function(segment) {\n\t\t\tvar _routeInfo_params;\n\t\t\tif (!segment.startsWith(\"[\")) return segment;\n\t\t\tif (segment.startsWith(\"[...\")) {\n\t\t\t\tvar _ref2;\n\t\t\t\tvar _routeInfo_params1, _params_split;\n\t\t\t\tsegment = segment.slice(4, -1);\n\t\t\t\tvar params3 = routeInfo === null || routeInfo === void 0 ? void 0 : (_routeInfo_params1 = routeInfo.params) === null || _routeInfo_params1 === void 0 ? void 0 : _routeInfo_params1[segment];\n\t\t\t\tif (Array.isArray(params3)) return params3.join(\"/\");\n\t\t\t\treturn (_ref2 = params3 === null || params3 === void 0 ? void 0 : (_params_split = params3.split(\",\")) === null || _params_split === void 0 ? void 0 : _params_split.join(\"/\")) !== null && _ref2 !== void 0 ? _ref2 : \"\";\n\t\t\t}\n\t\t\tsegment = segment.slice(1, -1);\n\t\t\treturn routeInfo === null || routeInfo === void 0 ? void 0 : (_routeInfo_params = routeInfo.params) === null || _routeInfo_params === void 0 ? void 0 : _routeInfo_params[segment];\n\t\t}).filter(Boolean).join(\"/\")) !== null && _ref !== void 0 ? _ref : \"/\";\n\t\tif (!(routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.isIndex)) base += \"/..\";\n\t\thref = (0, import_path.resolve)(base, href);\n\t}\n\tvar state = linking.getStateFromPath(href, linking.config);\n\tif (!state || state.routes.length === 0) {\n\t\tconsole.error(\"Could not generate a valid navigation state for the given path: \" + href);\n\t\tconsole.error(`linking.config`, linking.config);\n\t\tconsole.error(`routes`, getSortedRoutes());\n\t\treturn;\n\t}\n\tsetLoadingState(\"loading\");\n\tvar normalizedPreloadPath = normalizeLoaderPath(href);\n\tif (!(normalizedPreloadPath in preloadedLoaderData) && !(href in preloadedLoaderData)) {\n\t\tvar preloaded = await preloadRoute(href, true);\n\t\tif ((0, import_cleanUrl.isLoaderBadRequest)(preloaded)) {\n\t\t\tsetLoadingState(\"loaded\");\n\t\t\twindow.location.assign(href);\n\t\t\treturn;\n\t\t}\n\t} else if (process.env.NODE_ENV !== \"development\") {\n\t\tvar inject = cssInjectFunctions[href];\n\t\tif (inject) inject().catch(function() {});\n\t}\n\tvar preloadResult = preloadedLoaderData[normalizedPreloadPath];\n\tif (preloadResult === null || preloadResult === void 0 ? void 0 : preloadResult.__oneRedirect) {\n\t\tvar redirectTarget = preloadResult.__oneRedirect;\n\t\tdelete preloadedLoaderData[normalizedPreloadPath];\n\t\tdelete preloadingLoader[normalizedPreloadPath];\n\t\tdelete preloadedLoaderData[href];\n\t\tdelete preloadingLoader[href];\n\t\tsetLoadingState(\"loaded\");\n\t\tlinkTo(redirectTarget, \"REPLACE\");\n\t\treturn;\n\t}\n\tif ((preloadResult === null || preloadResult === void 0 ? void 0 : preloadResult.__oneError) === 404) {\n\t\tdelete preloadedLoaderData[normalizedPreloadPath];\n\t\tdelete preloadingLoader[normalizedPreloadPath];\n\t\tdelete preloadedLoaderData[href];\n\t\tdelete preloadingLoader[href];\n\t\tsetLoadingState(\"loaded\");\n\t\tvar notFoundRoute = (0, import_notFoundState.findNearestNotFoundRoute)(href, routeNode);\n\t\t(0, import_notFoundState.setNotFoundState)({\n\t\t\tnotFoundPath: preloadResult.__oneNotFoundPath || \"/+not-found\",\n\t\t\tnotFoundRouteNode: notFoundRoute || void 0,\n\t\t\toriginalPath: href\n\t\t});\n\t\treturn;\n\t}\n\tvar matchingRouteNode = (0, import_findRouteNode.findRouteNodeFromState)(state, routeNode);\n\tvar isColdRoute = false;\n\tif (matchingRouteNode === null || matchingRouteNode === void 0 ? void 0 : matchingRouteNode.loadRoute) {\n\t\tsetValidationState({\n\t\t\tstatus: \"validating\",\n\t\t\tlastValidatedHref: href\n\t\t});\n\t\ttry {\n\t\t\tvar loadedRoute = matchingRouteNode.loadRoute();\n\t\t\tvar params1 = (0, import_findRouteNode.extractParamsFromState)(state);\n\t\t\tvar search = (0, import_findRouteNode.extractSearchFromHref)(href);\n\t\t\tvar pathname = (0, import_findRouteNode.extractPathnameFromHref)(href);\n\t\t\tif (loadedRoute.validateParams) (0, import_validateParams.validateParams)(loadedRoute.validateParams, params1);\n\t\t\tif (loadedRoute.validateRoute) {\n\t\t\t\tvar validationResult = await loadedRoute.validateRoute({\n\t\t\t\t\tparams: params1,\n\t\t\t\t\tsearch,\n\t\t\t\t\tpathname,\n\t\t\t\t\thref\n\t\t\t\t});\n\t\t\t\tif (validationResult && !validationResult.valid) {\n\t\t\t\t\tvar _$error = new import_validateParams.RouteValidationError(validationResult.error || \"Route validation failed\", validationResult.details);\n\t\t\t\t\tsetValidationState({\n\t\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\t\terror: _$error,\n\t\t\t\t\t\tlastValidatedHref: href\n\t\t\t\t\t});\n\t\t\t\t\tthrow _$error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetValidationState({\n\t\t\t\tstatus: \"valid\",\n\t\t\t\tlastValidatedHref: href\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error && typeof error.then === \"function\") {\n\t\t\t\tisColdRoute = true;\n\t\t\t\tvar routeLoading = error.catch(function() {});\n\t\t\t\tif (process.env.NODE_ENV !== \"development\" || process.env.ONE_SUSPEND_ROUTES_NATIVE === \"0\" || globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ === true) await routeLoading;\n\t\t\t\tsetValidationState({\n\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\tlastValidatedHref: href\n\t\t\t\t});\n\t\t\t} else if (error instanceof import_validateParams.ParamValidationError || error instanceof import_validateParams.RouteValidationError) {\n\t\t\t\tsetValidationState({\n\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\terror,\n\t\t\t\t\tlastValidatedHref: href\n\t\t\t\t});\n\t\t\t\tthrow error;\n\t\t\t} else throw error;\n\t\t}\n\t}\n\tvar loaderData = preloadedLoaderData[normalizeLoaderPath(href)];\n\tvar params2 = (0, import_findRouteNode.extractParamsFromState)(state);\n\tvar newMatches = buildClientMatches(href, matchingRouteNode, params2, loaderData);\n\tcurrentMatches = newMatches;\n\t(0, import_useMatches.setClientMatches)(newMatches);\n\tif (!navigationRef.isReady()) {\n\t\tsetLoadingState(\"loaded\");\n\t\treturn;\n\t}\n\tvar currentRootState = navigationRef.getRootState();\n\tvar hash = href.indexOf(\"#\");\n\tif ((currentRootState === null || currentRootState === void 0 ? void 0 : currentRootState.key) && hash > 0) hashes[currentRootState.key] = href.slice(hash);\n\tnextOptions = options !== null && options !== void 0 ? options : null;\n\tpendingNavigationPathname = (0, import_path2.stripTrailingSlash)((0, import_findRouteNode.extractPathnameFromHref)(href));\n\tpendingNavigationAction = event === \"PUSH\" || event === \"REPLACE\" || event === \"NAVIGATE\" ? event : void 0;\n\tlastIntendedPathname = pendingNavigationPathname;\n\tvar freshRootState = navigationRef.getRootState();\n\tvar currentRouteBeforeDispatch = navigationRef.getCurrentRoute();\n\tvar targetPathname = pendingNavigationPathname;\n\tvar optimisticState = nextOptions ? {\n\t\t...state,\n\t\tlinkOptions: nextOptions\n\t} : state;\n\tvar action = event === \"REPLACE\" ? !isColdRoute ? (0, import_getNativeStackReplaceAction.getNativeStackReplaceAction)(state, freshRootState) : null : (0, import_getNavigateAction.getNavigateAction)(state, freshRootState, event);\n\t(0, import_react.startTransition)(function() {\n\t\tupdateState(optimisticState);\n\t\tpendingNavigationPathname = targetPathname;\n\t\tnotifyRootStateSubscribers(optimisticState);\n\t\tif (!action) navigationRef.resetRoot(state);\n\t\telse {\n\t\t\tvar _action_payload;\n\t\t\tvar targetName = (_action_payload = action.payload) === null || _action_payload === void 0 ? void 0 : _action_payload.name;\n\t\t\tvar isGroupTarget = typeof targetName === \"string\" && targetName.startsWith(\"(\") && targetName.endsWith(\")\");\n\t\t\tvar hasFreshRootState = freshRootState.type === \"stack\";\n\t\t\tvar isRootTarget = action.target === freshRootState.key;\n\t\t\tvar currentFocusedRoute = freshRootState.routes[freshRootState.index];\n\t\t\tvar currentFocusedName = currentFocusedRoute === null || currentFocusedRoute === void 0 ? void 0 : currentFocusedRoute.name;\n\t\t\tif (event !== \"REPLACE\" && isRootTarget && isGroupTarget && hasFreshRootState) {\n\t\t\t\tvar _state_index;\n\t\t\t\tvar targetRoute = state.routes[(_state_index = state.index) !== null && _state_index !== void 0 ? _state_index : state.routes.length - 1];\n\t\t\t\tvar targetRootName = targetRoute.name;\n\t\t\t\tif (currentFocusedName === targetRootName) {\n\t\t\t\t\tvar _ref2;\n\t\t\t\t\tvar routes = [...freshRootState.routes];\n\t\t\t\t\troutes[freshRootState.index] = {\n\t\t\t\t\t\t...targetRoute,\n\t\t\t\t\t\tkey: (_ref2 = currentFocusedRoute === null || currentFocusedRoute === void 0 ? void 0 : currentFocusedRoute.key) !== null && _ref2 !== void 0 ? _ref2 : targetRoute.key\n\t\t\t\t\t};\n\t\t\t\t\tnavigationRef.resetRoot({\n\t\t\t\t\t\t...freshRootState,\n\t\t\t\t\t\troutes\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tvar _ref1;\n\t\t\t\t\tvar existingTargetRoute = freshRootState.routes.find(function(route) {\n\t\t\t\t\t\treturn route.name === targetRootName;\n\t\t\t\t\t});\n\t\t\t\t\tvar existingRoutes = freshRootState.routes.filter(function(route) {\n\t\t\t\t\t\treturn route.name !== targetRootName;\n\t\t\t\t\t});\n\t\t\t\t\tvar nextRootState = {\n\t\t\t\t\t\t...freshRootState,\n\t\t\t\t\t\troutes: [...existingRoutes, {\n\t\t\t\t\t\t\t...targetRoute,\n\t\t\t\t\t\t\tkey: (_ref1 = existingTargetRoute === null || existingTargetRoute === void 0 ? void 0 : existingTargetRoute.key) !== null && _ref1 !== void 0 ? _ref1 : `${targetRootName}-${freshRootState.key}`\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tindex: existingRoutes.length\n\t\t\t\t\t};\n\t\t\t\t\tnavigationRef.resetRoot(nextRootState);\n\t\t\t\t}\n\t\t\t} else navigationRef.dispatch(action);\n\t\t}\n\t});\n\tvar warningTm;\n\tvar interval = setInterval(function() {\n\t\tif (!navigationRef.isReady()) {\n\t\t\tclearTimeout(warningTm);\n\t\t\tclearInterval(interval);\n\t\t\treturn;\n\t\t}\n\t\tif (currentRouteBeforeDispatch !== navigationRef.getCurrentRoute()) setTimeout(function() {\n\t\t\tsetLoadingState(\"loaded\");\n\t\t});\n\t\tclearTimeout(warningTm);\n\t\tclearInterval(interval);\n\t}, 16);\n\tif (process.env.NODE_ENV === \"development\") warningTm = setTimeout(function() {\n\t\tconsole.warn(`Routing took more than 8 seconds`);\n\t}, 1e3);\n}\nvar hashes = {};\nvar nextOptions = null;\nfunction deepEqual(a, b) {\n\tif (a === b) return true;\n\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\tif (a.length !== b.length) return false;\n\t\tfor (var i = 0; i < a.length; i++) if (!deepEqual(a[i], b[i])) return false;\n\t\treturn true;\n\t}\n\tif (typeof a === \"object\" && typeof b === \"object\") {\n\t\tvar keysA = Object.keys(a);\n\t\tvar keysB = Object.keys(b);\n\t\tif (keysA.length !== keysB.length) return false;\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = keysA[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar key = _step.value;\n\t\t\t\tif (!deepEqual(a[key], b[key])) return false;\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\treturn false;\n}\n//# sourceMappingURL=router.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,e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AACd,IAAI,cAAc;AAClB,SAAS,UAAU,GAAG,GAAG;CACxB,IAAI,MAAM,GAAG,OAAO;CACpB,IAAI,MAAM,QAAQ,CAAC,KAAK,MAAM,QAAQ,CAAC,GAAG;EACzC,IAAI,EAAE,WAAW,EAAE,QAAQ,OAAO;EAClC,KAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO;EACtE,OAAO;CACR;CACA,IAAI,OAAO,MAAM,YAAY,OAAO,MAAM,UAAU;EACnD,IAAI,QAAQ,OAAO,KAAK,CAAC;EACzB,IAAI,QAAQ,OAAO,KAAK,CAAC;EACzB,IAAI,MAAM,WAAW,MAAM,QAAQ,OAAO;EAC1C,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACH,KAAK,IAAI,YAAY,MAAM,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IACvJ,IAAI,MAAM,MAAM;IAChB,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO;GACxC;EACD,SAAS,KAAK;GACb,oBAAoB;GACpB,iBAAiB;EAClB,UAAU;GACT,IAAI;IACH,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM,UAAU,OAAO;GAC9E,UAAU;IACT,IAAI,mBAAmB,MAAM;GAC9B;EACD;EACA,OAAO;CACR;CACA,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"router.native.js","names":[],"sources":["cjs/router/router.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar router_exports = {};\n__export(router_exports, {\n\tcanDismiss: () => canDismiss,\n\tcanGoBack: () => canGoBack,\n\tcleanup: () => cleanup,\n\tconsumePendingNavigationAction: () => consumePendingNavigationAction,\n\tdismiss: () => dismiss,\n\tdismissAll: () => dismissAll,\n\tgetPreloadHistory: () => getPreloadHistory,\n\tgetSafeWindowPathname: () => import_path3.getSafeWindowPathname,\n\tgetSortedRoutes: () => getSortedRoutes,\n\tgetValidationState: () => getValidationState,\n\tgoBack: () => goBack,\n\thandleNavigationContainerStateChange: () => handleNavigationContainerStateChange,\n\thasAttemptedToHideSplash: () => hasAttemptedToHideSplash,\n\tinitClientMatches: () => initClientMatches,\n\tinitialPathname: () => initialPathname,\n\tinitialState: () => initialState,\n\tinitialize: () => initialize,\n\tisRouteProtected: () => isRouteProtected,\n\tlastIntendedPathname: () => lastIntendedPathname,\n\tlinkTo: () => linkTo,\n\tnavigate: () => navigate,\n\tnavigationRef: () => navigationRef,\n\tnormalizeLoaderPath: () => normalizeLoaderPath,\n\tpreloadRoute: () => preloadRoute,\n\tpreloadedLoaderData: () => preloadedLoaderData,\n\tpreloadingLoader: () => preloadingLoader,\n\tpush: () => push,\n\tregisterProtectedRoutes: () => registerProtectedRoutes,\n\treplace: () => replace,\n\tresolveProtectedHref: () => resolveProtectedHref,\n\trootComponent: () => rootComponent,\n\trootState: () => rootState,\n\trootStateSnapshot: () => rootStateSnapshot,\n\trouteInfo: () => routeInfo,\n\trouteInfoSnapshot: () => routeInfoSnapshot,\n\trouteNode: () => routeNode,\n\tsetLoadingState: () => setLoadingState,\n\tsetParams: () => setParams,\n\tsetValidationState: () => setValidationState,\n\tsnapshot: () => snapshot,\n\tsubscribeToLoadingState: () => subscribeToLoadingState,\n\tsubscribeToRootState: () => subscribeToRootState,\n\tsubscribeToStore: () => subscribeToStore,\n\tsubscribeToValidationState: () => subscribeToValidationState,\n\tunregisterProtectedRoutes: () => unregisterProtectedRoutes,\n\tupdateState: () => updateState,\n\tuseOneRouter: () => useOneRouter,\n\tuseStoreRootState: () => useStoreRootState,\n\tuseStoreRouteInfo: () => useStoreRouteInfo,\n\tuseValidationState: () => useValidationState\n});\nmodule.exports = __toCommonJS(router_exports);\nvar import_native = require(\"@react-navigation/native\");\nvar import_react = require(\"react\");\nvar import_registry = require(\"../devtools/registry\");\nvar import_href = require(\"../link/href\");\nvar import_openExternalURL = require(\"../link/openExternalURL\");\nvar import_path = require(\"../link/path\");\nvar import_useBlocker = require(\"../useBlocker\");\nvar import_assertIsReady = require(\"../utils/assertIsReady\");\nvar import_cleanUrl = require(\"../utils/cleanUrl\");\nrequire(\"../utils/dynamicImport\");\nvar import_platform = require(\"../utils/platform\");\nvar import_skewProtection = require(\"../skewProtection\");\nvar import_url = require(\"../utils/url\");\nvar import_validateParams = require(\"../validateParams\");\nvar import_findRouteNode = require(\"./findRouteNode\");\nvar import_getRouteInfo = require(\"./getRouteInfo\");\nvar import_isStateAwaitingNavigatorMount = require(\"./isStateAwaitingNavigatorMount\");\nrequire(\"./getRouteArtifactPath\");\nvar import_getRoutes = require(\"./getRoutes\");\nvar import_lastAction = require(\"./lastAction\");\nvar import_linkingConfig = require(\"./linkingConfig\");\nvar import_path2 = require(\"./path\");\nvar import_sortRoutes = require(\"./sortRoutes\");\nvar import_useScreens = require(\"./useScreens\");\nrequire(\"./useViteRoutes\");\nvar import_getNavigateAction = require(\"./utils/getNavigateAction\");\nvar import_getNativeStackReplaceAction = require(\"./utils/getNativeStackReplaceAction\");\nvar import_useMatches = require(\"../useMatches\");\nvar import_interceptRoutes = require(\"./interceptRoutes\");\nvar import_Navigator = require(\"../views/Navigator\");\nvar import_notFoundState = require(\"../notFoundState\");\nvar import_path3 = require(\"./path\");\nvar routeNode = null;\nvar rootComponent;\nvar protectedRouteRegistry = /* @__PURE__ */ new Map();\nfunction registerProtectedRoutes(contextKey, guardedRedirects) {\n\tif (guardedRedirects.size === 0) protectedRouteRegistry.delete(contextKey);\n\telse protectedRouteRegistry.set(contextKey, guardedRedirects);\n}\nfunction unregisterProtectedRoutes(contextKey) {\n\tprotectedRouteRegistry.delete(contextKey);\n}\nfunction getProtectedRedirect(href) {\n\tvar normalizedHref = (0, import_findRouteNode.extractPathnameFromHref)(href).replace(/^\\/+|\\/+$/g, \"\");\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = protectedRouteRegistry[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar [contextKey, guardedRedirects] = _step.value;\n\t\t\tvar normalizedContextKey = contextKey.replace(/^\\/+|\\/+$/g, \"\");\n\t\t\tif (!normalizedContextKey || normalizedHref === normalizedContextKey || normalizedHref.startsWith(`${normalizedContextKey}/`)) {\n\t\t\t\tvar routeName = normalizedHref.slice(normalizedContextKey.length).replace(/^\\//, \"\").split(\"/\")[0] || \"index\";\n\t\t\t\tvar normalizedRouteName = routeName.replace(/\\/index$/, \"\");\n\t\t\t\tif (guardedRedirects.has(routeName)) return guardedRedirects.get(routeName);\n\t\t\t\tif (guardedRedirects.has(normalizedRouteName)) return guardedRedirects.get(normalizedRouteName);\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn false;\n}\nfunction resolveProtectedHref(href) {\n\tvar target = href;\n\tvar visited = /* @__PURE__ */ new Set();\n\twhile (!visited.has(target)) {\n\t\tvisited.add(target);\n\t\tvar redirectTo = getProtectedRedirect(target);\n\t\tif (redirectTo === false) return target;\n\t\tif (redirectTo === void 0) return;\n\t\ttarget = (0, import_href.resolveHref)(redirectTo);\n\t}\n}\nfunction isRouteProtected(href) {\n\treturn getProtectedRedirect(href) !== false;\n}\nvar hasAttemptedToHideSplash = false;\nvar initialState;\nvar rootState;\nvar initialPathname;\nvar lastIntendedPathname;\nvar nextState;\nvar routeInfo;\nvar splashScreenAnimationFrame;\nvar pendingNavigationPathname;\nvar pendingNavigationAction;\nvar navigationRef = null;\nvar rootStateSubscribers = /* @__PURE__ */ new Set();\nvar loadingStateSubscribers = /* @__PURE__ */ new Set();\nvar storeSubscribers = /* @__PURE__ */ new Set();\nvar currentMatches = [];\nvar validationState = { status: \"idle\" };\nvar validationStateSubscribers = /* @__PURE__ */ new Set();\nfunction subscribeToValidationState(subscriber) {\n\tvalidationStateSubscribers.add(subscriber);\n\treturn function() {\n\t\treturn validationStateSubscribers.delete(subscriber);\n\t};\n}\nfunction setValidationState(state) {\n\tvalidationState = state;\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = validationStateSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar subscriber = _step.value;\n\t\t\tsubscriber(state);\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n}\nfunction getValidationState() {\n\treturn validationState;\n}\nfunction useValidationState() {\n\treturn (0, import_react.useSyncExternalStore)(subscribeToValidationState, getValidationState, getValidationState);\n}\nvar cachedRouteNode = null;\nvar cachedRootComponent = null;\nvar cachedContext = null;\nfunction initialize(context, ref, initialLocation, linking) {\n\tcleanUpState();\n\tif (context !== cachedContext || !cachedRouteNode) {\n\t\tcachedRouteNode = (0, import_getRoutes.getRoutes)(context, {\n\t\t\tignoreEntryPoints: true,\n\t\t\tplatform: import_platform.PLATFORM\n\t\t});\n\t\tcachedRootComponent = cachedRouteNode ? (0, import_useScreens.getQualifiedRouteComponent)(cachedRouteNode) : import_react.Fragment;\n\t\tcachedContext = context;\n\t}\n\trouteNode = cachedRouteNode;\n\trootComponent = cachedRootComponent || import_react.Fragment;\n\tif (!routeNode && process.env.NODE_ENV === \"production\") throw new Error(\"No routes found\");\n\tif (process.env.ONE_DEBUG_ROUTER && routeNode) {\n\t\tvar _routeNode_slots;\n\t\tvar formatRouteTree = function formatRouteTree1(node) {\n\t\t\tvar indent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"\", isLast = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;\n\t\t\tvar _node_slots;\n\t\t\tvar prefix = indent + (isLast ? \"└─ \" : \"├─ \");\n\t\t\tvar childIndent = indent + (isLast ? \" \" : \"│ \");\n\t\t\tvar dynamicBadge = node.dynamic ? ` [${node.dynamic.map(function(d) {\n\t\t\t\treturn d.name;\n\t\t\t}).join(\", \")}]` : \"\";\n\t\t\tvar typeBadge = node.type !== \"layout\" ? ` (${node.type})` : \"\";\n\t\t\tvar slotsBadge = ((_node_slots = node.slots) === null || _node_slots === void 0 ? void 0 : _node_slots.size) ? ` {@${Array.from(node.slots.keys()).join(\", @\")}}` : \"\";\n\t\t\tvar line = `${prefix}${node.route || \"/\"}${dynamicBadge}${typeBadge}${slotsBadge}`;\n\t\t\tvar visibleChildren = node.children.filter(function(child2) {\n\t\t\t\treturn !child2.internal;\n\t\t\t});\n\t\t\tfor (var i = 0; i < visibleChildren.length; i++) {\n\t\t\t\tvar child = visibleChildren[i];\n\t\t\t\tvar childIsLast = i === visibleChildren.length - 1;\n\t\t\t\tline += \"\\n\" + formatRouteTree(child, childIndent, childIsLast);\n\t\t\t}\n\t\t\treturn line;\n\t\t};\n\t\tconsole.info(`[one] \\u{1F4CD} Route structure:\n${formatRouteTree(routeNode)}`);\n\t\tif ((_routeNode_slots = routeNode.slots) === null || _routeNode_slots === void 0 ? void 0 : _routeNode_slots.size) {\n\t\t\tconsole.info(`[one] \\u{1F4E6} Slots on root layout:`);\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = routeNode.slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar [slotName, slotConfig] = _step.value;\n\t\t\t\t\tvar _slotConfig_defaultRoute;\n\t\t\t\t\tconsole.info(` @${slotName}:`, {\n\t\t\t\t\t\tdefaultRoute: (_slotConfig_defaultRoute = slotConfig.defaultRoute) === null || _slotConfig_defaultRoute === void 0 ? void 0 : _slotConfig_defaultRoute.route,\n\t\t\t\t\t\tinterceptRoutes: slotConfig.interceptRoutes.map(function(r) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\troute: r.route,\n\t\t\t\t\t\t\t\tintercept: r.intercept\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t})\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tnavigationRef = ref;\n\tsetupLinkingAndRouteInfo(initialLocation, linking);\n\tsubscribeToNavigationChanges();\n}\nfunction cleanUpState() {\n\tinitialState = void 0;\n\tinitialPathname = void 0;\n\tlastIntendedPathname = void 0;\n\trootState = void 0;\n\tnextState = void 0;\n\trouteInfo = void 0;\n\tpendingNavigationPathname = void 0;\n\tpendingNavigationAction = void 0;\n\t(0, import_linkingConfig.resetLinking)();\n\trootStateSubscribers.clear();\n\tstoreSubscribers.clear();\n}\nfunction setupLinkingAndRouteInfo(initialLocation, linking) {\n\tvar _ref;\n\tinitialState = (0, import_linkingConfig.setupLinking)(routeNode, initialLocation, linking);\n\tinitialPathname = (_ref = initialLocation === null || initialLocation === void 0 ? void 0 : initialLocation.pathname) !== null && _ref !== void 0 ? _ref : (0, import_path2.getSafeWindowPathname)();\n\tif (initialState) {\n\t\trootState = initialState;\n\t\trouteInfo = (0, import_getRouteInfo.getRouteInfo)(initialState);\n\t} else routeInfo = {\n\t\tunstable_globalHref: \"\",\n\t\tpathname: \"\",\n\t\tisIndex: false,\n\t\tparams: {},\n\t\tsegments: []\n\t};\n}\nfunction handleNavigationContainerStateChange(navState) {\n\tif (!navState) return;\n\tvar state = { ...navState };\n\tif (state.key) {\n\t\tif (hashes[state.key]) {\n\t\t\tstate.hash = hashes[state.key];\n\t\t\tdelete hashes[state.key];\n\t\t}\n\t}\n\tif (!hasAttemptedToHideSplash) {\n\t\thasAttemptedToHideSplash = true;\n\t\tsplashScreenAnimationFrame = requestAnimationFrame(function() {});\n\t}\n\tif (shouldKeepPendingNavigationState(state)) return;\n\tif (nextOptions) {\n\t\tstate = {\n\t\t\t...state,\n\t\t\tlinkOptions: nextOptions\n\t\t};\n\t\tnextOptions = null;\n\t}\n\tvar shouldUpdateSubscribers = nextState === state;\n\tnextState = void 0;\n\tif (state && state !== rootState) {\n\t\tupdateState(state, void 0);\n\t\tshouldUpdateSubscribers = true;\n\t}\n\tif (shouldUpdateSubscribers) (0, import_react.startTransition)(function() {\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = rootStateSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar subscriber = _step.value;\n\t\t\t\tsubscriber(state);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t});\n}\nfunction subscribeToNavigationChanges() {\n\t(0, import_react.startTransition)(function() {\n\t\tupdateSnapshot();\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = storeSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar subscriber = _step.value;\n\t\t\t\tsubscriber();\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t});\n}\nfunction navigate(url, options) {\n\treturn linkTo((0, import_href.resolveHref)(url), \"NAVIGATE\", options);\n}\nfunction push(url, options) {\n\treturn linkTo((0, import_href.resolveHref)(url), \"PUSH\", options);\n}\nfunction dismiss(count) {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} dismiss${count ? ` (${count})` : \"\"}`);\n\tnavigationRef === null || navigationRef === void 0 || navigationRef.dispatch(import_native.StackActions.pop(count));\n}\nfunction replace(url, options) {\n\treturn linkTo((0, import_href.resolveHref)(url), \"REPLACE\", options);\n}\nfunction setParams() {\n\tvar params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\tvar _navigationRef_current;\n\t(0, import_assertIsReady.assertIsReady)(navigationRef);\n\treturn navigationRef === null || navigationRef === void 0 ? void 0 : (_navigationRef_current = navigationRef.current) === null || _navigationRef_current === void 0 ? void 0 : _navigationRef_current.setParams(\n\t\t// @ts-ignore\n\t\tparams\n\t);\n}\nfunction dismissAll() {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} dismissAll`);\n\tnavigationRef === null || navigationRef === void 0 || navigationRef.dispatch(import_native.StackActions.popToTop());\n}\nfunction goBack() {\n\tvar _navigationRef_current;\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} goBack`);\n\t(0, import_assertIsReady.assertIsReady)(navigationRef);\n\tnavigationRef === null || navigationRef === void 0 || (_navigationRef_current = navigationRef.current) == null || _navigationRef_current.goBack();\n}\nfunction canGoBack() {\n\tvar _ref;\n\tvar _navigationRef_current;\n\tif (!navigationRef.isReady()) return false;\n\treturn (_ref = navigationRef === null || navigationRef === void 0 ? void 0 : (_navigationRef_current = navigationRef.current) === null || _navigationRef_current === void 0 ? void 0 : _navigationRef_current.canGoBack()) !== null && _ref !== void 0 ? _ref : false;\n}\nfunction canDismiss() {\n\tvar state = rootState;\n\twhile (state) {\n\t\tvar _state_routes_state_index, _state_routes;\n\t\tif (state.type === \"stack\" && state.routes.length > 1) return true;\n\t\tif (state.index === void 0) return false;\n\t\tstate = (_state_routes = state.routes) === null || _state_routes === void 0 ? void 0 : (_state_routes_state_index = _state_routes[state.index]) === null || _state_routes_state_index === void 0 ? void 0 : _state_routes_state_index.state;\n\t}\n\treturn false;\n}\nfunction getSortedRoutes() {\n\tif (!routeNode) throw new Error(\"No routes\");\n\treturn routeNode.children.filter(function(route) {\n\t\treturn !route.internal;\n\t}).sort(import_sortRoutes.sortRoutes);\n}\nfunction updateState(state) {\n\tvar nextStateParam = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : state;\n\trootState = state;\n\tnextState = nextStateParam;\n\tif ((0, import_isStateAwaitingNavigatorMount.isStateAwaitingNavigatorMount)(state, routeNode)) {\n\t\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F9ED} keeping ${routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname}: a navigator has not mounted`);\n\t\treturn;\n\t}\n\tvar nextRouteInfo = (0, import_getRouteInfo.getRouteInfo)(state);\n\tif (pendingNavigationPathname === nextRouteInfo.pathname) pendingNavigationPathname = void 0;\n\tif (!deepEqual(routeInfo, nextRouteInfo)) {\n\t\tif (process.env.ONE_DEBUG_ROUTER) {\n\t\t\tvar from = (routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname) || \"(initial)\";\n\t\t\tvar to = nextRouteInfo.pathname;\n\t\t\tvar params = Object.keys(nextRouteInfo.params || {}).length ? nextRouteInfo.params : void 0;\n\t\t\tconsole.info(`[one] \\u{1F9ED} ${from} \\u2192 ${to}`, params ? { params } : \"\");\n\t\t}\n\t\trouteInfo = nextRouteInfo;\n\t\tvar params1 = (0, import_findRouteNode.extractParamsFromState)(state);\n\t\tvar newMatches = buildNativeMatches(state, nextRouteInfo.pathname, params1);\n\t\tcurrentMatches = newMatches;\n\t\t(0, import_useMatches.setClientMatches)(newMatches);\n\t}\n\tif (process.env.NODE_ENV === \"development\" && typeof window !== \"undefined\") window.__oneDevtools = Object.assign(window.__oneDevtools || {}, {\n\t\trouteInfo: nextRouteInfo,\n\t\trootState: state,\n\t\trouteNode,\n\t\tgetRoutes: function getRoutes2() {\n\t\t\treturn (routeNode === null || routeNode === void 0 ? void 0 : routeNode.children) || [];\n\t\t},\n\t\tgetLoaderTimingHistory: function getLoaderTimingHistory() {\n\t\t\tvar _ref;\n\t\t\tvar _devtoolsRegistry_getLoaderTimingHistory;\n\t\t\treturn (_ref = (_devtoolsRegistry_getLoaderTimingHistory = import_registry.devtoolsRegistry.getLoaderTimingHistory) === null || _devtoolsRegistry_getLoaderTimingHistory === void 0 ? void 0 : _devtoolsRegistry_getLoaderTimingHistory.call(import_registry.devtoolsRegistry)) !== null && _ref !== void 0 ? _ref : [];\n\t\t},\n\t\tgetPreloadHistory\n\t});\n}\nfunction consumePendingNavigationAction() {\n\tvar action = pendingNavigationAction;\n\tpendingNavigationAction = void 0;\n\treturn action;\n}\nfunction subscribeToRootState(subscriber) {\n\trootStateSubscribers.add(subscriber);\n\treturn function() {\n\t\trootStateSubscribers.delete(subscriber);\n\t};\n}\nfunction notifyRootStateSubscribers(state) {\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = rootStateSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar subscriber = _step.value;\n\t\t\tsubscriber(state);\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n}\nfunction subscribeToStore(subscriber) {\n\tstoreSubscribers.add(subscriber);\n\treturn function() {\n\t\tstoreSubscribers.delete(subscriber);\n\t};\n}\nfunction subscribeToLoadingState(subscriber) {\n\tloadingStateSubscribers.add(subscriber);\n\treturn function() {\n\t\tloadingStateSubscribers.delete(subscriber);\n\t};\n}\nfunction setLoadingState(state) {\n\t(0, import_react.startTransition)(function() {\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = loadingStateSubscribers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar listener = _step.value;\n\t\t\t\tlistener(state);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t});\n}\nvar currentSnapshot = null;\nfunction updateSnapshot() {\n\tcurrentSnapshot = getSnapshot();\n}\nfunction snapshot() {\n\treturn currentSnapshot;\n}\nfunction getSnapshot() {\n\treturn {\n\t\tlinkTo,\n\t\trouteNode,\n\t\trootComponent,\n\t\tlinking: (0, import_linkingConfig.getResolvedLinking)(),\n\t\thasAttemptedToHideSplash,\n\t\tinitialState,\n\t\trootState,\n\t\tnextState,\n\t\trouteInfo,\n\t\tsplashScreenAnimationFrame,\n\t\tnavigationRef,\n\t\trootStateSubscribers,\n\t\tstoreSubscribers\n\t};\n}\nfunction rootStateSnapshot() {\n\treturn rootState;\n}\nfunction routeInfoSnapshot() {\n\treturn routeInfo;\n}\nfunction getBrowserPathname() {\n\tvar pathname = (0, import_path2.getSafeWindowPathname)();\n\treturn pathname === void 0 ? void 0 : (0, import_path2.normalizeRoutePathname)(pathname);\n}\nfunction shouldKeepPendingNavigationState(currentState) {\n\tif (!pendingNavigationPathname) return false;\n\treturn (0, import_getRouteInfo.getRouteInfo)(currentState).pathname !== pendingNavigationPathname;\n}\nfunction shouldPreserveInitialRouteInfo(currentState) {\n\tif (!initialState || !(routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname)) return false;\n\tvar nextPathname = (0, import_getRouteInfo.getRouteInfo)(currentState).pathname;\n\tif (nextPathname === routeInfo.pathname) return false;\n\tif (nextPathname && nextPathname === pendingNavigationPathname) return false;\n\tvar browserPathname = getBrowserPathname();\n\tif (nextPathname && browserPathname && nextPathname === browserPathname) return false;\n\treturn true;\n}\nfunction useOneRouter() {\n\tvar state = (0, import_react.useSyncExternalStore)(subscribeToStore, snapshot, snapshot);\n\treturn (0, import_react.useDeferredValue)(state);\n}\nfunction syncStoreRootState() {\n\tif (!navigationRef) throw new Error(`No navigationRef, possible duplicate One dep`);\n\tif (navigationRef.isReady()) {\n\t\tvar currentState = navigationRef.getRootState();\n\t\tif (rootState !== currentState) {\n\t\t\tif (shouldKeepPendingNavigationState(currentState)) return;\n\t\t\tif (shouldPreserveInitialRouteInfo(currentState)) return;\n\t\t\tupdateState(currentState);\n\t\t}\n\t}\n}\nfunction useRootStateSnapshot(snapshot2) {\n\tvar [state, rerender] = (0, import_react.useReducer)(snapshot2, void 0, snapshot2);\n\t(0, import_react.useEffect)(function() {\n\t\tvar unsubscribe = subscribeToRootState(rerender);\n\t\trerender();\n\t\treturn unsubscribe;\n\t}, []);\n\tvar browserPath = (0, import_path2.getSafeWindowPath)();\n\treturn browserPath !== void 0 && (routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.unstable_globalHref) === browserPath + window.location.hash ? snapshot2() : state;\n}\nfunction useStoreRootState() {\n\tsyncStoreRootState();\n\treturn (0, import_react.useDeferredValue)(useRootStateSnapshot(rootStateSnapshot));\n}\nfunction useStoreRouteInfo() {\n\tsyncStoreRootState();\n\treturn useRootStateSnapshot(routeInfoSnapshot);\n}\nfunction cleanup() {\n\tif (splashScreenAnimationFrame) cancelAnimationFrame(splashScreenAnimationFrame);\n}\nvar preloadingLoader = {};\nvar preloadedLoaderData = {};\nvar cssInjectFunctions = {};\nvar preloadHistory = [];\nfunction getPreloadHistory() {\n\treturn preloadHistory;\n}\nfunction preloadRoute(href) {\n\targuments.length > 1 && arguments[1] !== void 0 && arguments[1];\n}\nfunction isSsrHref(href) {\n\tvar _findRouteNodeFromState;\n\tvar linking = (0, import_linkingConfig.getResolvedLinking)();\n\tif (!(linking === null || linking === void 0 ? void 0 : linking.getStateFromPath) || !routeNode) return false;\n\tvar state = linking.getStateFromPath(href, linking.config);\n\treturn ((_findRouteNodeFromState = (0, import_findRouteNode.findRouteNodeFromState)(state, routeNode)) === null || _findRouteNodeFromState === void 0 ? void 0 : _findRouteNodeFromState.type) === \"ssr\";\n}\nfunction normalizeLoaderPath(href) {\n\tvar url = new URL(href, \"http://example.com\");\n\tvar path = url.pathname.replace(/\\/index$/, \"\").replace(/\\/$/, \"\") || \"/\";\n\treturn url.search && isSsrHref(href) ? (0, import_cleanUrl.toLoaderKey)(path, url.search) : path;\n}\nfunction buildClientMatches(href, matchingNode, params, loaderData) {\n\tvar pathname = (0, import_findRouteNode.extractPathnameFromHref)(href);\n\tvar routeId = (matchingNode === null || matchingNode === void 0 ? void 0 : matchingNode.contextKey) || pathname;\n\tvar layoutMatches = currentMatches.filter(function(m) {\n\t\treturn m.routeId.includes(\"_layout\");\n\t});\n\tvar pageMatch = {\n\t\trouteId,\n\t\tpathname,\n\t\tparams,\n\t\tloaderData\n\t};\n\treturn [...layoutMatches, pageMatch];\n}\nfunction buildNativeMatches(state, pathname, params) {\n\treturn (0, import_findRouteNode.findAllRouteNodesFromState)(state, routeNode).map(function(node) {\n\t\treturn {\n\t\t\trouteId: node.contextKey || pathname,\n\t\t\tpathname,\n\t\t\tparams,\n\t\t\tloaderData: void 0\n\t\t};\n\t});\n}\nfunction initClientMatches(matches) {\n\tcurrentMatches = matches;\n\t(0, import_useMatches.setClientMatches)(matches);\n}\nasync function linkTo(href, event, options) {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F517} ${event || \"NAVIGATE\"} ${href}`);\n\t(0, import_interceptRoutes.setNavigationType)(\"soft\");\n\tif (href[0] === \"#\") return;\n\tif ((0, import_url.shouldLinkExternally)(href)) {\n\t\t(0, import_openExternalURL.openExternalURL)(href);\n\t\treturn;\n\t}\n\tif ((0, import_skewProtection.isVersionStale)()) {\n\t\twindow.location.href = href;\n\t\treturn;\n\t}\n\tif ((0, import_useBlocker.checkBlocker)(href, event === \"REPLACE\" ? \"replace\" : \"push\")) return;\n\tvar protectedHref = resolveProtectedHref(href);\n\tif (!protectedHref) return;\n\tif (protectedHref !== href) return linkTo(protectedHref, \"REPLACE\", options);\n\tvar currentLayoutNode = routeNode;\n\tvar currentPath = (routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname) || \"/\";\n\tvar interceptResult = (0, import_interceptRoutes.findInterceptRoute)(href, currentLayoutNode, currentPath);\n\tif (interceptResult) {\n\t\tvar { interceptRoute, slotName, layoutContextKey, params } = interceptResult;\n\t\tvar scopedSlotKey = `${layoutContextKey}:${slotName}`;\n\t\t(0, import_interceptRoutes.storeInterceptState)(scopedSlotKey, interceptRoute, params);\n\t\t(0, import_interceptRoutes.updateURLWithoutNavigation)(href);\n\t\t(0, import_notFoundState.clearNotFoundState)();\n\t\t(0, import_Navigator.setSlotState)(scopedSlotKey, {\n\t\t\tactiveRouteKey: interceptRoute.contextKey,\n\t\t\tactiveRouteNode: interceptRoute,\n\t\t\tparams,\n\t\t\tisIntercepted: true\n\t\t});\n\t\treturn;\n\t}\n\t(0, import_assertIsReady.assertIsReady)(navigationRef);\n\tvar current = navigationRef.current;\n\tif (current == null) throw new Error(\"Couldn't find a navigation object. Is your component inside NavigationContainer?\");\n\tvar linking = (0, import_linkingConfig.getResolvedLinking)();\n\tif (!linking) throw new Error(\"Attempted to link to route when no routes are present\");\n\t(0, import_lastAction.setLastAction)();\n\tif (href === \"..\" || href === \"../\") {\n\t\t(0, import_notFoundState.clearNotFoundState)();\n\t\tcurrent.goBack();\n\t\treturn;\n\t}\n\tif (href.startsWith(\".\")) {\n\t\tvar _ref;\n\t\tvar _routeInfo_segments;\n\t\tvar base = (_ref = routeInfo === null || routeInfo === void 0 ? void 0 : (_routeInfo_segments = routeInfo.segments) === null || _routeInfo_segments === void 0 ? void 0 : _routeInfo_segments.map(function(segment) {\n\t\t\tvar _routeInfo_params;\n\t\t\tif (!segment.startsWith(\"[\")) return segment;\n\t\t\tif (segment.startsWith(\"[...\")) {\n\t\t\t\tvar _ref2;\n\t\t\t\tvar _routeInfo_params1, _params_split;\n\t\t\t\tsegment = segment.slice(4, -1);\n\t\t\t\tvar params3 = routeInfo === null || routeInfo === void 0 ? void 0 : (_routeInfo_params1 = routeInfo.params) === null || _routeInfo_params1 === void 0 ? void 0 : _routeInfo_params1[segment];\n\t\t\t\tif (Array.isArray(params3)) return params3.join(\"/\");\n\t\t\t\treturn (_ref2 = params3 === null || params3 === void 0 ? void 0 : (_params_split = params3.split(\",\")) === null || _params_split === void 0 ? void 0 : _params_split.join(\"/\")) !== null && _ref2 !== void 0 ? _ref2 : \"\";\n\t\t\t}\n\t\t\tsegment = segment.slice(1, -1);\n\t\t\treturn routeInfo === null || routeInfo === void 0 ? void 0 : (_routeInfo_params = routeInfo.params) === null || _routeInfo_params === void 0 ? void 0 : _routeInfo_params[segment];\n\t\t}).filter(Boolean).join(\"/\")) !== null && _ref !== void 0 ? _ref : \"/\";\n\t\tif (!(routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.isIndex)) base += \"/..\";\n\t\thref = (0, import_path.resolve)(base, href);\n\t}\n\tvar state = linking.getStateFromPath(href, linking.config);\n\tif (!state || state.routes.length === 0) {\n\t\tconsole.error(\"Could not generate a valid navigation state for the given path: \" + href);\n\t\tconsole.error(`linking.config`, linking.config);\n\t\tconsole.error(`routes`, getSortedRoutes());\n\t\treturn;\n\t}\n\tsetLoadingState(\"loading\");\n\tvar normalizedPreloadPath = normalizeLoaderPath(href);\n\tif (!(normalizedPreloadPath in preloadedLoaderData) && !(href in preloadedLoaderData)) {\n\t\tvar preloaded = await preloadRoute(href, true);\n\t\tif ((0, import_cleanUrl.isLoaderBadRequest)(preloaded)) {\n\t\t\tsetLoadingState(\"loaded\");\n\t\t\twindow.location.assign(href);\n\t\t\treturn;\n\t\t}\n\t} else if (process.env.NODE_ENV !== \"development\") {\n\t\tvar inject = cssInjectFunctions[href];\n\t\tif (inject) inject().catch(function() {});\n\t}\n\tvar preloadResult = preloadedLoaderData[normalizedPreloadPath];\n\tif (preloadResult === null || preloadResult === void 0 ? void 0 : preloadResult.__oneRedirect) {\n\t\tvar redirectTarget = preloadResult.__oneRedirect;\n\t\tdelete preloadedLoaderData[normalizedPreloadPath];\n\t\tdelete preloadingLoader[normalizedPreloadPath];\n\t\tdelete preloadedLoaderData[href];\n\t\tdelete preloadingLoader[href];\n\t\tsetLoadingState(\"loaded\");\n\t\tlinkTo(redirectTarget, \"REPLACE\");\n\t\treturn;\n\t}\n\tif ((preloadResult === null || preloadResult === void 0 ? void 0 : preloadResult.__oneError) === 404) {\n\t\tdelete preloadedLoaderData[normalizedPreloadPath];\n\t\tdelete preloadingLoader[normalizedPreloadPath];\n\t\tdelete preloadedLoaderData[href];\n\t\tdelete preloadingLoader[href];\n\t\tsetLoadingState(\"loaded\");\n\t\tvar notFoundRoute = (0, import_notFoundState.findNearestNotFoundRoute)(href, routeNode);\n\t\t(0, import_notFoundState.setNotFoundState)({\n\t\t\tnotFoundPath: preloadResult.__oneNotFoundPath || \"/+not-found\",\n\t\t\tnotFoundRouteNode: notFoundRoute || void 0,\n\t\t\toriginalPath: href\n\t\t});\n\t\treturn;\n\t}\n\tvar matchingRouteNode = (0, import_findRouteNode.findRouteNodeFromState)(state, routeNode);\n\tvar isColdRoute = false;\n\tif (matchingRouteNode === null || matchingRouteNode === void 0 ? void 0 : matchingRouteNode.loadRoute) {\n\t\tsetValidationState({\n\t\t\tstatus: \"validating\",\n\t\t\tlastValidatedHref: href\n\t\t});\n\t\ttry {\n\t\t\tvar loadedRoute = matchingRouteNode.loadRoute();\n\t\t\tvar params1 = (0, import_findRouteNode.extractParamsFromState)(state);\n\t\t\tvar search = (0, import_findRouteNode.extractSearchFromHref)(href);\n\t\t\tvar pathname = (0, import_findRouteNode.extractPathnameFromHref)(href);\n\t\t\tif (loadedRoute.validateParams) (0, import_validateParams.validateParams)(loadedRoute.validateParams, params1);\n\t\t\tif (loadedRoute.validateRoute) {\n\t\t\t\tvar validationResult = await loadedRoute.validateRoute({\n\t\t\t\t\tparams: params1,\n\t\t\t\t\tsearch,\n\t\t\t\t\tpathname,\n\t\t\t\t\thref\n\t\t\t\t});\n\t\t\t\tif (validationResult && !validationResult.valid) {\n\t\t\t\t\tvar _$error = new import_validateParams.RouteValidationError(validationResult.error || \"Route validation failed\", validationResult.details);\n\t\t\t\t\tsetValidationState({\n\t\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\t\terror: _$error,\n\t\t\t\t\t\tlastValidatedHref: href\n\t\t\t\t\t});\n\t\t\t\t\tthrow _$error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetValidationState({\n\t\t\t\tstatus: \"valid\",\n\t\t\t\tlastValidatedHref: href\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error && typeof error.then === \"function\") {\n\t\t\t\tisColdRoute = true;\n\t\t\t\tvar routeLoading = error.catch(function() {});\n\t\t\t\tif (process.env.NODE_ENV !== \"development\" || process.env.ONE_SUSPEND_ROUTES_NATIVE === \"0\" || globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ === true) await routeLoading;\n\t\t\t\tsetValidationState({\n\t\t\t\t\tstatus: \"valid\",\n\t\t\t\t\tlastValidatedHref: href\n\t\t\t\t});\n\t\t\t} else if (error instanceof import_validateParams.ParamValidationError || error instanceof import_validateParams.RouteValidationError) {\n\t\t\t\tsetValidationState({\n\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\terror,\n\t\t\t\t\tlastValidatedHref: href\n\t\t\t\t});\n\t\t\t\tthrow error;\n\t\t\t} else throw error;\n\t\t}\n\t}\n\tvar loaderData = preloadedLoaderData[normalizeLoaderPath(href)];\n\tvar params2 = (0, import_findRouteNode.extractParamsFromState)(state);\n\tvar newMatches = buildClientMatches(href, matchingRouteNode, params2, loaderData);\n\tcurrentMatches = newMatches;\n\t(0, import_useMatches.setClientMatches)(newMatches);\n\tif (!navigationRef.isReady()) {\n\t\tsetLoadingState(\"loaded\");\n\t\treturn;\n\t}\n\tvar currentRootState = navigationRef.getRootState();\n\tvar hash = href.indexOf(\"#\");\n\tif ((currentRootState === null || currentRootState === void 0 ? void 0 : currentRootState.key) && hash > 0) hashes[currentRootState.key] = href.slice(hash);\n\t(0, import_notFoundState.clearNotFoundState)();\n\tnextOptions = options !== null && options !== void 0 ? options : null;\n\tpendingNavigationPathname = (0, import_path2.stripTrailingSlash)((0, import_findRouteNode.extractPathnameFromHref)(href));\n\tpendingNavigationAction = event === \"PUSH\" || event === \"REPLACE\" || event === \"NAVIGATE\" ? event : void 0;\n\tlastIntendedPathname = pendingNavigationPathname;\n\tvar freshRootState = navigationRef.getRootState();\n\tvar currentRouteBeforeDispatch = navigationRef.getCurrentRoute();\n\tvar targetPathname = pendingNavigationPathname;\n\tvar optimisticState = nextOptions ? {\n\t\t...state,\n\t\tlinkOptions: nextOptions\n\t} : state;\n\tvar action = event === \"REPLACE\" ? !isColdRoute ? (0, import_getNativeStackReplaceAction.getNativeStackReplaceAction)(state, freshRootState) : null : (0, import_getNavigateAction.getNavigateAction)(state, freshRootState, event);\n\t(0, import_react.startTransition)(function() {\n\t\tupdateState(optimisticState);\n\t\tpendingNavigationPathname = targetPathname;\n\t\tnotifyRootStateSubscribers(optimisticState);\n\t\tif (!action) navigationRef.resetRoot(state);\n\t\telse {\n\t\t\tvar _action_payload;\n\t\t\tvar targetName = (_action_payload = action.payload) === null || _action_payload === void 0 ? void 0 : _action_payload.name;\n\t\t\tvar isGroupTarget = typeof targetName === \"string\" && targetName.startsWith(\"(\") && targetName.endsWith(\")\");\n\t\t\tvar hasFreshRootState = freshRootState.type === \"stack\";\n\t\t\tvar isRootTarget = action.target === freshRootState.key;\n\t\t\tvar currentFocusedRoute = freshRootState.routes[freshRootState.index];\n\t\t\tvar currentFocusedName = currentFocusedRoute === null || currentFocusedRoute === void 0 ? void 0 : currentFocusedRoute.name;\n\t\t\tif (event !== \"REPLACE\" && isRootTarget && isGroupTarget && hasFreshRootState) {\n\t\t\t\tvar _state_index;\n\t\t\t\tvar targetRoute = state.routes[(_state_index = state.index) !== null && _state_index !== void 0 ? _state_index : state.routes.length - 1];\n\t\t\t\tvar targetRootName = targetRoute.name;\n\t\t\t\tif (currentFocusedName === targetRootName) {\n\t\t\t\t\tvar _ref2;\n\t\t\t\t\tvar routes = [...freshRootState.routes];\n\t\t\t\t\troutes[freshRootState.index] = {\n\t\t\t\t\t\t...targetRoute,\n\t\t\t\t\t\tkey: (_ref2 = currentFocusedRoute === null || currentFocusedRoute === void 0 ? void 0 : currentFocusedRoute.key) !== null && _ref2 !== void 0 ? _ref2 : targetRoute.key\n\t\t\t\t\t};\n\t\t\t\t\tnavigationRef.resetRoot({\n\t\t\t\t\t\t...freshRootState,\n\t\t\t\t\t\troutes\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tvar _ref1;\n\t\t\t\t\tvar existingTargetRoute = freshRootState.routes.find(function(route) {\n\t\t\t\t\t\treturn route.name === targetRootName;\n\t\t\t\t\t});\n\t\t\t\t\tvar existingRoutes = freshRootState.routes.filter(function(route) {\n\t\t\t\t\t\treturn route.name !== targetRootName;\n\t\t\t\t\t});\n\t\t\t\t\tvar nextRootState = {\n\t\t\t\t\t\t...freshRootState,\n\t\t\t\t\t\troutes: [...existingRoutes, {\n\t\t\t\t\t\t\t...targetRoute,\n\t\t\t\t\t\t\tkey: (_ref1 = existingTargetRoute === null || existingTargetRoute === void 0 ? void 0 : existingTargetRoute.key) !== null && _ref1 !== void 0 ? _ref1 : `${targetRootName}-${freshRootState.key}`\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tindex: existingRoutes.length\n\t\t\t\t\t};\n\t\t\t\t\tnavigationRef.resetRoot(nextRootState);\n\t\t\t\t}\n\t\t\t} else navigationRef.dispatch(action);\n\t\t}\n\t});\n\tvar warningTm;\n\tvar interval = setInterval(function() {\n\t\tif (!navigationRef.isReady()) {\n\t\t\tclearTimeout(warningTm);\n\t\t\tclearInterval(interval);\n\t\t\treturn;\n\t\t}\n\t\tif (currentRouteBeforeDispatch !== navigationRef.getCurrentRoute()) setTimeout(function() {\n\t\t\tsetLoadingState(\"loaded\");\n\t\t});\n\t\tclearTimeout(warningTm);\n\t\tclearInterval(interval);\n\t}, 16);\n\tif (process.env.NODE_ENV === \"development\") warningTm = setTimeout(function() {\n\t\tconsole.warn(`Routing took more than 8 seconds`);\n\t}, 1e3);\n}\nvar hashes = {};\nvar nextOptions = null;\nfunction deepEqual(a, b) {\n\tif (a === b) return true;\n\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\tif (a.length !== b.length) return false;\n\t\tfor (var i = 0; i < a.length; i++) if (!deepEqual(a[i], b[i])) return false;\n\t\treturn true;\n\t}\n\tif (typeof a === \"object\" && typeof b === \"object\") {\n\t\tvar keysA = Object.keys(a);\n\t\tvar keysB = Object.keys(b);\n\t\tif (keysA.length !== keysB.length) return false;\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = keysA[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar key = _step.value;\n\t\t\t\tif (!deepEqual(a[key], b[key])) return false;\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\treturn false;\n}\n//# sourceMappingURL=router.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,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AC;AACd,IAAI,cAAc;AAClB,SAAS,UAAU,GAAG,GAAG;CACxB,IAAI,MAAM,GAAG,OAAO;CACpB,IAAI,MAAM,QAAQ,CAAC,KAAK,MAAM,QAAQ,CAAC,GAAG;EACzC,IAAI,EAAE,WAAW,EAAE,QAAQ,OAAO;EAClC,KAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO;EACtE,OAAO;CACR;CACA,IAAI,OAAO,MAAM,YAAY,OAAO,MAAM,UAAU;EACnD,IAAI,QAAQ,OAAO,KAAK,CAAC;EACzB,IAAI,QAAQ,OAAO,KAAK,CAAC;EACzB,IAAI,MAAM,WAAW,MAAM,QAAQ,OAAO;EAC1C,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACH,KAAK,IAAI,YAAY,MAAM,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IACvJ,IAAI,MAAM,MAAM;IAChB,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO;GACxC;EACD,SAAS,KAAK;GACb,oBAAoB;GACpB,iBAAiB;EAClB,UAAU;GACT,IAAI;IACH,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM,UAAU,OAAO;GAC9E,UAAU;IACT,IAAI,mBAAmB,MAAM;GAC9B;EACD;EACA,OAAO;CACR;CACA,OAAO;AACR"}
|
package/dist/esm/Root.mjs
CHANGED
|
@@ -107,6 +107,7 @@ function Root(props) {
|
|
|
107
107
|
const initialPath = window.location.pathname + window.location.search;
|
|
108
108
|
requestAnimationFrame(() => {
|
|
109
109
|
if (window.location.pathname + window.location.search !== initialPath) return;
|
|
110
|
+
if (store.lastIntendedPathname !== void 0) return;
|
|
110
111
|
const nav = store.navigationRef?.current;
|
|
111
112
|
if (!nav) return;
|
|
112
113
|
const linking2 = getResolvedLinking();
|
package/dist/esm/Root.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.js","names":["UpstreamNavigationContainer"],"sources":["esm/Root.js"],"sourcesContent":["import { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport {\n createContext,\n StrictMode,\n useContext,\n useId,\n useLayoutEffect,\n useState\n} from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange } from \"./router/router\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nconst ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n let url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nconst ServerAsyncLocalIDContext = createContext(null);\nfunction Root(props) {\n globalThis[\"__vxrnGetContextFromReactContext\"] = () => useContext(ServerAsyncLocalIDContext);\n if (isNative) {\n initScreensFeatureFlags();\n }\n const {\n path,\n routes,\n routeOptions,\n isClient,\n navigationContainerProps,\n onRenderId,\n linking\n } = props;\n const context = useViteRoutes(\n routes,\n props.routerRoot,\n routeOptions,\n globalThis[\"__vxrnVersion\"]\n );\n const location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n const store = useInitializeOneRouter(context, location, linking);\n const userScheme = useUserScheme();\n const Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n const id = useId();\n onRenderId?.(id);\n const value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : globalThis[\"__vxrnrequestAsyncLocalStore\"]?.getStore() || null;\n const deferredPreloads = props.deferredPreloads;\n let contents = /* @__PURE__ */ jsx(ServerAsyncLocalIDContext.Provider, { value, children: /* @__PURE__ */ jsxs(ServerRenderID.Provider, { value: id, children: [\n typeof window === \"undefined\" && deferredPreloads?.map((src) => /* @__PURE__ */ jsx(\"link\", { rel: \"modulepreload\", fetchPriority: \"low\", href: src }, src)),\n /* @__PURE__ */ jsx(SafeAreaProvider, { initialMetrics: initialWindowMetrics, children: /* @__PURE__ */ jsx(\n UpstreamNavigationContainer,\n {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ jsx(ServerLocationContext.Provider, { value: location, children: /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(ScrollBehavior, {}),\n /* @__PURE__ */ jsx(RootErrorBoundary, { children: /* @__PURE__ */ jsx(Component, {}) })\n ] }) })\n }\n ) }),\n typeof window !== \"undefined\" && /* @__PURE__ */ jsx(PreloadLinks, {}, \"preload-links\")\n ] }) });\n if (props.flags) {\n contents = /* @__PURE__ */ jsx(FlagsContext.Provider, { value: props.flags, children: contents });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ jsx(StrictMode, { children: contents });\n }\n if (isClient) {\n const serverMode = globalThis[SERVER_CONTEXT_KEY]?.mode;\n if (serverMode === \"spa\") {\n const [show, setShow] = useState(false);\n useLayoutEffect(() => {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n const [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(() => {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(() => {\n if (!isSpaShell) {\n const initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(() => {\n if (window.location.pathname + window.location.search !== initialPath) return;\n const nav = store.navigationRef?.current;\n if (!nav) return;\n const linking2 = getResolvedLinking();\n if (linking2?.getStateFromPath) {\n const freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [isSpaShell]);\n return /* @__PURE__ */ jsx(SpaShellContext.Provider, { value: isSpaShell, children: contents });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ jsx(SpaShellContext.Provider, { value: true, children: contents });\n }\n return contents;\n}\nlet onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = (action) => {\n const payload = action.payload;\n let message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload?.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = () => {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,mCAAmC,IAAI,IAAI;AACjD,SAAS,qBAAqB,MAAM;CAClC,IAAI,MAAM,iBAAiB,IAAI,IAAI;CACnC,IAAI,KAAK,OAAO;CAChB,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC;CAC5B,YAAY,kBAAkB,KAAK,GAAG;CACtC,iBAAiB,IAAI,MAAM,GAAG;CAC9B,OAAO;AACT;AACA,MAAM,4BAA4B,cAAc,IAAI;AACpD,SAAS,KAAK,OAAO;CACnB,WAAW,4CAA4C,WAAW,yBAAyB;CAC3F,IAAI,UAAU;EACZ,wBAAwB;CAC1B;CACA,MAAM,EACJ,MACA,QACA,cACA,UACA,0BACA,YACA,YACE;CACJ,MAAM,UAAU,cACd,QACA,MAAM,YACN,cACA,WAAW,gBACb;CACA,MAAM,WAAW,WAAW,KAAK,IAAI,OAAO,WAAW,eAAe,OAAO,WAAW,IAAI,IAAI,QAAQ,OAAO,SAAS,QAAQ,KAAK,OAAO,SAAS,IAAI,IAAI,qBAAqB,QAAQ,GAAG;CAC7L,MAAM,QAAQ,uBAAuB,SAAS,UAAU,OAAO;CAC/D,MAAM,aAAa,cAAc;CACjC,MAAM,YAAY,MAAM;CACxB,IAAI,CAAC,WAAW;EACd,MAAM,IAAI,MAAM,yBAAyB;CAC3C;CACA,MAAM,KAAK,MAAM;CACjB,aAAa,EAAE;CACf,MAAM,QAAQ,QAAQ,IAAI,SAAS,WAAW,0BAA0B,WAAW,+BAA+B,EAAE,SAAS,KAAK;CAClI,MAAM,mBAAmB,MAAM;CAC/B,IAAI,WAA2B,oBAAI,0BA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ACvB;AACF,OAAO;CACL,0BAA0B,CAC1B;AACF"}
|
|
1
|
+
{"version":3,"file":"Root.js","names":["UpstreamNavigationContainer"],"sources":["esm/Root.js"],"sourcesContent":["import { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport {\n createContext,\n StrictMode,\n useContext,\n useId,\n useLayoutEffect,\n useState\n} from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange } from \"./router/router\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nconst ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n let url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nconst ServerAsyncLocalIDContext = createContext(null);\nfunction Root(props) {\n globalThis[\"__vxrnGetContextFromReactContext\"] = () => useContext(ServerAsyncLocalIDContext);\n if (isNative) {\n initScreensFeatureFlags();\n }\n const {\n path,\n routes,\n routeOptions,\n isClient,\n navigationContainerProps,\n onRenderId,\n linking\n } = props;\n const context = useViteRoutes(\n routes,\n props.routerRoot,\n routeOptions,\n globalThis[\"__vxrnVersion\"]\n );\n const location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n const store = useInitializeOneRouter(context, location, linking);\n const userScheme = useUserScheme();\n const Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n const id = useId();\n onRenderId?.(id);\n const value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : globalThis[\"__vxrnrequestAsyncLocalStore\"]?.getStore() || null;\n const deferredPreloads = props.deferredPreloads;\n let contents = /* @__PURE__ */ jsx(ServerAsyncLocalIDContext.Provider, { value, children: /* @__PURE__ */ jsxs(ServerRenderID.Provider, { value: id, children: [\n typeof window === \"undefined\" && deferredPreloads?.map((src) => /* @__PURE__ */ jsx(\"link\", { rel: \"modulepreload\", fetchPriority: \"low\", href: src }, src)),\n /* @__PURE__ */ jsx(SafeAreaProvider, { initialMetrics: initialWindowMetrics, children: /* @__PURE__ */ jsx(\n UpstreamNavigationContainer,\n {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ jsx(ServerLocationContext.Provider, { value: location, children: /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(ScrollBehavior, {}),\n /* @__PURE__ */ jsx(RootErrorBoundary, { children: /* @__PURE__ */ jsx(Component, {}) })\n ] }) })\n }\n ) }),\n typeof window !== \"undefined\" && /* @__PURE__ */ jsx(PreloadLinks, {}, \"preload-links\")\n ] }) });\n if (props.flags) {\n contents = /* @__PURE__ */ jsx(FlagsContext.Provider, { value: props.flags, children: contents });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ jsx(StrictMode, { children: contents });\n }\n if (isClient) {\n const serverMode = globalThis[SERVER_CONTEXT_KEY]?.mode;\n if (serverMode === \"spa\") {\n const [show, setShow] = useState(false);\n useLayoutEffect(() => {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n const [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(() => {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(() => {\n if (!isSpaShell) {\n const initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(() => {\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n const nav = store.navigationRef?.current;\n if (!nav) return;\n const linking2 = getResolvedLinking();\n if (linking2?.getStateFromPath) {\n const freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [isSpaShell]);\n return /* @__PURE__ */ jsx(SpaShellContext.Provider, { value: isSpaShell, children: contents });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ jsx(SpaShellContext.Provider, { value: true, children: contents });\n }\n return contents;\n}\nlet onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = (action) => {\n const payload = action.payload;\n let message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload?.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = () => {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,mCAAmC,IAAI,IAAI;AACjD,SAAS,qBAAqB,MAAM;CAClC,IAAI,MAAM,iBAAiB,IAAI,IAAI;CACnC,IAAI,KAAK,OAAO;CAChB,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC;CAC5B,YAAY,kBAAkB,KAAK,GAAG;CACtC,iBAAiB,IAAI,MAAM,GAAG;CAC9B,OAAO;AACT;AACA,MAAM,4BAA4B,cAAc,IAAI;AACpD,SAAS,KAAK,OAAO;CACnB,WAAW,4CAA4C,WAAW,yBAAyB;CAC3F,IAAI,UAAU;EACZ,wBAAwB;CAC1B;CACA,MAAM,EACJ,MACA,QACA,cACA,UACA,0BACA,YACA,YACE;CACJ,MAAM,UAAU,cACd,QACA,MAAM,YACN,cACA,WAAW,gBACb;CACA,MAAM,WAAW,WAAW,KAAK,IAAI,OAAO,WAAW,eAAe,OAAO,WAAW,IAAI,IAAI,QAAQ,OAAO,SAAS,QAAQ,KAAK,OAAO,SAAS,IAAI,IAAI,qBAAqB,QAAQ,GAAG;CAC7L,MAAM,QAAQ,uBAAuB,SAAS,UAAU,OAAO;CAC/D,MAAM,aAAa,cAAc;CACjC,MAAM,YAAY,MAAM;CACxB,IAAI,CAAC,WAAW;EACd,MAAM,IAAI,MAAM,yBAAyB;CAC3C;CACA,MAAM,KAAK,MAAM;CACjB,aAAa,EAAE;CACf,MAAM,QAAQ,QAAQ,IAAI,SAAS,WAAW,0BAA0B,WAAW,+BAA+B,EAAE,SAAS,KAAK;CAClI,MAAM,mBAAmB,MAAM;CAC/B,IAAI,WAA2B,oBAAI,0BAA0B,UAAU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ACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,0BAA0B,CAC1B;AACF"}
|
package/dist/esm/Root.native.js
CHANGED
|
@@ -114,6 +114,7 @@ function Root(props) {
|
|
|
114
114
|
requestAnimationFrame(function() {
|
|
115
115
|
var _store_navigationRef;
|
|
116
116
|
if (window.location.pathname + window.location.search !== initialPath) return;
|
|
117
|
+
if (store.lastIntendedPathname !== void 0) return;
|
|
117
118
|
var nav = (_store_navigationRef = store.navigationRef) === null || _store_navigationRef === void 0 ? void 0 : _store_navigationRef.current;
|
|
118
119
|
if (!nav) return;
|
|
119
120
|
var linking2 = getResolvedLinking();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.native.js","names":["UpstreamNavigationContainer","_Fragment"],"sources":["esm/Root.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport { createContext, StrictMode, useContext, useId, useLayoutEffect, useState } from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange } from \"./router/router\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nvar ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n var url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nvar ServerAsyncLocalIDContext = /* @__PURE__ */ createContext(null);\nfunction Root(props) {\n var _globalThis___vxrnrequestAsyncLocalStore;\n globalThis[\"__vxrnGetContextFromReactContext\"] = function() {\n return useContext(ServerAsyncLocalIDContext);\n };\n if (isNative) {\n initScreensFeatureFlags();\n }\n var { path, routes, routeOptions, isClient, navigationContainerProps, onRenderId, linking } = props;\n var context = useViteRoutes(routes, props.routerRoot, routeOptions, globalThis[\"__vxrnVersion\"]);\n var location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n var store = useInitializeOneRouter(context, location, linking);\n var userScheme = useUserScheme();\n var Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n var id = useId();\n onRenderId === null || onRenderId === void 0 ? void 0 : onRenderId(id);\n var value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : ((_globalThis___vxrnrequestAsyncLocalStore = globalThis[\"__vxrnrequestAsyncLocalStore\"]) === null || _globalThis___vxrnrequestAsyncLocalStore === void 0 ? void 0 : _globalThis___vxrnrequestAsyncLocalStore.getStore()) || null;\n var deferredPreloads = props.deferredPreloads;\n var contents = /* @__PURE__ */ _jsx(ServerAsyncLocalIDContext.Provider, {\n value,\n children: /* @__PURE__ */ _jsxs(ServerRenderID.Provider, {\n value: id,\n children: [\n typeof window === \"undefined\" && (deferredPreloads === null || deferredPreloads === void 0 ? void 0 : deferredPreloads.map(function(src) {\n return /* @__PURE__ */ _jsx(\"link\", {\n rel: \"modulepreload\",\n fetchPriority: \"low\",\n href: src\n }, src);\n })),\n /* one owns the safe area provider on every platform: apps read it\n through One.UI.SafeArea and never mount their own */\n /* @__PURE__ */ _jsx(SafeAreaProvider, {\n initialMetrics: initialWindowMetrics,\n children: /* @__PURE__ */ _jsx(UpstreamNavigationContainer, {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ _jsx(ServerLocationContext.Provider, {\n value: location,\n children: /* @__PURE__ */ _jsxs(_Fragment, {\n children: [\n /* @__PURE__ */ _jsx(ScrollBehavior, {}),\n /* @__PURE__ */ _jsx(RootErrorBoundary, {\n children: /* @__PURE__ */ _jsx(Component, {})\n })\n ]\n })\n })\n })\n }),\n typeof window !== \"undefined\" && /* @__PURE__ */ _jsx(PreloadLinks, {}, \"preload-links\")\n ]\n })\n });\n if (props.flags) {\n contents = /* @__PURE__ */ _jsx(FlagsContext.Provider, {\n value: props.flags,\n children: contents\n });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ _jsx(StrictMode, {\n children: contents\n });\n }\n if (isClient) {\n var _globalThis_SERVER_CONTEXT_KEY;\n var serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n if (serverMode === \"spa\") {\n var [show, setShow] = useState(false);\n useLayoutEffect(function() {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n var [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(function() {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(function() {\n if (!isSpaShell) {\n var initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(function() {\n var _store_navigationRef;\n if (window.location.pathname + window.location.search !== initialPath) return;\n var nav = (_store_navigationRef = store.navigationRef) === null || _store_navigationRef === void 0 ? void 0 : _store_navigationRef.current;\n if (!nav) return;\n var linking2 = getResolvedLinking();\n if (linking2 === null || linking2 === void 0 ? void 0 : linking2.getStateFromPath) {\n var freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [\n isSpaShell\n ]);\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: isSpaShell,\n children: contents\n });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: true,\n children: contents\n });\n }\n return contents;\n}\nvar onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = function onUnhandledAction2(action) {\n var payload = action.payload;\n var message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload === null || payload === void 0 ? void 0 : payload.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function onUnhandledAction2() {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAI,mCAAmC,IAAI,IA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IACH,WAAW;;;IAGX;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;EACJ;EACA,WAAW;;;EAGX,IAAI,QAAQ,IAAI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,oBAAoB,SAAS,qBAAqB,CAClD;AACF"}
|
|
1
|
+
{"version":3,"file":"Root.native.js","names":["UpstreamNavigationContainer","_Fragment"],"sources":["esm/Root.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport { createContext, StrictMode, useContext, useId, useLayoutEffect, useState } from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange } from \"./router/router\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nvar ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n var url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nvar ServerAsyncLocalIDContext = /* @__PURE__ */ createContext(null);\nfunction Root(props) {\n var _globalThis___vxrnrequestAsyncLocalStore;\n globalThis[\"__vxrnGetContextFromReactContext\"] = function() {\n return useContext(ServerAsyncLocalIDContext);\n };\n if (isNative) {\n initScreensFeatureFlags();\n }\n var { path, routes, routeOptions, isClient, navigationContainerProps, onRenderId, linking } = props;\n var context = useViteRoutes(routes, props.routerRoot, routeOptions, globalThis[\"__vxrnVersion\"]);\n var location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n var store = useInitializeOneRouter(context, location, linking);\n var userScheme = useUserScheme();\n var Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n var id = useId();\n onRenderId === null || onRenderId === void 0 ? void 0 : onRenderId(id);\n var value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : ((_globalThis___vxrnrequestAsyncLocalStore = globalThis[\"__vxrnrequestAsyncLocalStore\"]) === null || _globalThis___vxrnrequestAsyncLocalStore === void 0 ? void 0 : _globalThis___vxrnrequestAsyncLocalStore.getStore()) || null;\n var deferredPreloads = props.deferredPreloads;\n var contents = /* @__PURE__ */ _jsx(ServerAsyncLocalIDContext.Provider, {\n value,\n children: /* @__PURE__ */ _jsxs(ServerRenderID.Provider, {\n value: id,\n children: [\n typeof window === \"undefined\" && (deferredPreloads === null || deferredPreloads === void 0 ? void 0 : deferredPreloads.map(function(src) {\n return /* @__PURE__ */ _jsx(\"link\", {\n rel: \"modulepreload\",\n fetchPriority: \"low\",\n href: src\n }, src);\n })),\n /* one owns the safe area provider on every platform: apps read it\n through One.UI.SafeArea and never mount their own */\n /* @__PURE__ */ _jsx(SafeAreaProvider, {\n initialMetrics: initialWindowMetrics,\n children: /* @__PURE__ */ _jsx(UpstreamNavigationContainer, {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ _jsx(ServerLocationContext.Provider, {\n value: location,\n children: /* @__PURE__ */ _jsxs(_Fragment, {\n children: [\n /* @__PURE__ */ _jsx(ScrollBehavior, {}),\n /* @__PURE__ */ _jsx(RootErrorBoundary, {\n children: /* @__PURE__ */ _jsx(Component, {})\n })\n ]\n })\n })\n })\n }),\n typeof window !== \"undefined\" && /* @__PURE__ */ _jsx(PreloadLinks, {}, \"preload-links\")\n ]\n })\n });\n if (props.flags) {\n contents = /* @__PURE__ */ _jsx(FlagsContext.Provider, {\n value: props.flags,\n children: contents\n });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ _jsx(StrictMode, {\n children: contents\n });\n }\n if (isClient) {\n var _globalThis_SERVER_CONTEXT_KEY;\n var serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n if (serverMode === \"spa\") {\n var [show, setShow] = useState(false);\n useLayoutEffect(function() {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n var [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(function() {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(function() {\n if (!isSpaShell) {\n var initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(function() {\n var _store_navigationRef;\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n var nav = (_store_navigationRef = store.navigationRef) === null || _store_navigationRef === void 0 ? void 0 : _store_navigationRef.current;\n if (!nav) return;\n var linking2 = getResolvedLinking();\n if (linking2 === null || linking2 === void 0 ? void 0 : linking2.getStateFromPath) {\n var freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [\n isSpaShell\n ]);\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: isSpaShell,\n children: contents\n });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: true,\n children: contents\n });\n }\n return contents;\n}\nvar onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = function onUnhandledAction2(action) {\n var payload = action.payload;\n var message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload === null || payload === void 0 ? void 0 : payload.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function onUnhandledAction2() {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAI,mCAAmC,IAAI,IAAI;AAC/C,SAAS,qBAAqB,MAAM;CAClC,IAAI,MAAM,iBAAiB,IAAI,IAAI;CACnC,IAAI,KAAK,OAAO;CAChB,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC;CAC5B,YAAY,kB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AI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,oBAAoB,SAAS,qBAAqB,CAClD;AACF"}
|
|
@@ -385,7 +385,12 @@ function applyAfterLCPScriptLoad(html, preloads) {
|
|
|
385
385
|
}, 0);
|
|
386
386
|
}, 0);
|
|
387
387
|
}
|
|
388
|
-
|
|
388
|
+
// hydration must not start while the parser is still adding server markup
|
|
389
|
+
if (document.readyState === 'loading') {
|
|
390
|
+
document.addEventListener('DOMContentLoaded', function() { waitIdle(5); });
|
|
391
|
+
} else {
|
|
392
|
+
waitIdle(5);
|
|
393
|
+
}
|
|
389
394
|
})();
|
|
390
395
|
<\/script>`;
|
|
391
396
|
html = html.replace("</head>", `${loaderScript}</head>`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPage.js","names":[],"sources":["esm/cli/buildPage.js"],"sourcesContent":["import { join } from \"node:path\";\nimport FSExtra from \"fs-extra\";\nimport { normalizePath } from \"vite\";\nimport * as constants from \"../constants\";\nimport { NATIVE_LOADER_JS_POSTFIX_UNCACHED } from \"../constants\";\nimport {\n encodeReservedFilenameChars,\n getLoaderPath,\n getPreloadCSSPath,\n getPreloadPath\n} from \"../utils/cleanUrl\";\nimport { isResponse } from \"../utils/isResponse\";\nimport { toAbsolute, toAbsoluteUrl } from \"../utils/toAbsolute\";\nimport { getRouteExports } from \"./serverRouteModules\";\nconst { outputFile } = FSExtra;\nfunction urlPathToFilePath(urlPath) {\n const parts = urlPath.replace(/^\\//, \"\").split(\"/\");\n return join(...parts);\n}\nconst buildTiming = process.env.ONE_BUILD_TIMING === \"1\";\nconst timings = {};\nfunction recordTiming(label, ms) {\n if (!buildTiming) return;\n (timings[label] ||= []).push(ms);\n}\nfunction printBuildTimings() {\n if (!buildTiming) return;\n console.info(\"\\n\\u{1F4CA} Build timing breakdown:\");\n for (const [label, times] of Object.entries(timings)) {\n const total = times.reduce((a, b) => a + b, 0);\n const avg = total / times.length;\n console.info(\n ` ${label}: ${avg.toFixed(1)}ms avg, ${total.toFixed(0)}ms total (${times.length} calls)`\n );\n }\n}\nasync function buildPage(serverEntry, routerRoot, path, relativeId, params, foundRoute, clientManifestEntry, staticDir, clientDir, builtMiddlewares, serverJsPath, preloads, allCSS, layoutCSS, routePreloads, allCSSContents, criticalPreloads, deferredPreloads, useAfterLCP, useAfterLCPAggressive) {\n let t0 = performance.now();\n const render = await getRender(serverEntry);\n recordTiming(\"getRender\", performance.now() - t0);\n const htmlPath = encodeReservedFilenameChars(\n `${path.endsWith(\"/\") ? `${removeTrailingSlash(path)}/index` : path}.html`\n );\n const clientJsPath = clientManifestEntry ? normalizePath(join(clientDir, clientManifestEntry.file)) : \"\";\n const htmlOutPath = toAbsolute(join(staticDir, htmlPath));\n const preloadPath = getPreloadPath(path);\n const cssPreloadPath = getPreloadCSSPath(path);\n let loaderPath = \"\";\n let loaderData = {};\n try {\n const preloadContent = [\n // static imports for cache warming\n ...preloads.map((preload) => `import \"${preload}\"`),\n `const routes = globalThis.__importMetaGlobbed`,\n `await Promise.all(${JSON.stringify(routePreloads)}.map((key) => routes[key]().then((mod) => window.__oneRegisterPreloadedRoute(key, mod))))`\n ].join(\"\\n\");\n t0 = performance.now();\n await FSExtra.writeFile(\n join(clientDir, urlPathToFilePath(preloadPath)),\n preloadContent\n );\n recordTiming(\"writePreload\", performance.now() - t0);\n const uniqueCSS = [...new Set(allCSS)];\n const cssPreloadContent = `\nconst CSS_TIMEOUT = 1000\nconst cssUrls = ${JSON.stringify(uniqueCSS)}\n\n// Global cache for loaded CSS - avoids DOM queries and tracks across navigations\nconst loaded = (window.__oneLoadedCSS ||= new Set())\n\n// Prefetch CSS without applying - called on link hover\nexport function prefetchCSS() {\n cssUrls.forEach(href => {\n if (loaded.has(href)) return\n if (document.querySelector(\\`link[href=\"\\${href}\"]\\`)) return\n const link = document.createElement('link')\n link.rel = 'prefetch'\n link.as = 'style'\n link.href = href\n document.head.appendChild(link)\n })\n}\n\n// Inject CSS to apply styles - called on actual navigation\nexport function injectCSS() {\n return Promise.all(cssUrls.map(href => {\n // Skip if already loaded\n if (loaded.has(href)) return Promise.resolve()\n // Remove any prefetch link for this href\n const prefetchLink = document.querySelector(\\`link[rel=\"prefetch\"][href=\"\\${href}\"]\\`)\n if (prefetchLink) prefetchLink.remove()\n // Skip if stylesheet already exists in DOM\n if (document.querySelector(\\`link[rel=\"stylesheet\"][href=\"\\${href}\"]\\`)) {\n loaded.add(href)\n return Promise.resolve()\n }\n return new Promise(resolve => {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = href\n const timeoutId = setTimeout(() => {\n console.warn('[one] CSS load timeout:', href)\n loaded.add(href)\n resolve()\n }, CSS_TIMEOUT)\n link.onload = link.onerror = () => {\n clearTimeout(timeoutId)\n loaded.add(href)\n resolve()\n }\n document.head.appendChild(link)\n })\n }))\n}\n\n// For backwards compatibility, also prefetch on import\nprefetchCSS()\n`;\n t0 = performance.now();\n await FSExtra.writeFile(\n join(clientDir, urlPathToFilePath(cssPreloadPath)),\n cssPreloadContent\n );\n recordTiming(\"writeCSSPreload\", performance.now() - t0);\n t0 = performance.now();\n const exported = await getRouteExports(serverEntry, routerRoot, foundRoute.file);\n recordTiming(\"importServerModule\", performance.now() - t0);\n const loaderProps = { path, params };\n const matches = [];\n t0 = performance.now();\n if (foundRoute.layouts?.length) {\n const layoutResults = await Promise.all(\n foundRoute.layouts.map(async (layout) => {\n try {\n if (!layout.loaderServerPath) {\n return { contextKey: layout.contextKey, loaderData: void 0 };\n }\n const layoutExported = await getRouteExports(\n serverEntry,\n routerRoot,\n layout.contextKey\n );\n const layoutLoaderData = await layoutExported?.loader?.(loaderProps);\n return { contextKey: layout.contextKey, loaderData: layoutLoaderData };\n } catch (err) {\n if (isResponse(err)) {\n throw err;\n }\n console.warn(\n `[one] Warning: layout loader failed for ${layout.contextKey}:`,\n err\n );\n return { contextKey: layout.contextKey, loaderData: void 0 };\n }\n })\n );\n for (const result of layoutResults) {\n matches.push({\n routeId: result.contextKey,\n pathname: path,\n params: params || {},\n loaderData: result.loaderData\n });\n }\n }\n recordTiming(\"layoutLoaders\", performance.now() - t0);\n t0 = performance.now();\n let loaderRedirectInfo = null;\n if (exported.loader && foundRoute.type !== \"ssr\") {\n try {\n loaderData = await exported.loader?.(loaderProps) ?? null;\n } catch (err) {\n if (isResponse(err)) {\n loaderRedirectInfo = extractRedirectInfo(err);\n } else {\n throw err;\n }\n }\n if (!loaderRedirectInfo && loaderData && (isResponse(loaderData) || loaderData instanceof Response || loaderData?.constructor?.name === \"Response\")) {\n loaderRedirectInfo = extractRedirectInfo(loaderData);\n loaderData = {};\n }\n if (clientJsPath) {\n const loaderPartialPath = join(clientDir, urlPathToFilePath(getLoaderPath(path)));\n const uncachedNativePath = loaderPartialPath.replace(\n constants.LOADER_JS_POSTFIX,\n NATIVE_LOADER_JS_POSTFIX_UNCACHED\n );\n if (loaderRedirectInfo) {\n const redirectData = JSON.stringify({\n __oneRedirect: loaderRedirectInfo.path,\n __oneRedirectStatus: loaderRedirectInfo.status\n });\n await outputFile(\n loaderPartialPath,\n `export function loader(){return ${redirectData}}`\n );\n const nativeCjs = `exports.loader = function(){return ${redirectData}}`;\n await outputFile(loaderPartialPath.replace(/\\.js$/, \".native.js\"), nativeCjs);\n await outputFile(uncachedNativePath, nativeCjs);\n loaderPath = getLoaderPath(path);\n loaderData = {};\n } else {\n const data = JSON.stringify(loaderData);\n await outputFile(loaderPartialPath, `export function loader(){return ${data}}`);\n const nativeCjs = `exports.loader = function(){return ${data}}`;\n await outputFile(loaderPartialPath.replace(/\\.js$/, \".native.js\"), nativeCjs);\n await outputFile(uncachedNativePath, nativeCjs);\n loaderPath = getLoaderPath(path);\n }\n }\n }\n if (!exported.loader && foundRoute.type === \"spa\") {\n const loaderPartialPath = join(clientDir, urlPathToFilePath(getLoaderPath(path)));\n await outputFile(loaderPartialPath, \"export function loader() { return undefined }\");\n loaderPath = getLoaderPath(path);\n }\n recordTiming(\"pageLoader\", performance.now() - t0);\n matches.push({\n routeId: foundRoute.file,\n pathname: path,\n params: params || {},\n loaderData\n });\n if (foundRoute.type !== \"ssr\") {\n globalThis[\"__vxrnresetState\"]?.();\n if (foundRoute.type === \"ssg\") {\n const renderPreloads = useAfterLCPAggressive ? [] : criticalPreloads || preloads;\n const renderDeferredPreloads = useAfterLCPAggressive ? [] : deferredPreloads;\n t0 = performance.now();\n let html = await render({\n path,\n preloads: renderPreloads,\n deferredPreloads: renderDeferredPreloads,\n loaderProps,\n loaderData,\n css: allCSS,\n cssContents: allCSSContents,\n mode: \"ssg\",\n routePreloads,\n matches\n });\n recordTiming(\"ssrRender\", performance.now() - t0);\n if (useAfterLCP) {\n html = applyAfterLCPScriptLoad(\n html,\n useAfterLCPAggressive ? criticalPreloads || preloads : preloads\n );\n }\n t0 = performance.now();\n await outputFile(htmlOutPath, html);\n recordTiming(\"writeHTML\", performance.now() - t0);\n } else if (foundRoute.type === \"spa\") {\n const needsSpaShell = foundRoute.layouts?.some(\n (layout) => layout.layoutRenderMode === \"ssg\" || layout.layoutRenderMode === \"ssr\"\n );\n if (needsSpaShell) {\n globalThis[\"__vxrnresetState\"]?.();\n const renderPreloads = criticalPreloads || preloads;\n const renderDeferredPreloads = deferredPreloads || [];\n const layoutMatches = matches.slice(0, -1);\n t0 = performance.now();\n let html = await render({\n path,\n preloads: renderPreloads,\n deferredPreloads: renderDeferredPreloads,\n loaderProps,\n // don't pass loaderData for spa-shell - the page loader runs on client\n // passing {} here would make useLoaderState think data is preloaded\n loaderData: void 0,\n css: allCSS,\n cssContents: allCSSContents,\n mode: \"spa-shell\",\n routePreloads,\n matches: layoutMatches\n });\n recordTiming(\"spaShellRender\", performance.now() - t0);\n if (useAfterLCP) {\n html = applyAfterLCPScriptLoad(\n html,\n useAfterLCPAggressive ? criticalPreloads || preloads : preloads\n );\n }\n t0 = performance.now();\n await outputFile(htmlOutPath, html);\n recordTiming(\"writeHTML\", performance.now() - t0);\n } else {\n let renderCSSTag = function(file, index) {\n const content = allCSSContents?.[index];\n if (content) {\n return ` <style>${content}</style>`;\n }\n return ` <link rel=\"stylesheet\" href=${file} />`;\n };\n const layoutCSSSet = new Set(layoutCSS);\n const layoutCssOutput = allCSS.map((file, i) => layoutCSSSet.has(file) ? renderCSSTag(file, i) : \"\").filter(Boolean).join(\"\\n\");\n const pageCssOutput = allCSS.map((file, i) => !layoutCSSSet.has(file) ? renderCSSTag(file, i) : \"\").filter(Boolean).join(\"\\n\");\n const criticalScripts = (criticalPreloads || preloads).map((preload) => ` <script type=\"module\" src=\"${preload}\"></script>`).join(\"\\n\");\n await outputFile(\n htmlOutPath,\n `<!DOCTYPE html><html><head>\n ${constants.getSpaHeaderElements({ serverContext: { loaderProps, loaderData } })}\n ${layoutCssOutput}\n ${criticalScripts}\n ${pageCssOutput}\n </head><body></body></html>`\n );\n }\n }\n }\n } catch (err) {\n const errMsg = err instanceof Error ? `${err.message}\n${err.stack}` : `${err}`;\n console.error(\n `Error building static page at ${path} with id ${relativeId}:\n\n${errMsg}\n\nloaderData:\n\n${JSON.stringify(loaderData || null, null, 2)}\nparams:\n\n${JSON.stringify(params || null, null, 2)}`\n );\n console.error(err);\n throw err;\n }\n const middlewares = (foundRoute.middlewares || []).map(\n (x) => builtMiddlewares[x.contextKey]\n );\n const cleanPath = path === \"/\" ? path : removeTrailingSlash(path);\n return {\n type: foundRoute.type,\n css: allCSS,\n layoutCSS,\n cssContents: allCSSContents,\n routeFile: foundRoute.file,\n middlewares,\n cleanPath,\n preloadPath,\n cssPreloadPath,\n loaderPath,\n clientJsPath,\n serverJsPath: foundRoute.type === \"spa\" ? \"\" : serverJsPath,\n htmlPath,\n loaderData,\n params,\n path,\n preloads,\n criticalPreloads,\n deferredPreloads\n };\n}\nasync function getRender(serverEntry) {\n try {\n const serverImport = await import(toAbsoluteUrl(serverEntry));\n const render = serverImport.default.render || // for an unknown reason this is necessary\n serverImport.default.default?.render;\n if (typeof render !== \"function\") {\n throw new Error(`didn't find render function in entry: ${serverEntry}`);\n }\n return render;\n } catch (err) {\n console.error(`\\u274C Error importing the root entry:`);\n console.error(` This error happened in the built file: ${serverEntry}`);\n console.error(err[\"stack\"]);\n throw err;\n }\n}\nfunction removeTrailingSlash(path) {\n return path.endsWith(\"/\") ? path.slice(0, path.length - 1) : path;\n}\nfunction extractRedirectInfo(response) {\n if (response.status >= 300 && response.status < 400) {\n const location = response.headers.get(\"location\");\n if (location) {\n try {\n const url = new URL(location);\n return {\n path: url.pathname + url.search + url.hash,\n status: response.status\n };\n } catch {\n return { path: location, status: response.status };\n }\n }\n }\n return null;\n}\nfunction applyAfterLCPScriptLoad(html, preloads) {\n html = html.replace(/<script\\s+type=\"module\"[^>]*async[^>]*><\\/script>/gi, \"\");\n const loaderScript = `\n<script>\n(function() {\n var scripts = ${JSON.stringify(preloads)};\n function loadScripts() {\n scripts.forEach(function(src) {\n var script = document.createElement('script');\n script.type = 'module';\n script.src = src;\n document.head.appendChild(script);\n });\n }\n function waitIdle(n) {\n if (n <= 0) {\n requestAnimationFrame(function() {\n requestAnimationFrame(loadScripts);\n });\n return;\n }\n setTimeout(function() {\n setTimeout(function() {\n waitIdle(n - 1);\n }, 0);\n }, 0);\n }\n waitIdle(5);\n})();\n</script>`;\n html = html.replace(\"</head>\", `${loaderScript}</head>`);\n return html;\n}\nexport {\n buildPage,\n printBuildTimings\n};\n//# sourceMappingURL=buildPage.js.map\n"],"mappings":";;;;;;;;;;;AAcA,MAAM,EAAE,eAAe;AACvB,SAAS,kBAAkB,SAAS;CAClC,MAAM,QAAQ,QAAQ,QAAQ,OAAO,EAAE,CAAC,CAAC,MAAM,GAAG;CAClD,OAAO,KAAK,GAAG,KAAK;AACtB;AACA,MAAM,cAAc,QAAQ,IAAI,qBAAqB;AACrD,MAAM,UAAU,CAAC;AACjB,SAAS,aAAa,OAAO,IAAI;CAC/B,IAAI,CAAC,aAAa;CAClB,CAAC,QAAQ,WAAW,CA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eAAe;;;kBAGL,KAAK,UAAU,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;CAyBzC,OAAO,KAAK,QAAQ,WAAW,GAAG,aAAa,QAAQ;CACvD,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"buildPage.js","names":[],"sources":["esm/cli/buildPage.js"],"sourcesContent":["import { join } from \"node:path\";\nimport FSExtra from \"fs-extra\";\nimport { normalizePath } from \"vite\";\nimport * as constants from \"../constants\";\nimport { NATIVE_LOADER_JS_POSTFIX_UNCACHED } from \"../constants\";\nimport {\n encodeReservedFilenameChars,\n getLoaderPath,\n getPreloadCSSPath,\n getPreloadPath\n} from \"../utils/cleanUrl\";\nimport { isResponse } from \"../utils/isResponse\";\nimport { toAbsolute, toAbsoluteUrl } from \"../utils/toAbsolute\";\nimport { getRouteExports } from \"./serverRouteModules\";\nconst { outputFile } = FSExtra;\nfunction urlPathToFilePath(urlPath) {\n const parts = urlPath.replace(/^\\//, \"\").split(\"/\");\n return join(...parts);\n}\nconst buildTiming = process.env.ONE_BUILD_TIMING === \"1\";\nconst timings = {};\nfunction recordTiming(label, ms) {\n if (!buildTiming) return;\n (timings[label] ||= []).push(ms);\n}\nfunction printBuildTimings() {\n if (!buildTiming) return;\n console.info(\"\\n\\u{1F4CA} Build timing breakdown:\");\n for (const [label, times] of Object.entries(timings)) {\n const total = times.reduce((a, b) => a + b, 0);\n const avg = total / times.length;\n console.info(\n ` ${label}: ${avg.toFixed(1)}ms avg, ${total.toFixed(0)}ms total (${times.length} calls)`\n );\n }\n}\nasync function buildPage(serverEntry, routerRoot, path, relativeId, params, foundRoute, clientManifestEntry, staticDir, clientDir, builtMiddlewares, serverJsPath, preloads, allCSS, layoutCSS, routePreloads, allCSSContents, criticalPreloads, deferredPreloads, useAfterLCP, useAfterLCPAggressive) {\n let t0 = performance.now();\n const render = await getRender(serverEntry);\n recordTiming(\"getRender\", performance.now() - t0);\n const htmlPath = encodeReservedFilenameChars(\n `${path.endsWith(\"/\") ? `${removeTrailingSlash(path)}/index` : path}.html`\n );\n const clientJsPath = clientManifestEntry ? normalizePath(join(clientDir, clientManifestEntry.file)) : \"\";\n const htmlOutPath = toAbsolute(join(staticDir, htmlPath));\n const preloadPath = getPreloadPath(path);\n const cssPreloadPath = getPreloadCSSPath(path);\n let loaderPath = \"\";\n let loaderData = {};\n try {\n const preloadContent = [\n // static imports for cache warming\n ...preloads.map((preload) => `import \"${preload}\"`),\n `const routes = globalThis.__importMetaGlobbed`,\n `await Promise.all(${JSON.stringify(routePreloads)}.map((key) => routes[key]().then((mod) => window.__oneRegisterPreloadedRoute(key, mod))))`\n ].join(\"\\n\");\n t0 = performance.now();\n await FSExtra.writeFile(\n join(clientDir, urlPathToFilePath(preloadPath)),\n preloadContent\n );\n recordTiming(\"writePreload\", performance.now() - t0);\n const uniqueCSS = [...new Set(allCSS)];\n const cssPreloadContent = `\nconst CSS_TIMEOUT = 1000\nconst cssUrls = ${JSON.stringify(uniqueCSS)}\n\n// Global cache for loaded CSS - avoids DOM queries and tracks across navigations\nconst loaded = (window.__oneLoadedCSS ||= new Set())\n\n// Prefetch CSS without applying - called on link hover\nexport function prefetchCSS() {\n cssUrls.forEach(href => {\n if (loaded.has(href)) return\n if (document.querySelector(\\`link[href=\"\\${href}\"]\\`)) return\n const link = document.createElement('link')\n link.rel = 'prefetch'\n link.as = 'style'\n link.href = href\n document.head.appendChild(link)\n })\n}\n\n// Inject CSS to apply styles - called on actual navigation\nexport function injectCSS() {\n return Promise.all(cssUrls.map(href => {\n // Skip if already loaded\n if (loaded.has(href)) return Promise.resolve()\n // Remove any prefetch link for this href\n const prefetchLink = document.querySelector(\\`link[rel=\"prefetch\"][href=\"\\${href}\"]\\`)\n if (prefetchLink) prefetchLink.remove()\n // Skip if stylesheet already exists in DOM\n if (document.querySelector(\\`link[rel=\"stylesheet\"][href=\"\\${href}\"]\\`)) {\n loaded.add(href)\n return Promise.resolve()\n }\n return new Promise(resolve => {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = href\n const timeoutId = setTimeout(() => {\n console.warn('[one] CSS load timeout:', href)\n loaded.add(href)\n resolve()\n }, CSS_TIMEOUT)\n link.onload = link.onerror = () => {\n clearTimeout(timeoutId)\n loaded.add(href)\n resolve()\n }\n document.head.appendChild(link)\n })\n }))\n}\n\n// For backwards compatibility, also prefetch on import\nprefetchCSS()\n`;\n t0 = performance.now();\n await FSExtra.writeFile(\n join(clientDir, urlPathToFilePath(cssPreloadPath)),\n cssPreloadContent\n );\n recordTiming(\"writeCSSPreload\", performance.now() - t0);\n t0 = performance.now();\n const exported = await getRouteExports(serverEntry, routerRoot, foundRoute.file);\n recordTiming(\"importServerModule\", performance.now() - t0);\n const loaderProps = { path, params };\n const matches = [];\n t0 = performance.now();\n if (foundRoute.layouts?.length) {\n const layoutResults = await Promise.all(\n foundRoute.layouts.map(async (layout) => {\n try {\n if (!layout.loaderServerPath) {\n return { contextKey: layout.contextKey, loaderData: void 0 };\n }\n const layoutExported = await getRouteExports(\n serverEntry,\n routerRoot,\n layout.contextKey\n );\n const layoutLoaderData = await layoutExported?.loader?.(loaderProps);\n return { contextKey: layout.contextKey, loaderData: layoutLoaderData };\n } catch (err) {\n if (isResponse(err)) {\n throw err;\n }\n console.warn(\n `[one] Warning: layout loader failed for ${layout.contextKey}:`,\n err\n );\n return { contextKey: layout.contextKey, loaderData: void 0 };\n }\n })\n );\n for (const result of layoutResults) {\n matches.push({\n routeId: result.contextKey,\n pathname: path,\n params: params || {},\n loaderData: result.loaderData\n });\n }\n }\n recordTiming(\"layoutLoaders\", performance.now() - t0);\n t0 = performance.now();\n let loaderRedirectInfo = null;\n if (exported.loader && foundRoute.type !== \"ssr\") {\n try {\n loaderData = await exported.loader?.(loaderProps) ?? null;\n } catch (err) {\n if (isResponse(err)) {\n loaderRedirectInfo = extractRedirectInfo(err);\n } else {\n throw err;\n }\n }\n if (!loaderRedirectInfo && loaderData && (isResponse(loaderData) || loaderData instanceof Response || loaderData?.constructor?.name === \"Response\")) {\n loaderRedirectInfo = extractRedirectInfo(loaderData);\n loaderData = {};\n }\n if (clientJsPath) {\n const loaderPartialPath = join(clientDir, urlPathToFilePath(getLoaderPath(path)));\n const uncachedNativePath = loaderPartialPath.replace(\n constants.LOADER_JS_POSTFIX,\n NATIVE_LOADER_JS_POSTFIX_UNCACHED\n );\n if (loaderRedirectInfo) {\n const redirectData = JSON.stringify({\n __oneRedirect: loaderRedirectInfo.path,\n __oneRedirectStatus: loaderRedirectInfo.status\n });\n await outputFile(\n loaderPartialPath,\n `export function loader(){return ${redirectData}}`\n );\n const nativeCjs = `exports.loader = function(){return ${redirectData}}`;\n await outputFile(loaderPartialPath.replace(/\\.js$/, \".native.js\"), nativeCjs);\n await outputFile(uncachedNativePath, nativeCjs);\n loaderPath = getLoaderPath(path);\n loaderData = {};\n } else {\n const data = JSON.stringify(loaderData);\n await outputFile(loaderPartialPath, `export function loader(){return ${data}}`);\n const nativeCjs = `exports.loader = function(){return ${data}}`;\n await outputFile(loaderPartialPath.replace(/\\.js$/, \".native.js\"), nativeCjs);\n await outputFile(uncachedNativePath, nativeCjs);\n loaderPath = getLoaderPath(path);\n }\n }\n }\n if (!exported.loader && foundRoute.type === \"spa\") {\n const loaderPartialPath = join(clientDir, urlPathToFilePath(getLoaderPath(path)));\n await outputFile(loaderPartialPath, \"export function loader() { return undefined }\");\n loaderPath = getLoaderPath(path);\n }\n recordTiming(\"pageLoader\", performance.now() - t0);\n matches.push({\n routeId: foundRoute.file,\n pathname: path,\n params: params || {},\n loaderData\n });\n if (foundRoute.type !== \"ssr\") {\n globalThis[\"__vxrnresetState\"]?.();\n if (foundRoute.type === \"ssg\") {\n const renderPreloads = useAfterLCPAggressive ? [] : criticalPreloads || preloads;\n const renderDeferredPreloads = useAfterLCPAggressive ? [] : deferredPreloads;\n t0 = performance.now();\n let html = await render({\n path,\n preloads: renderPreloads,\n deferredPreloads: renderDeferredPreloads,\n loaderProps,\n loaderData,\n css: allCSS,\n cssContents: allCSSContents,\n mode: \"ssg\",\n routePreloads,\n matches\n });\n recordTiming(\"ssrRender\", performance.now() - t0);\n if (useAfterLCP) {\n html = applyAfterLCPScriptLoad(\n html,\n useAfterLCPAggressive ? criticalPreloads || preloads : preloads\n );\n }\n t0 = performance.now();\n await outputFile(htmlOutPath, html);\n recordTiming(\"writeHTML\", performance.now() - t0);\n } else if (foundRoute.type === \"spa\") {\n const needsSpaShell = foundRoute.layouts?.some(\n (layout) => layout.layoutRenderMode === \"ssg\" || layout.layoutRenderMode === \"ssr\"\n );\n if (needsSpaShell) {\n globalThis[\"__vxrnresetState\"]?.();\n const renderPreloads = criticalPreloads || preloads;\n const renderDeferredPreloads = deferredPreloads || [];\n const layoutMatches = matches.slice(0, -1);\n t0 = performance.now();\n let html = await render({\n path,\n preloads: renderPreloads,\n deferredPreloads: renderDeferredPreloads,\n loaderProps,\n // don't pass loaderData for spa-shell - the page loader runs on client\n // passing {} here would make useLoaderState think data is preloaded\n loaderData: void 0,\n css: allCSS,\n cssContents: allCSSContents,\n mode: \"spa-shell\",\n routePreloads,\n matches: layoutMatches\n });\n recordTiming(\"spaShellRender\", performance.now() - t0);\n if (useAfterLCP) {\n html = applyAfterLCPScriptLoad(\n html,\n useAfterLCPAggressive ? criticalPreloads || preloads : preloads\n );\n }\n t0 = performance.now();\n await outputFile(htmlOutPath, html);\n recordTiming(\"writeHTML\", performance.now() - t0);\n } else {\n let renderCSSTag = function(file, index) {\n const content = allCSSContents?.[index];\n if (content) {\n return ` <style>${content}</style>`;\n }\n return ` <link rel=\"stylesheet\" href=${file} />`;\n };\n const layoutCSSSet = new Set(layoutCSS);\n const layoutCssOutput = allCSS.map((file, i) => layoutCSSSet.has(file) ? renderCSSTag(file, i) : \"\").filter(Boolean).join(\"\\n\");\n const pageCssOutput = allCSS.map((file, i) => !layoutCSSSet.has(file) ? renderCSSTag(file, i) : \"\").filter(Boolean).join(\"\\n\");\n const criticalScripts = (criticalPreloads || preloads).map((preload) => ` <script type=\"module\" src=\"${preload}\"></script>`).join(\"\\n\");\n await outputFile(\n htmlOutPath,\n `<!DOCTYPE html><html><head>\n ${constants.getSpaHeaderElements({ serverContext: { loaderProps, loaderData } })}\n ${layoutCssOutput}\n ${criticalScripts}\n ${pageCssOutput}\n </head><body></body></html>`\n );\n }\n }\n }\n } catch (err) {\n const errMsg = err instanceof Error ? `${err.message}\n${err.stack}` : `${err}`;\n console.error(\n `Error building static page at ${path} with id ${relativeId}:\n\n${errMsg}\n\nloaderData:\n\n${JSON.stringify(loaderData || null, null, 2)}\nparams:\n\n${JSON.stringify(params || null, null, 2)}`\n );\n console.error(err);\n throw err;\n }\n const middlewares = (foundRoute.middlewares || []).map(\n (x) => builtMiddlewares[x.contextKey]\n );\n const cleanPath = path === \"/\" ? path : removeTrailingSlash(path);\n return {\n type: foundRoute.type,\n css: allCSS,\n layoutCSS,\n cssContents: allCSSContents,\n routeFile: foundRoute.file,\n middlewares,\n cleanPath,\n preloadPath,\n cssPreloadPath,\n loaderPath,\n clientJsPath,\n serverJsPath: foundRoute.type === \"spa\" ? \"\" : serverJsPath,\n htmlPath,\n loaderData,\n params,\n path,\n preloads,\n criticalPreloads,\n deferredPreloads\n };\n}\nasync function getRender(serverEntry) {\n try {\n const serverImport = await import(toAbsoluteUrl(serverEntry));\n const render = serverImport.default.render || // for an unknown reason this is necessary\n serverImport.default.default?.render;\n if (typeof render !== \"function\") {\n throw new Error(`didn't find render function in entry: ${serverEntry}`);\n }\n return render;\n } catch (err) {\n console.error(`\\u274C Error importing the root entry:`);\n console.error(` This error happened in the built file: ${serverEntry}`);\n console.error(err[\"stack\"]);\n throw err;\n }\n}\nfunction removeTrailingSlash(path) {\n return path.endsWith(\"/\") ? path.slice(0, path.length - 1) : path;\n}\nfunction extractRedirectInfo(response) {\n if (response.status >= 300 && response.status < 400) {\n const location = response.headers.get(\"location\");\n if (location) {\n try {\n const url = new URL(location);\n return {\n path: url.pathname + url.search + url.hash,\n status: response.status\n };\n } catch {\n return { path: location, status: response.status };\n }\n }\n }\n return null;\n}\nfunction applyAfterLCPScriptLoad(html, preloads) {\n html = html.replace(/<script\\s+type=\"module\"[^>]*async[^>]*><\\/script>/gi, \"\");\n const loaderScript = `\n<script>\n(function() {\n var scripts = ${JSON.stringify(preloads)};\n function loadScripts() {\n scripts.forEach(function(src) {\n var script = document.createElement('script');\n script.type = 'module';\n script.src = src;\n document.head.appendChild(script);\n });\n }\n function waitIdle(n) {\n if (n <= 0) {\n requestAnimationFrame(function() {\n requestAnimationFrame(loadScripts);\n });\n return;\n }\n setTimeout(function() {\n setTimeout(function() {\n waitIdle(n - 1);\n }, 0);\n }, 0);\n }\n // hydration must not start while the parser is still adding server markup\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', function() { waitIdle(5); });\n } else {\n waitIdle(5);\n }\n})();\n</script>`;\n html = html.replace(\"</head>\", `${loaderScript}</head>`);\n return html;\n}\nexport {\n buildPage,\n printBuildTimings\n};\n//# sourceMappingURL=buildPage.js.map\n"],"mappings":";;;;;;;;;;;AAcA,MAAM,EAAE,eAAe;AACvB,SAAS,kBAAkB,SAAS;CAClC,MAAM,QAAQ,QAAQ,QAAQ,OAAO,EAAE,CAAC,CAAC,MAAM,GAAG;CAClD,OAAO,KAAK,GAAG,KAAK;AACtB;AACA,MAAM,cAAc,QAAQ,IAAI,qBAAqB;AACrD,MAAM,UAAU,CAAC;AACjB,SAAS,aAAa,OAAO,IAAI;CAC/B,IAAI,CAAC,aAAa;CAClB,CAAC,QAAQ,WAAW,CAAC,EAAC,CAAE,KAAK,EAAE;AACjC;AACA,SAAS,oBAAoB;CAC3B,IAAI,CAAC,aAAa;CAClB,QAAQ,KAAK,8BAAqC;CAClD,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,OAAO,GAAG;EACpD,MAAM,QAAQ,MAAM,QAAQ,GAAG,MAAM,IAAI,GAAG,CAAC;EAC7C,MAAM,MAAM,QAAQ,MAAM;EAC1B,QAAQ,KACN,KAAK,MAA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ACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;AACA,eAAe,UAAU,aAAa;CACpC,IAAI;EACF,MAAM,eAAe,MAAM,OAAO,cAAc,WAAW;EAC3D,MAAM,SAAS,aAAa,QAAQ,UACpC,aAAa,QAAQ,SAAS;EAC9B,IAAI,OAAO,WAAW,YAAY;GAChC,MAAM,IAAI,MAAM,yCAAyC,aAAa;EACxE;EACA,OAAO;CACT,SAAS,KAAK;EACZ,QAAQ,MAAM,wCAAwC;EACtD,QAAQ,MAAM,4CAA4C,aAAa;EACvE,QAAQ,MAAM,IAAI,QAAQ;EAC1B,MAAM;CACR;AACF;AACA,SAAS,oBAAoB,MAAM;CACjC,OAAO,KAAK,SAAS,GAAG,IAAI,KAAK,MAAM,GAAG,KAAK,SAAS,CAAC,IAAI;AAC/D;AACA,SAAS,oBAAoB,UAAU;CACrC,IAAI,SAAS,UAAU,OAAO,SAAS,SAAS,KAAK;EACnD,MAAM,WAAW,SAAS,QAAQ,IAAI,UAAU;EAChD,IAAI,UAAU;GACZ,IAAI;IACF,MAAM,MAAM,IAAI,IAAI,QAAQ;IAC5B,OAAO;KACL,MAAM,IAAI,WAAW,IAAI,SAAS,IAAI;KACtC,QAAQ,SAAS;IACnB;GACF,QAAQ;IACN,OAAO;KAAE,MAAM;KAAU,QAAQ,SAAS;IAAO;GACnD;EACF;CACF;CACA,OAAO;AACT;AACA,SAAS,wBAAwB,MAAM,UAAU;CAC/C,OAAO,KAAK,QAAQ,uDAAuD,EAAE;CAC7E,MAAM,eAAe;;;kBAGL,KAAK,UAAU,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BzC,OAAO,KAAK,QAAQ,WAAW,GAAG,aAAa,QAAQ;CACvD,OAAO;AACT"}
|
|
@@ -444,7 +444,12 @@ function applyAfterLCPScriptLoad(html, preloads) {
|
|
|
444
444
|
}, 0);
|
|
445
445
|
}, 0);
|
|
446
446
|
}
|
|
447
|
-
|
|
447
|
+
// hydration must not start while the parser is still adding server markup
|
|
448
|
+
if (document.readyState === 'loading') {
|
|
449
|
+
document.addEventListener('DOMContentLoaded', function() { waitIdle(5); });
|
|
450
|
+
} else {
|
|
451
|
+
waitIdle(5);
|
|
452
|
+
}
|
|
448
453
|
})();
|
|
449
454
|
<\/script>`;
|
|
450
455
|
html = html.replace("</head>", `${loaderScript}</head>`);
|