one 2.6.21 → 2.6.22

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.
Files changed (47) hide show
  1. package/android/src/main/java/dev/onejs/onenative/OneNativeCameraManager.kt +24 -0
  2. package/android/src/main/java/dev/onejs/onenative/OneNativeCameraView.kt +197 -2
  3. package/dist/cjs/platform/camera/index.cjs +3 -2
  4. package/dist/cjs/platform/camera/index.native.cjs +89 -3
  5. package/dist/cjs/platform/camera/index.native.js +89 -3
  6. package/dist/cjs/platform/camera/index.native.js.map +1 -1
  7. package/dist/cjs/platform/specs/OneNativeCameraNativeComponent.cjs +37 -21
  8. package/dist/cjs/platform/specs/OneNativeCameraNativeComponent.native.cjs +37 -21
  9. package/dist/cjs/platform/specs/OneNativeCameraNativeComponent.native.js +37 -21
  10. package/dist/cjs/platform/specs/OneNativeCameraNativeComponent.native.js.map +3 -3
  11. package/dist/cjs/router/router.cjs +4 -1
  12. package/dist/esm/platform/camera/index.mjs +4 -2
  13. package/dist/esm/platform/camera/index.mjs.map +1 -1
  14. package/dist/esm/platform/camera/index.native.js +90 -4
  15. package/dist/esm/platform/camera/index.native.js.map +1 -1
  16. package/dist/esm/platform/specs/OneNativeCameraNativeComponent.mjs +25 -9
  17. package/dist/esm/platform/specs/OneNativeCameraNativeComponent.mjs.map +3 -3
  18. package/dist/esm/platform/specs/OneNativeCameraNativeComponent.native.js +25 -9
  19. package/dist/esm/platform/specs/OneNativeCameraNativeComponent.native.js.map +3 -3
  20. package/dist/esm/router/router.mjs +5 -2
  21. package/dist/esm/router/router.mjs.map +1 -1
  22. package/ios/OneNativeCameraComponentView.mm +28 -0
  23. package/ios/OneNativeCameraView.swift +163 -0
  24. package/package.json +12 -12
  25. package/src/index.ts +3 -0
  26. package/src/platform/camera/index.native.tsx +116 -12
  27. package/src/platform/camera/index.tsx +15 -4
  28. package/src/platform/camera/types.ts +22 -0
  29. package/src/platform/index.native.ts +4 -0
  30. package/src/platform/index.ts +4 -0
  31. package/src/platform/specs/OneNativeCameraNativeComponent.ts +35 -2
  32. package/src/router/router.ts +7 -4
  33. package/types/index.d.ts +1 -1
  34. package/types/index.d.ts.map +1 -1
  35. package/types/platform/camera/index.d.ts +3 -3
  36. package/types/platform/camera/index.d.ts.map +1 -1
  37. package/types/platform/camera/index.native.d.ts +3 -3
  38. package/types/platform/camera/index.native.d.ts.map +1 -1
  39. package/types/platform/camera/types.d.ts +18 -0
  40. package/types/platform/camera/types.d.ts.map +1 -1
  41. package/types/platform/index.d.ts +1 -1
  42. package/types/platform/index.d.ts.map +1 -1
  43. package/types/platform/index.native.d.ts +1 -1
  44. package/types/platform/index.native.d.ts.map +1 -1
  45. package/types/platform/specs/OneNativeCameraNativeComponent.d.ts +18 -2
  46. package/types/platform/specs/OneNativeCameraNativeComponent.d.ts.map +1 -1
  47. package/types/router/router.d.ts.map +1 -1
@@ -7,7 +7,7 @@ import { resolve } from "../link/path.mjs";
7
7
  import { checkBlocker } from "../useBlocker.mjs";
8
8
  import { assertIsReady } from "../utils/assertIsReady.mjs";
9
9
  import { getLoaderPath, getPreloadCSSPath, getPreloadPath } from "../utils/cleanUrl.mjs";
10
- import { dynamicImport, handleSkewError, isChunkLoadError } from "../utils/dynamicImport.mjs";
10
+ import { dynamicImport, isChunkLoadError } from "../utils/dynamicImport.mjs";
11
11
  import { PLATFORM } from "../utils/platform.mjs";
12
12
  import { isVersionStale } from "../skewProtection.mjs";
13
13
  import { hasFileExtension, shouldLinkExternally, shouldPreloadRoute } from "../utils/url.mjs";
@@ -566,7 +566,10 @@ function preloadRoute(href, injectCSS = false) {
566
566
  }
567
567
  return data;
568
568
  }, (err) => {
569
- if (injectCSS && process.env.ONE_SKEW_PROTECTION !== "false" && isChunkLoadError(err) && handleSkewError()) return new Promise(() => {});
569
+ if (injectCSS && process.env.ONE_SKEW_PROTECTION !== "false" && isChunkLoadError(err)) {
570
+ window.location.href = href;
571
+ return new Promise(() => {});
572
+ }
570
573
  return null;
571
574
  });
572
575
  }
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","names":[],"sources":["esm/router/router.js"],"sourcesContent":["import { StackActions } from \"@react-navigation/native\";\nimport { Fragment, startTransition, useDeferredValue, useEffect, useReducer, useSyncExternalStore } from \"react\";\nimport { devtoolsRegistry } from \"../devtools/registry\";\nimport { resolveHref } from \"../link/href\";\nimport { openExternalURL } from \"../link/openExternalURL\";\nimport { resolve } from \"../link/path\";\nimport { checkBlocker } from \"../useBlocker\";\nimport { assertIsReady } from \"../utils/assertIsReady\";\nimport { getLoaderPath, getPreloadCSSPath, getPreloadPath } from \"../utils/cleanUrl\";\nimport { dynamicImport, handleSkewError, isChunkLoadError } from \"../utils/dynamicImport\";\nimport { PLATFORM } from \"../utils/platform\";\nimport { isVersionStale } from \"../skewProtection\";\nimport { hasFileExtension, shouldLinkExternally, shouldPreloadRoute } from \"../utils/url\";\nimport { ParamValidationError, RouteValidationError, validateParams } from \"../validateParams\";\nimport { extractParamsFromState, extractPathnameFromHref, extractSearchFromHref, findRouteNodeFromState } from \"./findRouteNode\";\nimport { getRouteInfo } from \"./getRouteInfo\";\nimport { isStateAwaitingNavigatorMount } from \"./isStateAwaitingNavigatorMount\";\nimport { getRouteArtifactPaths } from \"./getRouteArtifactPath\";\nimport { getRoutes } from \"./getRoutes\";\nimport { setLastAction } from \"./lastAction\";\nimport { getResolvedLinking, resetLinking, setupLinking } from \"./linkingConfig\";\nimport { getSafeWindowPath, getSafeWindowPathname, getSafeWindowPathname as getSafeWindowPathname2, normalizeRoutePathname, stripTrailingSlash } from \"./path\";\nimport { sortRoutes } from \"./sortRoutes\";\nimport { getQualifiedRouteComponent } from \"./useScreens\";\nimport { preloadRouteModules } from \"./useViteRoutes\";\nimport { getNavigateAction } from \"./utils/getNavigateAction\";\nimport { setClientMatches } from \"../useMatches\";\nimport { findInterceptRoute, setNavigationType, storeInterceptState, updateURLWithoutNavigation } from \"./interceptRoutes\";\nimport { setSlotState } from \"../views/Navigator\";\nimport { clearNotFoundState, findNearestNotFoundRoute, setNotFoundState } from \"../notFoundState\";\n\nlet routeNode = null;\nlet rootComponent;\nconst 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\tconst normalizedHref = extractPathnameFromHref(href).replace(/^\\/+|\\/+$/g, \"\");\n\tfor (const [contextKey, guardedRedirects] of protectedRouteRegistry) {\n\t\tconst normalizedContextKey = contextKey.replace(/^\\/+|\\/+$/g, \"\");\n\t\tif (!normalizedContextKey || normalizedHref === normalizedContextKey || normalizedHref.startsWith(`${normalizedContextKey}/`)) {\n\t\t\tconst routeName = normalizedHref.slice(normalizedContextKey.length).replace(/^\\//, \"\").split(\"/\")[0] || \"index\";\n\t\t\tconst normalizedRouteName = routeName.replace(/\\/index$/, \"\");\n\t\t\tif (guardedRedirects.has(routeName)) return guardedRedirects.get(routeName);\n\t\t\tif (guardedRedirects.has(normalizedRouteName)) return guardedRedirects.get(normalizedRouteName);\n\t\t}\n\t}\n\treturn false;\n}\nfunction resolveProtectedHref(href) {\n\tlet target = href;\n\tconst visited = /* @__PURE__ */ new Set();\n\twhile (!visited.has(target)) {\n\t\tvisited.add(target);\n\t\tconst redirectTo = getProtectedRedirect(target);\n\t\tif (redirectTo === false) return target;\n\t\tif (redirectTo === void 0) return;\n\t\ttarget = resolveHref(redirectTo);\n\t}\n}\nfunction isRouteProtected(href) {\n\treturn getProtectedRedirect(href) !== false;\n}\nlet hasAttemptedToHideSplash = false;\nlet initialState;\nlet rootState;\nlet initialPathname;\nlet lastIntendedPathname;\nlet nextState;\nlet routeInfo;\nlet splashScreenAnimationFrame;\nlet pendingNavigationPathname;\nlet pendingNavigationAction;\nlet navigationRef = null;\nconst rootStateSubscribers = /* @__PURE__ */ new Set();\nconst loadingStateSubscribers = /* @__PURE__ */ new Set();\nconst storeSubscribers = /* @__PURE__ */ new Set();\nlet currentMatches = [];\nlet validationState = { status: \"idle\" };\nconst validationStateSubscribers = /* @__PURE__ */ new Set();\nfunction subscribeToValidationState(subscriber) {\n\tvalidationStateSubscribers.add(subscriber);\n\treturn () => validationStateSubscribers.delete(subscriber);\n}\nfunction setValidationState(state) {\n\tvalidationState = state;\n\tfor (const subscriber of validationStateSubscribers) subscriber(state);\n\tif (state.status === \"error\" && state.error) window.dispatchEvent(new CustomEvent(\"one-validation-error\", { detail: {\n\t\terror: {\n\t\t\tmessage: state.error.message,\n\t\t\tname: state.error.name,\n\t\t\tstack: state.error.stack\n\t\t},\n\t\thref: state.lastValidatedHref,\n\t\ttimestamp: Date.now()\n\t} }));\n}\nfunction getValidationState() {\n\treturn validationState;\n}\nfunction useValidationState() {\n\treturn useSyncExternalStore(subscribeToValidationState, getValidationState, getValidationState);\n}\nlet cachedRouteNode = null;\nlet cachedRootComponent = null;\nlet cachedContext = null;\nfunction initialize(context, ref, initialLocation, linking) {\n\tcleanUpState();\n\tif (context !== cachedContext || !cachedRouteNode) {\n\t\tcachedRouteNode = getRoutes(context, {\n\t\t\tignoreEntryPoints: true,\n\t\t\tplatform: PLATFORM\n\t\t});\n\t\tcachedRootComponent = cachedRouteNode ? getQualifiedRouteComponent(cachedRouteNode) : Fragment;\n\t\tcachedContext = context;\n\t}\n\trouteNode = cachedRouteNode;\n\trootComponent = cachedRootComponent || 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\tconst formatRouteTree = (node, indent = \"\", isLast = true) => {\n\t\t\tconst prefix = indent + (isLast ? \"└─ \" : \"├─ \");\n\t\t\tconst childIndent = indent + (isLast ? \" \" : \"│ \");\n\t\t\tconst dynamicBadge = node.dynamic ? ` [${node.dynamic.map((d) => d.name).join(\", \")}]` : \"\";\n\t\t\tconst typeBadge = node.type !== \"layout\" ? ` (${node.type})` : \"\";\n\t\t\tconst slotsBadge = node.slots?.size ? ` {@${Array.from(node.slots.keys()).join(\", @\")}}` : \"\";\n\t\t\tlet line = `${prefix}${node.route || \"/\"}${dynamicBadge}${typeBadge}${slotsBadge}`;\n\t\t\tconst visibleChildren = node.children.filter((child) => !child.internal);\n\t\t\tfor (let i = 0; i < visibleChildren.length; i++) {\n\t\t\t\tconst child = visibleChildren[i];\n\t\t\t\tconst 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?.size) {\n\t\t\tconsole.info(`[one] \\u{1F4E6} Slots on root layout:`);\n\t\t\tfor (const [slotName, slotConfig] of routeNode.slots) console.info(` @${slotName}:`, {\n\t\t\t\tdefaultRoute: slotConfig.defaultRoute?.route,\n\t\t\t\tinterceptRoutes: slotConfig.interceptRoutes.map((r) => ({\n\t\t\t\t\troute: r.route,\n\t\t\t\t\tintercept: r.intercept\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\tresetLinking();\n\trootStateSubscribers.clear();\n\tstoreSubscribers.clear();\n}\nfunction setupLinkingAndRouteInfo(initialLocation, linking) {\n\tinitialState = setupLinking(routeNode, initialLocation, linking);\n\tinitialPathname = initialLocation?.pathname ?? getSafeWindowPathname();\n\tif (initialState) {\n\t\trootState = initialState;\n\t\trouteInfo = 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\tlet 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(() => {});\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\tlet 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) startTransition(() => {\n\t\tfor (const subscriber of rootStateSubscribers) subscriber(state);\n\t});\n}\nfunction subscribeToNavigationChanges() {\n\tstartTransition(() => {\n\t\tupdateSnapshot();\n\t\tfor (const subscriber of storeSubscribers) subscriber();\n\t});\n}\nfunction navigate(url, options) {\n\treturn linkTo(resolveHref(url), \"NAVIGATE\", options);\n}\nfunction push(url, options) {\n\treturn linkTo(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?.dispatch(StackActions.pop(count));\n}\nfunction replace(url, options) {\n\treturn linkTo(resolveHref(url), \"REPLACE\", options);\n}\nfunction setParams(params = {}) {\n\tassertIsReady(navigationRef);\n\treturn navigationRef?.current?.setParams(params);\n}\nfunction dismissAll() {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} dismissAll`);\n\tnavigationRef?.dispatch(StackActions.popToTop());\n}\nfunction goBack() {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} goBack`);\n\tassertIsReady(navigationRef);\n\tnavigationRef?.current?.goBack();\n}\nfunction canGoBack() {\n\tif (!navigationRef.isReady()) return false;\n\treturn navigationRef?.current?.canGoBack() ?? false;\n}\nfunction canDismiss() {\n\tlet state = rootState;\n\twhile (state) {\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.index]?.state;\n\t}\n\treturn false;\n}\nfunction getSortedRoutes() {\n\tif (!routeNode) throw new Error(\"No routes\");\n\treturn routeNode.children.filter((route) => !route.internal).sort(sortRoutes);\n}\nfunction updateState(state, nextStateParam = state) {\n\trootState = state;\n\tnextState = nextStateParam;\n\tif (isStateAwaitingNavigatorMount(state, routeNode)) {\n\t\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F9ED} keeping ${routeInfo?.pathname}: a navigator has not mounted`);\n\t\treturn;\n\t}\n\tconst nextRouteInfo = 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\tconst from = routeInfo?.pathname || \"(initial)\";\n\t\t\tconst to = nextRouteInfo.pathname;\n\t\t\tconst 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}\n\tif (process.env.NODE_ENV === \"development\" && typeof window !== \"undefined\") {\n\t\twindow.__oneDevtools = {\n\t\t\trouteInfo: nextRouteInfo,\n\t\t\trootState: state,\n\t\t\trouteNode,\n\t\t\tgetRoutes: () => routeNode?.children || [],\n\t\t\tgetLoaderTimingHistory: () => devtoolsRegistry.getLoaderTimingHistory?.() ?? [],\n\t\t\tgetPreloadHistory\n\t\t};\n\t\twindow.dispatchEvent(new CustomEvent(\"one-route-change\", { detail: nextRouteInfo }));\n\t}\n}\nfunction consumePendingNavigationAction() {\n\tconst action = pendingNavigationAction;\n\tpendingNavigationAction = void 0;\n\treturn action;\n}\nfunction subscribeToRootState(subscriber) {\n\trootStateSubscribers.add(subscriber);\n\treturn () => {\n\t\trootStateSubscribers.delete(subscriber);\n\t};\n}\nfunction notifyRootStateSubscribers(state) {\n\tfor (const subscriber of rootStateSubscribers) subscriber(state);\n}\nfunction subscribeToStore(subscriber) {\n\tstoreSubscribers.add(subscriber);\n\treturn () => {\n\t\tstoreSubscribers.delete(subscriber);\n\t};\n}\nfunction subscribeToLoadingState(subscriber) {\n\tloadingStateSubscribers.add(subscriber);\n\treturn () => {\n\t\tloadingStateSubscribers.delete(subscriber);\n\t};\n}\nfunction setLoadingState(state) {\n\tstartTransition(() => {\n\t\tfor (const listener of loadingStateSubscribers) listener(state);\n\t});\n}\nlet 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: 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\tconst pathname = getSafeWindowPathname();\n\treturn pathname === void 0 ? void 0 : normalizeRoutePathname(pathname);\n}\nfunction shouldKeepPendingNavigationState(currentState) {\n\tif (!pendingNavigationPathname) return false;\n\treturn getRouteInfo(currentState).pathname !== pendingNavigationPathname;\n}\nfunction shouldPreserveInitialRouteInfo(currentState) {\n\tif (!initialState || !routeInfo?.pathname) return false;\n\tconst nextPathname = getRouteInfo(currentState).pathname;\n\tif (nextPathname === routeInfo.pathname) return false;\n\tif (nextPathname && nextPathname === pendingNavigationPathname) return false;\n\tconst browserPathname = getBrowserPathname();\n\tif (nextPathname && browserPathname && nextPathname === browserPathname) return false;\n\treturn true;\n}\nfunction useOneRouter() {\n\treturn useDeferredValue(useSyncExternalStore(subscribeToStore, snapshot, snapshot));\n}\nfunction syncStoreRootState() {\n\tif (!navigationRef) throw new Error(`No navigationRef, possible duplicate One dep`);\n\tif (navigationRef.isReady()) {\n\t\tconst 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\tconst [state, rerender] = useReducer(snapshot2, void 0, snapshot2);\n\tuseEffect(() => {\n\t\tconst unsubscribe = subscribeToRootState(rerender);\n\t\trerender();\n\t\treturn unsubscribe;\n\t}, []);\n\tconst browserPath = getSafeWindowPath();\n\treturn browserPath !== void 0 && routeInfo?.unstable_globalHref === browserPath + window.location.hash ? snapshot2() : state;\n}\nfunction useStoreRootState() {\n\tsyncStoreRootState();\n\treturn useDeferredValue(useRootStateSnapshot(rootStateSnapshot));\n}\nfunction useStoreRouteInfo() {\n\tsyncStoreRootState();\n\treturn useRootStateSnapshot(routeInfoSnapshot);\n}\nfunction cleanup() {\n\tif (splashScreenAnimationFrame) cancelAnimationFrame(splashScreenAnimationFrame);\n}\nconst preloadingLoader = {};\nconst PRELOAD_MAP_MAX = 200;\nfunction setBoundedPreloadRecord(record, key, value) {\n\tif (!(key in record)) {\n\t\tconst keys = Object.keys(record);\n\t\tif (keys.length >= PRELOAD_MAP_MAX) delete record[keys[0]];\n\t}\n\trecord[key] = value;\n}\nasync function doPreloadDev(href) {\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tconst startTime = performance.now();\n\t\tconst normalizedPath = normalizeLoaderPath(href);\n\t\tif (globalThis[\"__vxrnHeadless\"]) return null;\n\t\ttry {\n\t\t\tconst loaderJSUrl = getLoaderPath(href, true);\n\t\t\tconst moduleLoadStart = performance.now();\n\t\t\tconst modulePromise = dynamicImport(loaderJSUrl, false);\n\t\t\tif (!modulePromise) return null;\n\t\t\tconst module = await modulePromise.catch(() => null);\n\t\t\tconst moduleLoadTime = performance.now() - moduleLoadStart;\n\t\t\tif (!module?.loader) return null;\n\t\t\tconst executionStart = performance.now();\n\t\t\tconst result = await module.loader();\n\t\t\tconst executionTime = performance.now() - executionStart;\n\t\t\tconst totalTime = performance.now() - startTime;\n\t\t\tif (result?.__oneRedirect) return result;\n\t\t\tdevtoolsRegistry.recordLoaderTiming?.({\n\t\t\t\tpath: normalizedPath,\n\t\t\t\tstartTime,\n\t\t\t\tmoduleLoadTime,\n\t\t\t\texecutionTime,\n\t\t\t\ttotalTime,\n\t\t\t\tsource: \"preload\"\n\t\t\t});\n\t\t\treturn result ?? null;\n\t\t} catch (err) {\n\t\t\tconst totalTime = performance.now() - startTime;\n\t\t\tdevtoolsRegistry.recordLoaderTiming?.({\n\t\t\t\tpath: normalizedPath,\n\t\t\t\tstartTime,\n\t\t\t\ttotalTime,\n\t\t\t\terror: err instanceof Error ? err.message : String(err),\n\t\t\t\tsource: \"preload\"\n\t\t\t});\n\t\t\tif (process.env.ONE_DEBUG_ROUTER) console.warn(`[one] dev preload failed for ${href}:`, err);\n\t\t\treturn null;\n\t\t}\n\t}\n}\nasync function doPreload(href) {\n\tif (globalThis[\"__vxrnHeadless\"]) return null;\n\tconst artifactPaths = getRouteArtifactPaths(href, getResolvedLinking(), routeNode);\n\tconst preloadPath = getPreloadPath(artifactPaths.preload);\n\tconst loaderPath = getLoaderPath(artifactPaths.loader);\n\tconst cssPreloadPath = getPreloadCSSPath(artifactPaths.preload);\n\trecordPreloadStart(href);\n\ttry {\n\t\tconst [_preload, cssPreloadModule, loader] = await Promise.all([\n\t\t\tdynamicImport(preloadPath, false),\n\t\t\tdynamicImport(cssPreloadPath, false),\n\t\t\tdynamicImport(loaderPath, false),\n\t\t\tpreloadRouteModules(href)\n\t\t]);\n\t\tconst hasCss = !!cssPreloadModule?.injectCSS;\n\t\tif (hasCss) setBoundedCssInject(href, cssPreloadModule.injectCSS);\n\t\tif (!!!loader?.loader) {\n\t\t\trecordPreloadComplete(href, false, hasCss);\n\t\t\treturn null;\n\t\t}\n\t\tconst result = await loader.loader();\n\t\tif (result?.__oneRedirect) return result;\n\t\trecordPreloadComplete(href, true, hasCss);\n\t\treturn result ?? null;\n\t} catch (err) {\n\t\tconst errorMessage = err instanceof Error ? err.message : String(err);\n\t\tconsole.error(`[one] preload error for ${href}:`, err);\n\t\trecordPreloadError(href, errorMessage);\n\t\tthrow err;\n\t}\n}\nconst preloadedLoaderData = {};\nconst cssInjectFunctions = {};\nfunction setBoundedCssInject(key, value) {\n\tif (!(key in cssInjectFunctions)) {\n\t\tconst keys = Object.keys(cssInjectFunctions);\n\t\tif (keys.length >= PRELOAD_MAP_MAX) delete cssInjectFunctions[keys[0]];\n\t}\n\tcssInjectFunctions[key] = value;\n}\nconst preloadHistory = [];\nconst MAX_PRELOAD_HISTORY = 30;\nfunction recordPreloadStart(href) {\n\tif (process.env.NODE_ENV !== \"development\") return;\n\tconst existing = preloadHistory.find((p) => p.href === href);\n\tif (existing) {\n\t\texisting.status = \"loading\";\n\t\texisting.startTime = performance.now();\n\t\treturn;\n\t}\n\tpreloadHistory.unshift({\n\t\thref,\n\t\tstatus: \"loading\",\n\t\tstartTime: performance.now(),\n\t\thasLoader: false,\n\t\thasCss: false\n\t});\n\tif (preloadHistory.length > MAX_PRELOAD_HISTORY) preloadHistory.pop();\n\tdispatchPreloadEvent();\n}\nfunction recordPreloadComplete(href, hasLoader, hasCss) {\n\tif (process.env.NODE_ENV !== \"development\") return;\n\tconst entry = preloadHistory.find((p) => p.href === href);\n\tif (entry) {\n\t\tentry.status = \"loaded\";\n\t\tentry.endTime = performance.now();\n\t\tentry.hasLoader = hasLoader;\n\t\tentry.hasCss = hasCss;\n\t}\n\tdispatchPreloadEvent();\n}\nfunction recordPreloadError(href, error) {\n\tif (process.env.NODE_ENV !== \"development\") return;\n\tconst entry = preloadHistory.find((p) => p.href === href);\n\tif (entry) {\n\t\tentry.status = \"error\";\n\t\tentry.endTime = performance.now();\n\t\tentry.error = error;\n\t}\n\tdispatchPreloadEvent();\n}\nfunction dispatchPreloadEvent() {\n\twindow.dispatchEvent(new CustomEvent(\"one-preload-update\"));\n}\nfunction getPreloadHistory() {\n\treturn preloadHistory;\n}\nfunction preloadRoute(href, injectCSS = false) {\n\tif (!shouldPreloadRoute(href)) return;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tconst normalizedHref = normalizeLoaderPath(href);\n\t\tif (!preloadingLoader[normalizedHref]) setBoundedPreloadRecord(preloadingLoader, normalizedHref, doPreloadDev(href).then((data) => {\n\t\t\tsetBoundedPreloadRecord(preloadedLoaderData, normalizedHref, data);\n\t\t\treturn data;\n\t\t}));\n\t\treturn preloadingLoader[normalizedHref];\n\t}\n\tif (!preloadingLoader[href]) setBoundedPreloadRecord(preloadingLoader, href, doPreload(href).then((data) => {\n\t\tsetBoundedPreloadRecord(preloadedLoaderData, href, data);\n\t\treturn data;\n\t}).catch((err) => {\n\t\tdelete preloadingLoader[href];\n\t\tthrow err;\n\t}));\n\treturn preloadingLoader[href]?.then(async (data) => {\n\t\tif (injectCSS) {\n\t\t\tconst inject = cssInjectFunctions[href];\n\t\t\tif (inject) await Promise.race([inject(), new Promise((r) => setTimeout(r, 800))]);\n\t\t}\n\t\treturn data;\n\t}, (err) => {\n\t\tif (injectCSS && process.env.ONE_SKEW_PROTECTION !== \"false\" && isChunkLoadError(err) && handleSkewError()) return new Promise(() => {});\n\t\treturn null;\n\t});\n}\nfunction normalizeLoaderPath(href) {\n\treturn new URL(href, \"http://example.com\").pathname.replace(/\\/index$/, \"\").replace(/\\/$/, \"\") || \"/\";\n}\nfunction buildClientMatches(href, matchingNode, params, loaderData) {\n\tconst pathname = extractPathnameFromHref(href);\n\tconst routeId = matchingNode?.contextKey || pathname;\n\tconst layoutMatches = currentMatches.filter((m) => m.routeId.includes(\"_layout\"));\n\tconst pageMatch = {\n\t\trouteId,\n\t\tpathname,\n\t\tparams,\n\t\tloaderData\n\t};\n\treturn [...layoutMatches, pageMatch];\n}\nfunction initClientMatches(matches) {\n\tcurrentMatches = matches;\n\tsetClientMatches(matches);\n}\nasync function linkTo(href, event, options) {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F517} ${event || \"NAVIGATE\"} ${href}`);\n\tsetNavigationType(\"soft\");\n\tclearNotFoundState();\n\tif (href[0] === \"#\") return;\n\tif (shouldLinkExternally(href)) {\n\t\topenExternalURL(href);\n\t\treturn;\n\t}\n\tif (hasFileExtension(href)) {\n\t\twindow.location.href = href;\n\t\treturn;\n\t}\n\tif (isVersionStale()) {\n\t\twindow.location.href = href;\n\t\treturn;\n\t}\n\tif (checkBlocker(href, event === \"REPLACE\" ? \"replace\" : \"push\")) return;\n\tconst protectedHref = resolveProtectedHref(href);\n\tif (!protectedHref) return;\n\tif (protectedHref !== href) return linkTo(protectedHref, \"REPLACE\", options);\n\tconst currentLayoutNode = routeNode;\n\tconst currentPath = routeInfo?.pathname || \"/\";\n\tconst interceptResult = findInterceptRoute(href, currentLayoutNode, currentPath);\n\tif (interceptResult) {\n\t\tconst { interceptRoute, slotName, layoutContextKey, params: params2 } = interceptResult;\n\t\tconst scopedSlotKey = `${layoutContextKey}:${slotName}`;\n\t\tstoreInterceptState(scopedSlotKey, interceptRoute, params2);\n\t\tupdateURLWithoutNavigation(href);\n\t\tsetSlotState(scopedSlotKey, {\n\t\t\tactiveRouteKey: interceptRoute.contextKey,\n\t\t\tactiveRouteNode: interceptRoute,\n\t\t\tparams: params2,\n\t\t\tisIntercepted: true\n\t\t});\n\t\treturn;\n\t}\n\tassertIsReady(navigationRef);\n\tconst current = navigationRef.current;\n\tif (current == null) throw new Error(\"Couldn't find a navigation object. Is your component inside NavigationContainer?\");\n\tconst linking = getResolvedLinking();\n\tif (!linking) throw new Error(\"Attempted to link to route when no routes are present\");\n\tsetLastAction();\n\tif (href === \"..\" || href === \"../\") {\n\t\tcurrent.goBack();\n\t\treturn;\n\t}\n\tif (href.startsWith(\".\")) {\n\t\tlet base = routeInfo?.segments?.map((segment) => {\n\t\t\tif (!segment.startsWith(\"[\")) return segment;\n\t\t\tif (segment.startsWith(\"[...\")) {\n\t\t\t\tsegment = segment.slice(4, -1);\n\t\t\t\tconst params2 = routeInfo?.params?.[segment];\n\t\t\t\tif (Array.isArray(params2)) return params2.join(\"/\");\n\t\t\t\treturn params2?.split(\",\")?.join(\"/\") ?? \"\";\n\t\t\t}\n\t\t\tsegment = segment.slice(1, -1);\n\t\t\treturn routeInfo?.params?.[segment];\n\t\t}).filter(Boolean).join(\"/\") ?? \"/\";\n\t\tif (!routeInfo?.isIndex) base += \"/..\";\n\t\thref = resolve(base, href);\n\t}\n\tconst 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\tconst normalizedPreloadPath = normalizeLoaderPath(href);\n\tif (!(normalizedPreloadPath in preloadedLoaderData) && !(href in preloadedLoaderData)) await preloadRoute(href, true);\n\telse if (process.env.NODE_ENV !== \"development\") {\n\t\tconst inject = cssInjectFunctions[href];\n\t\tif (inject) inject().catch(() => {});\n\t}\n\tconst preloadResult = preloadedLoaderData[normalizedPreloadPath];\n\tif (preloadResult?.__oneRedirect) {\n\t\tconst 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?.__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\tconst notFoundRoute = findNearestNotFoundRoute(href, routeNode);\n\t\tsetNotFoundState({\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\tconst matchingRouteNode = findRouteNodeFromState(state, routeNode);\n\tif (matchingRouteNode?.loadRoute) {\n\t\tsetValidationState({\n\t\t\tstatus: \"validating\",\n\t\t\tlastValidatedHref: href\n\t\t});\n\t\ttry {\n\t\t\tconst loadedRoute = matchingRouteNode.loadRoute();\n\t\t\tconst params2 = extractParamsFromState(state);\n\t\t\tconst search = extractSearchFromHref(href);\n\t\t\tconst pathname = extractPathnameFromHref(href);\n\t\t\tif (loadedRoute.validateParams) validateParams(loadedRoute.validateParams, params2);\n\t\t\tif (loadedRoute.validateRoute) {\n\t\t\t\tconst validationResult = await loadedRoute.validateRoute({\n\t\t\t\t\tparams: params2,\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\tconst error = new 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,\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\tawait error.catch(() => {});\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 ParamValidationError || error instanceof 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\tconst loaderData = preloadedLoaderData[normalizeLoaderPath(href)];\n\tconst params = extractParamsFromState(state);\n\tconst newMatches = buildClientMatches(href, matchingRouteNode, params, loaderData);\n\tcurrentMatches = newMatches;\n\tsetClientMatches(newMatches);\n\tif (!navigationRef.isReady()) {\n\t\tsetLoadingState(\"loaded\");\n\t\treturn;\n\t}\n\tconst currentRootState = navigationRef.getRootState();\n\tconst hash = href.indexOf(\"#\");\n\tif (currentRootState?.key && hash > 0) hashes[currentRootState.key] = href.slice(hash);\n\tnextOptions = options ?? null;\n\tpendingNavigationPathname = stripTrailingSlash(extractPathnameFromHref(href));\n\tpendingNavigationAction = event === \"PUSH\" || event === \"REPLACE\" || event === \"NAVIGATE\" ? event : void 0;\n\tlastIntendedPathname = pendingNavigationPathname;\n\tconst freshRootState = navigationRef.getRootState();\n\tconst currentRouteBeforeDispatch = navigationRef.getCurrentRoute();\n\tconst targetPathname = pendingNavigationPathname;\n\tconst optimisticState = nextOptions ? {\n\t\t...state,\n\t\tlinkOptions: nextOptions\n\t} : state;\n\tconst action = event === \"REPLACE\" ? null : getNavigateAction(state, freshRootState, event);\n\tstartTransition(() => {\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\tconst targetName = action.payload?.name;\n\t\t\tconst isGroupTarget = typeof targetName === \"string\" && targetName.startsWith(\"(\") && targetName.endsWith(\")\");\n\t\t\tconst hasFreshRootState = freshRootState.type === \"stack\";\n\t\t\tconst isRootTarget = action.target === freshRootState.key;\n\t\t\tconst currentFocusedRoute = freshRootState.routes[freshRootState.index];\n\t\t\tconst currentFocusedName = currentFocusedRoute?.name;\n\t\t\tif (isRootTarget && isGroupTarget && hasFreshRootState) {\n\t\t\t\tconst targetRoute = state.routes[state.index ?? state.routes.length - 1];\n\t\t\t\tconst targetRootName = targetRoute.name;\n\t\t\t\tif (currentFocusedName === targetRootName) {\n\t\t\t\t\tconst 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: currentFocusedRoute?.key ?? 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\tconst existingTargetRoute = freshRootState.routes.find((route) => route.name === targetRootName);\n\t\t\t\t\tconst existingRoutes = freshRootState.routes.filter((route) => route.name !== targetRootName);\n\t\t\t\t\tconst 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: existingTargetRoute?.key ?? `${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\tlet warningTm;\n\tconst interval = setInterval(() => {\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(() => {\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(() => {\n\t\tconsole.warn(`Routing took more than 8 seconds`);\n\t}, 1e3);\n}\nconst hashes = {};\nlet 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 (let 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\tconst keysA = Object.keys(a);\n\t\tconst keysB = Object.keys(b);\n\t\tif (keysA.length !== keysB.length) return false;\n\t\tfor (const key of keysA) if (!deepEqual(a[key], b[key])) return false;\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nexport { canDismiss, canGoBack, cleanup, consumePendingNavigationAction, dismiss, dismissAll, getPreloadHistory, getSafeWindowPathname2 as getSafeWindowPathname, getSortedRoutes, getValidationState, goBack, handleNavigationContainerStateChange, hasAttemptedToHideSplash, initClientMatches, initialPathname, initialState, initialize, isRouteProtected, lastIntendedPathname, linkTo, navigate, navigationRef, preloadRoute, preloadedLoaderData, preloadingLoader, push, registerProtectedRoutes, replace, resolveProtectedHref, rootComponent, rootState, rootStateSnapshot, routeInfo, routeInfoSnapshot, routeNode, setLoadingState, setParams, setValidationState, snapshot, subscribeToLoadingState, subscribeToRootState, subscribeToStore, subscribeToValidationState, unregisterProtectedRoutes, updateState, useOneRouter, useStoreRootState, useStoreRouteInfo, useValidationState };"],"mappings":";;;;;;;;;;;;;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,QAAQ,KAAK,kCAAkC;CAChD,GAAG,GAAG;AACP;AACA,MAAM,SAAS,CAAC;AAChB,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,MAAM,QAAQ,OAAO,KAAK,CAAC;EAC3B,MAAM,QAAQ,OAAO,KAAK,CAAC;EAC3B,IAAI,MAAM,WAAW,MAAM,QAAQ,OAAO;EAC1C,KAAK,MAAM,OAAO,OAAO,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO;EAChE,OAAO;CACR;CACA,OAAO;AACR"}
1
+ {"version":3,"file":"router.js","names":[],"sources":["esm/router/router.js"],"sourcesContent":["import { StackActions } from \"@react-navigation/native\";\nimport { Fragment, startTransition, useDeferredValue, useEffect, useReducer, useSyncExternalStore } from \"react\";\nimport { devtoolsRegistry } from \"../devtools/registry\";\nimport { resolveHref } from \"../link/href\";\nimport { openExternalURL } from \"../link/openExternalURL\";\nimport { resolve } from \"../link/path\";\nimport { checkBlocker } from \"../useBlocker\";\nimport { assertIsReady } from \"../utils/assertIsReady\";\nimport { getLoaderPath, getPreloadCSSPath, getPreloadPath } from \"../utils/cleanUrl\";\nimport { dynamicImport, isChunkLoadError } from \"../utils/dynamicImport\";\nimport { PLATFORM } from \"../utils/platform\";\nimport { isVersionStale } from \"../skewProtection\";\nimport { hasFileExtension, shouldLinkExternally, shouldPreloadRoute } from \"../utils/url\";\nimport { ParamValidationError, RouteValidationError, validateParams } from \"../validateParams\";\nimport { extractParamsFromState, extractPathnameFromHref, extractSearchFromHref, findRouteNodeFromState } from \"./findRouteNode\";\nimport { getRouteInfo } from \"./getRouteInfo\";\nimport { isStateAwaitingNavigatorMount } from \"./isStateAwaitingNavigatorMount\";\nimport { getRouteArtifactPaths } from \"./getRouteArtifactPath\";\nimport { getRoutes } from \"./getRoutes\";\nimport { setLastAction } from \"./lastAction\";\nimport { getResolvedLinking, resetLinking, setupLinking } from \"./linkingConfig\";\nimport { getSafeWindowPath, getSafeWindowPathname, getSafeWindowPathname as getSafeWindowPathname2, normalizeRoutePathname, stripTrailingSlash } from \"./path\";\nimport { sortRoutes } from \"./sortRoutes\";\nimport { getQualifiedRouteComponent } from \"./useScreens\";\nimport { preloadRouteModules } from \"./useViteRoutes\";\nimport { getNavigateAction } from \"./utils/getNavigateAction\";\nimport { setClientMatches } from \"../useMatches\";\nimport { findInterceptRoute, setNavigationType, storeInterceptState, updateURLWithoutNavigation } from \"./interceptRoutes\";\nimport { setSlotState } from \"../views/Navigator\";\nimport { clearNotFoundState, findNearestNotFoundRoute, setNotFoundState } from \"../notFoundState\";\n\nlet routeNode = null;\nlet rootComponent;\nconst 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\tconst normalizedHref = extractPathnameFromHref(href).replace(/^\\/+|\\/+$/g, \"\");\n\tfor (const [contextKey, guardedRedirects] of protectedRouteRegistry) {\n\t\tconst normalizedContextKey = contextKey.replace(/^\\/+|\\/+$/g, \"\");\n\t\tif (!normalizedContextKey || normalizedHref === normalizedContextKey || normalizedHref.startsWith(`${normalizedContextKey}/`)) {\n\t\t\tconst routeName = normalizedHref.slice(normalizedContextKey.length).replace(/^\\//, \"\").split(\"/\")[0] || \"index\";\n\t\t\tconst normalizedRouteName = routeName.replace(/\\/index$/, \"\");\n\t\t\tif (guardedRedirects.has(routeName)) return guardedRedirects.get(routeName);\n\t\t\tif (guardedRedirects.has(normalizedRouteName)) return guardedRedirects.get(normalizedRouteName);\n\t\t}\n\t}\n\treturn false;\n}\nfunction resolveProtectedHref(href) {\n\tlet target = href;\n\tconst visited = /* @__PURE__ */ new Set();\n\twhile (!visited.has(target)) {\n\t\tvisited.add(target);\n\t\tconst redirectTo = getProtectedRedirect(target);\n\t\tif (redirectTo === false) return target;\n\t\tif (redirectTo === void 0) return;\n\t\ttarget = resolveHref(redirectTo);\n\t}\n}\nfunction isRouteProtected(href) {\n\treturn getProtectedRedirect(href) !== false;\n}\nlet hasAttemptedToHideSplash = false;\nlet initialState;\nlet rootState;\nlet initialPathname;\nlet lastIntendedPathname;\nlet nextState;\nlet routeInfo;\nlet splashScreenAnimationFrame;\nlet pendingNavigationPathname;\nlet pendingNavigationAction;\nlet navigationRef = null;\nconst rootStateSubscribers = /* @__PURE__ */ new Set();\nconst loadingStateSubscribers = /* @__PURE__ */ new Set();\nconst storeSubscribers = /* @__PURE__ */ new Set();\nlet currentMatches = [];\nlet validationState = { status: \"idle\" };\nconst validationStateSubscribers = /* @__PURE__ */ new Set();\nfunction subscribeToValidationState(subscriber) {\n\tvalidationStateSubscribers.add(subscriber);\n\treturn () => validationStateSubscribers.delete(subscriber);\n}\nfunction setValidationState(state) {\n\tvalidationState = state;\n\tfor (const subscriber of validationStateSubscribers) subscriber(state);\n\tif (state.status === \"error\" && state.error) window.dispatchEvent(new CustomEvent(\"one-validation-error\", { detail: {\n\t\terror: {\n\t\t\tmessage: state.error.message,\n\t\t\tname: state.error.name,\n\t\t\tstack: state.error.stack\n\t\t},\n\t\thref: state.lastValidatedHref,\n\t\ttimestamp: Date.now()\n\t} }));\n}\nfunction getValidationState() {\n\treturn validationState;\n}\nfunction useValidationState() {\n\treturn useSyncExternalStore(subscribeToValidationState, getValidationState, getValidationState);\n}\nlet cachedRouteNode = null;\nlet cachedRootComponent = null;\nlet cachedContext = null;\nfunction initialize(context, ref, initialLocation, linking) {\n\tcleanUpState();\n\tif (context !== cachedContext || !cachedRouteNode) {\n\t\tcachedRouteNode = getRoutes(context, {\n\t\t\tignoreEntryPoints: true,\n\t\t\tplatform: PLATFORM\n\t\t});\n\t\tcachedRootComponent = cachedRouteNode ? getQualifiedRouteComponent(cachedRouteNode) : Fragment;\n\t\tcachedContext = context;\n\t}\n\trouteNode = cachedRouteNode;\n\trootComponent = cachedRootComponent || 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\tconst formatRouteTree = (node, indent = \"\", isLast = true) => {\n\t\t\tconst prefix = indent + (isLast ? \"└─ \" : \"├─ \");\n\t\t\tconst childIndent = indent + (isLast ? \" \" : \"│ \");\n\t\t\tconst dynamicBadge = node.dynamic ? ` [${node.dynamic.map((d) => d.name).join(\", \")}]` : \"\";\n\t\t\tconst typeBadge = node.type !== \"layout\" ? ` (${node.type})` : \"\";\n\t\t\tconst slotsBadge = node.slots?.size ? ` {@${Array.from(node.slots.keys()).join(\", @\")}}` : \"\";\n\t\t\tlet line = `${prefix}${node.route || \"/\"}${dynamicBadge}${typeBadge}${slotsBadge}`;\n\t\t\tconst visibleChildren = node.children.filter((child) => !child.internal);\n\t\t\tfor (let i = 0; i < visibleChildren.length; i++) {\n\t\t\t\tconst child = visibleChildren[i];\n\t\t\t\tconst 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?.size) {\n\t\t\tconsole.info(`[one] \\u{1F4E6} Slots on root layout:`);\n\t\t\tfor (const [slotName, slotConfig] of routeNode.slots) console.info(` @${slotName}:`, {\n\t\t\t\tdefaultRoute: slotConfig.defaultRoute?.route,\n\t\t\t\tinterceptRoutes: slotConfig.interceptRoutes.map((r) => ({\n\t\t\t\t\troute: r.route,\n\t\t\t\t\tintercept: r.intercept\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\tresetLinking();\n\trootStateSubscribers.clear();\n\tstoreSubscribers.clear();\n}\nfunction setupLinkingAndRouteInfo(initialLocation, linking) {\n\tinitialState = setupLinking(routeNode, initialLocation, linking);\n\tinitialPathname = initialLocation?.pathname ?? getSafeWindowPathname();\n\tif (initialState) {\n\t\trootState = initialState;\n\t\trouteInfo = 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\tlet 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(() => {});\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\tlet 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) startTransition(() => {\n\t\tfor (const subscriber of rootStateSubscribers) subscriber(state);\n\t});\n}\nfunction subscribeToNavigationChanges() {\n\tstartTransition(() => {\n\t\tupdateSnapshot();\n\t\tfor (const subscriber of storeSubscribers) subscriber();\n\t});\n}\nfunction navigate(url, options) {\n\treturn linkTo(resolveHref(url), \"NAVIGATE\", options);\n}\nfunction push(url, options) {\n\treturn linkTo(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?.dispatch(StackActions.pop(count));\n}\nfunction replace(url, options) {\n\treturn linkTo(resolveHref(url), \"REPLACE\", options);\n}\nfunction setParams(params = {}) {\n\tassertIsReady(navigationRef);\n\treturn navigationRef?.current?.setParams(params);\n}\nfunction dismissAll() {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} dismissAll`);\n\tnavigationRef?.dispatch(StackActions.popToTop());\n}\nfunction goBack() {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F519} goBack`);\n\tassertIsReady(navigationRef);\n\tnavigationRef?.current?.goBack();\n}\nfunction canGoBack() {\n\tif (!navigationRef.isReady()) return false;\n\treturn navigationRef?.current?.canGoBack() ?? false;\n}\nfunction canDismiss() {\n\tlet state = rootState;\n\twhile (state) {\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.index]?.state;\n\t}\n\treturn false;\n}\nfunction getSortedRoutes() {\n\tif (!routeNode) throw new Error(\"No routes\");\n\treturn routeNode.children.filter((route) => !route.internal).sort(sortRoutes);\n}\nfunction updateState(state, nextStateParam = state) {\n\trootState = state;\n\tnextState = nextStateParam;\n\tif (isStateAwaitingNavigatorMount(state, routeNode)) {\n\t\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F9ED} keeping ${routeInfo?.pathname}: a navigator has not mounted`);\n\t\treturn;\n\t}\n\tconst nextRouteInfo = 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\tconst from = routeInfo?.pathname || \"(initial)\";\n\t\t\tconst to = nextRouteInfo.pathname;\n\t\t\tconst 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}\n\tif (process.env.NODE_ENV === \"development\" && typeof window !== \"undefined\") {\n\t\twindow.__oneDevtools = {\n\t\t\trouteInfo: nextRouteInfo,\n\t\t\trootState: state,\n\t\t\trouteNode,\n\t\t\tgetRoutes: () => routeNode?.children || [],\n\t\t\tgetLoaderTimingHistory: () => devtoolsRegistry.getLoaderTimingHistory?.() ?? [],\n\t\t\tgetPreloadHistory\n\t\t};\n\t\twindow.dispatchEvent(new CustomEvent(\"one-route-change\", { detail: nextRouteInfo }));\n\t}\n}\nfunction consumePendingNavigationAction() {\n\tconst action = pendingNavigationAction;\n\tpendingNavigationAction = void 0;\n\treturn action;\n}\nfunction subscribeToRootState(subscriber) {\n\trootStateSubscribers.add(subscriber);\n\treturn () => {\n\t\trootStateSubscribers.delete(subscriber);\n\t};\n}\nfunction notifyRootStateSubscribers(state) {\n\tfor (const subscriber of rootStateSubscribers) subscriber(state);\n}\nfunction subscribeToStore(subscriber) {\n\tstoreSubscribers.add(subscriber);\n\treturn () => {\n\t\tstoreSubscribers.delete(subscriber);\n\t};\n}\nfunction subscribeToLoadingState(subscriber) {\n\tloadingStateSubscribers.add(subscriber);\n\treturn () => {\n\t\tloadingStateSubscribers.delete(subscriber);\n\t};\n}\nfunction setLoadingState(state) {\n\tstartTransition(() => {\n\t\tfor (const listener of loadingStateSubscribers) listener(state);\n\t});\n}\nlet 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: 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\tconst pathname = getSafeWindowPathname();\n\treturn pathname === void 0 ? void 0 : normalizeRoutePathname(pathname);\n}\nfunction shouldKeepPendingNavigationState(currentState) {\n\tif (!pendingNavigationPathname) return false;\n\treturn getRouteInfo(currentState).pathname !== pendingNavigationPathname;\n}\nfunction shouldPreserveInitialRouteInfo(currentState) {\n\tif (!initialState || !routeInfo?.pathname) return false;\n\tconst nextPathname = getRouteInfo(currentState).pathname;\n\tif (nextPathname === routeInfo.pathname) return false;\n\tif (nextPathname && nextPathname === pendingNavigationPathname) return false;\n\tconst browserPathname = getBrowserPathname();\n\tif (nextPathname && browserPathname && nextPathname === browserPathname) return false;\n\treturn true;\n}\nfunction useOneRouter() {\n\treturn useDeferredValue(useSyncExternalStore(subscribeToStore, snapshot, snapshot));\n}\nfunction syncStoreRootState() {\n\tif (!navigationRef) throw new Error(`No navigationRef, possible duplicate One dep`);\n\tif (navigationRef.isReady()) {\n\t\tconst 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\tconst [state, rerender] = useReducer(snapshot2, void 0, snapshot2);\n\tuseEffect(() => {\n\t\tconst unsubscribe = subscribeToRootState(rerender);\n\t\trerender();\n\t\treturn unsubscribe;\n\t}, []);\n\tconst browserPath = getSafeWindowPath();\n\treturn browserPath !== void 0 && routeInfo?.unstable_globalHref === browserPath + window.location.hash ? snapshot2() : state;\n}\nfunction useStoreRootState() {\n\tsyncStoreRootState();\n\treturn useDeferredValue(useRootStateSnapshot(rootStateSnapshot));\n}\nfunction useStoreRouteInfo() {\n\tsyncStoreRootState();\n\treturn useRootStateSnapshot(routeInfoSnapshot);\n}\nfunction cleanup() {\n\tif (splashScreenAnimationFrame) cancelAnimationFrame(splashScreenAnimationFrame);\n}\nconst preloadingLoader = {};\nconst PRELOAD_MAP_MAX = 200;\nfunction setBoundedPreloadRecord(record, key, value) {\n\tif (!(key in record)) {\n\t\tconst keys = Object.keys(record);\n\t\tif (keys.length >= PRELOAD_MAP_MAX) delete record[keys[0]];\n\t}\n\trecord[key] = value;\n}\nasync function doPreloadDev(href) {\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tconst startTime = performance.now();\n\t\tconst normalizedPath = normalizeLoaderPath(href);\n\t\tif (globalThis[\"__vxrnHeadless\"]) return null;\n\t\ttry {\n\t\t\tconst loaderJSUrl = getLoaderPath(href, true);\n\t\t\tconst moduleLoadStart = performance.now();\n\t\t\tconst modulePromise = dynamicImport(loaderJSUrl, false);\n\t\t\tif (!modulePromise) return null;\n\t\t\tconst module = await modulePromise.catch(() => null);\n\t\t\tconst moduleLoadTime = performance.now() - moduleLoadStart;\n\t\t\tif (!module?.loader) return null;\n\t\t\tconst executionStart = performance.now();\n\t\t\tconst result = await module.loader();\n\t\t\tconst executionTime = performance.now() - executionStart;\n\t\t\tconst totalTime = performance.now() - startTime;\n\t\t\tif (result?.__oneRedirect) return result;\n\t\t\tdevtoolsRegistry.recordLoaderTiming?.({\n\t\t\t\tpath: normalizedPath,\n\t\t\t\tstartTime,\n\t\t\t\tmoduleLoadTime,\n\t\t\t\texecutionTime,\n\t\t\t\ttotalTime,\n\t\t\t\tsource: \"preload\"\n\t\t\t});\n\t\t\treturn result ?? null;\n\t\t} catch (err) {\n\t\t\tconst totalTime = performance.now() - startTime;\n\t\t\tdevtoolsRegistry.recordLoaderTiming?.({\n\t\t\t\tpath: normalizedPath,\n\t\t\t\tstartTime,\n\t\t\t\ttotalTime,\n\t\t\t\terror: err instanceof Error ? err.message : String(err),\n\t\t\t\tsource: \"preload\"\n\t\t\t});\n\t\t\tif (process.env.ONE_DEBUG_ROUTER) console.warn(`[one] dev preload failed for ${href}:`, err);\n\t\t\treturn null;\n\t\t}\n\t}\n}\nasync function doPreload(href) {\n\tif (globalThis[\"__vxrnHeadless\"]) return null;\n\tconst artifactPaths = getRouteArtifactPaths(href, getResolvedLinking(), routeNode);\n\tconst preloadPath = getPreloadPath(artifactPaths.preload);\n\tconst loaderPath = getLoaderPath(artifactPaths.loader);\n\tconst cssPreloadPath = getPreloadCSSPath(artifactPaths.preload);\n\trecordPreloadStart(href);\n\ttry {\n\t\tconst [_preload, cssPreloadModule, loader] = await Promise.all([\n\t\t\tdynamicImport(preloadPath, false),\n\t\t\tdynamicImport(cssPreloadPath, false),\n\t\t\tdynamicImport(loaderPath, false),\n\t\t\tpreloadRouteModules(href)\n\t\t]);\n\t\tconst hasCss = !!cssPreloadModule?.injectCSS;\n\t\tif (hasCss) setBoundedCssInject(href, cssPreloadModule.injectCSS);\n\t\tif (!!!loader?.loader) {\n\t\t\trecordPreloadComplete(href, false, hasCss);\n\t\t\treturn null;\n\t\t}\n\t\tconst result = await loader.loader();\n\t\tif (result?.__oneRedirect) return result;\n\t\trecordPreloadComplete(href, true, hasCss);\n\t\treturn result ?? null;\n\t} catch (err) {\n\t\tconst errorMessage = err instanceof Error ? err.message : String(err);\n\t\tconsole.error(`[one] preload error for ${href}:`, err);\n\t\trecordPreloadError(href, errorMessage);\n\t\tthrow err;\n\t}\n}\nconst preloadedLoaderData = {};\nconst cssInjectFunctions = {};\nfunction setBoundedCssInject(key, value) {\n\tif (!(key in cssInjectFunctions)) {\n\t\tconst keys = Object.keys(cssInjectFunctions);\n\t\tif (keys.length >= PRELOAD_MAP_MAX) delete cssInjectFunctions[keys[0]];\n\t}\n\tcssInjectFunctions[key] = value;\n}\nconst preloadHistory = [];\nconst MAX_PRELOAD_HISTORY = 30;\nfunction recordPreloadStart(href) {\n\tif (process.env.NODE_ENV !== \"development\") return;\n\tconst existing = preloadHistory.find((p) => p.href === href);\n\tif (existing) {\n\t\texisting.status = \"loading\";\n\t\texisting.startTime = performance.now();\n\t\treturn;\n\t}\n\tpreloadHistory.unshift({\n\t\thref,\n\t\tstatus: \"loading\",\n\t\tstartTime: performance.now(),\n\t\thasLoader: false,\n\t\thasCss: false\n\t});\n\tif (preloadHistory.length > MAX_PRELOAD_HISTORY) preloadHistory.pop();\n\tdispatchPreloadEvent();\n}\nfunction recordPreloadComplete(href, hasLoader, hasCss) {\n\tif (process.env.NODE_ENV !== \"development\") return;\n\tconst entry = preloadHistory.find((p) => p.href === href);\n\tif (entry) {\n\t\tentry.status = \"loaded\";\n\t\tentry.endTime = performance.now();\n\t\tentry.hasLoader = hasLoader;\n\t\tentry.hasCss = hasCss;\n\t}\n\tdispatchPreloadEvent();\n}\nfunction recordPreloadError(href, error) {\n\tif (process.env.NODE_ENV !== \"development\") return;\n\tconst entry = preloadHistory.find((p) => p.href === href);\n\tif (entry) {\n\t\tentry.status = \"error\";\n\t\tentry.endTime = performance.now();\n\t\tentry.error = error;\n\t}\n\tdispatchPreloadEvent();\n}\nfunction dispatchPreloadEvent() {\n\twindow.dispatchEvent(new CustomEvent(\"one-preload-update\"));\n}\nfunction getPreloadHistory() {\n\treturn preloadHistory;\n}\nfunction preloadRoute(href, injectCSS = false) {\n\tif (!shouldPreloadRoute(href)) return;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tconst normalizedHref = normalizeLoaderPath(href);\n\t\tif (!preloadingLoader[normalizedHref]) setBoundedPreloadRecord(preloadingLoader, normalizedHref, doPreloadDev(href).then((data) => {\n\t\t\tsetBoundedPreloadRecord(preloadedLoaderData, normalizedHref, data);\n\t\t\treturn data;\n\t\t}));\n\t\treturn preloadingLoader[normalizedHref];\n\t}\n\tif (!preloadingLoader[href]) setBoundedPreloadRecord(preloadingLoader, href, doPreload(href).then((data) => {\n\t\tsetBoundedPreloadRecord(preloadedLoaderData, href, data);\n\t\treturn data;\n\t}).catch((err) => {\n\t\tdelete preloadingLoader[href];\n\t\tthrow err;\n\t}));\n\treturn preloadingLoader[href]?.then(async (data) => {\n\t\tif (injectCSS) {\n\t\t\tconst inject = cssInjectFunctions[href];\n\t\t\tif (inject) await Promise.race([inject(), new Promise((r) => setTimeout(r, 800))]);\n\t\t}\n\t\treturn data;\n\t}, (err) => {\n\t\tif (injectCSS && process.env.ONE_SKEW_PROTECTION !== \"false\" && isChunkLoadError(err)) {\n\t\t\twindow.location.href = href;\n\t\t\treturn new Promise(() => {});\n\t\t}\n\t\treturn null;\n\t});\n}\nfunction normalizeLoaderPath(href) {\n\treturn new URL(href, \"http://example.com\").pathname.replace(/\\/index$/, \"\").replace(/\\/$/, \"\") || \"/\";\n}\nfunction buildClientMatches(href, matchingNode, params, loaderData) {\n\tconst pathname = extractPathnameFromHref(href);\n\tconst routeId = matchingNode?.contextKey || pathname;\n\tconst layoutMatches = currentMatches.filter((m) => m.routeId.includes(\"_layout\"));\n\tconst pageMatch = {\n\t\trouteId,\n\t\tpathname,\n\t\tparams,\n\t\tloaderData\n\t};\n\treturn [...layoutMatches, pageMatch];\n}\nfunction initClientMatches(matches) {\n\tcurrentMatches = matches;\n\tsetClientMatches(matches);\n}\nasync function linkTo(href, event, options) {\n\tif (process.env.ONE_DEBUG_ROUTER) console.info(`[one] \\u{1F517} ${event || \"NAVIGATE\"} ${href}`);\n\tsetNavigationType(\"soft\");\n\tclearNotFoundState();\n\tif (href[0] === \"#\") return;\n\tif (shouldLinkExternally(href)) {\n\t\topenExternalURL(href);\n\t\treturn;\n\t}\n\tif (hasFileExtension(href)) {\n\t\twindow.location.href = href;\n\t\treturn;\n\t}\n\tif (isVersionStale()) {\n\t\twindow.location.href = href;\n\t\treturn;\n\t}\n\tif (checkBlocker(href, event === \"REPLACE\" ? \"replace\" : \"push\")) return;\n\tconst protectedHref = resolveProtectedHref(href);\n\tif (!protectedHref) return;\n\tif (protectedHref !== href) return linkTo(protectedHref, \"REPLACE\", options);\n\tconst currentLayoutNode = routeNode;\n\tconst currentPath = routeInfo?.pathname || \"/\";\n\tconst interceptResult = findInterceptRoute(href, currentLayoutNode, currentPath);\n\tif (interceptResult) {\n\t\tconst { interceptRoute, slotName, layoutContextKey, params: params2 } = interceptResult;\n\t\tconst scopedSlotKey = `${layoutContextKey}:${slotName}`;\n\t\tstoreInterceptState(scopedSlotKey, interceptRoute, params2);\n\t\tupdateURLWithoutNavigation(href);\n\t\tsetSlotState(scopedSlotKey, {\n\t\t\tactiveRouteKey: interceptRoute.contextKey,\n\t\t\tactiveRouteNode: interceptRoute,\n\t\t\tparams: params2,\n\t\t\tisIntercepted: true\n\t\t});\n\t\treturn;\n\t}\n\tassertIsReady(navigationRef);\n\tconst current = navigationRef.current;\n\tif (current == null) throw new Error(\"Couldn't find a navigation object. Is your component inside NavigationContainer?\");\n\tconst linking = getResolvedLinking();\n\tif (!linking) throw new Error(\"Attempted to link to route when no routes are present\");\n\tsetLastAction();\n\tif (href === \"..\" || href === \"../\") {\n\t\tcurrent.goBack();\n\t\treturn;\n\t}\n\tif (href.startsWith(\".\")) {\n\t\tlet base = routeInfo?.segments?.map((segment) => {\n\t\t\tif (!segment.startsWith(\"[\")) return segment;\n\t\t\tif (segment.startsWith(\"[...\")) {\n\t\t\t\tsegment = segment.slice(4, -1);\n\t\t\t\tconst params2 = routeInfo?.params?.[segment];\n\t\t\t\tif (Array.isArray(params2)) return params2.join(\"/\");\n\t\t\t\treturn params2?.split(\",\")?.join(\"/\") ?? \"\";\n\t\t\t}\n\t\t\tsegment = segment.slice(1, -1);\n\t\t\treturn routeInfo?.params?.[segment];\n\t\t}).filter(Boolean).join(\"/\") ?? \"/\";\n\t\tif (!routeInfo?.isIndex) base += \"/..\";\n\t\thref = resolve(base, href);\n\t}\n\tconst 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\tconst normalizedPreloadPath = normalizeLoaderPath(href);\n\tif (!(normalizedPreloadPath in preloadedLoaderData) && !(href in preloadedLoaderData)) await preloadRoute(href, true);\n\telse if (process.env.NODE_ENV !== \"development\") {\n\t\tconst inject = cssInjectFunctions[href];\n\t\tif (inject) inject().catch(() => {});\n\t}\n\tconst preloadResult = preloadedLoaderData[normalizedPreloadPath];\n\tif (preloadResult?.__oneRedirect) {\n\t\tconst 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?.__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\tconst notFoundRoute = findNearestNotFoundRoute(href, routeNode);\n\t\tsetNotFoundState({\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\tconst matchingRouteNode = findRouteNodeFromState(state, routeNode);\n\tif (matchingRouteNode?.loadRoute) {\n\t\tsetValidationState({\n\t\t\tstatus: \"validating\",\n\t\t\tlastValidatedHref: href\n\t\t});\n\t\ttry {\n\t\t\tconst loadedRoute = matchingRouteNode.loadRoute();\n\t\t\tconst params2 = extractParamsFromState(state);\n\t\t\tconst search = extractSearchFromHref(href);\n\t\t\tconst pathname = extractPathnameFromHref(href);\n\t\t\tif (loadedRoute.validateParams) validateParams(loadedRoute.validateParams, params2);\n\t\t\tif (loadedRoute.validateRoute) {\n\t\t\t\tconst validationResult = await loadedRoute.validateRoute({\n\t\t\t\t\tparams: params2,\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\tconst error = new 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,\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\tawait error.catch(() => {});\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 ParamValidationError || error instanceof 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\tconst loaderData = preloadedLoaderData[normalizeLoaderPath(href)];\n\tconst params = extractParamsFromState(state);\n\tconst newMatches = buildClientMatches(href, matchingRouteNode, params, loaderData);\n\tcurrentMatches = newMatches;\n\tsetClientMatches(newMatches);\n\tif (!navigationRef.isReady()) {\n\t\tsetLoadingState(\"loaded\");\n\t\treturn;\n\t}\n\tconst currentRootState = navigationRef.getRootState();\n\tconst hash = href.indexOf(\"#\");\n\tif (currentRootState?.key && hash > 0) hashes[currentRootState.key] = href.slice(hash);\n\tnextOptions = options ?? null;\n\tpendingNavigationPathname = stripTrailingSlash(extractPathnameFromHref(href));\n\tpendingNavigationAction = event === \"PUSH\" || event === \"REPLACE\" || event === \"NAVIGATE\" ? event : void 0;\n\tlastIntendedPathname = pendingNavigationPathname;\n\tconst freshRootState = navigationRef.getRootState();\n\tconst currentRouteBeforeDispatch = navigationRef.getCurrentRoute();\n\tconst targetPathname = pendingNavigationPathname;\n\tconst optimisticState = nextOptions ? {\n\t\t...state,\n\t\tlinkOptions: nextOptions\n\t} : state;\n\tconst action = event === \"REPLACE\" ? null : getNavigateAction(state, freshRootState, event);\n\tstartTransition(() => {\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\tconst targetName = action.payload?.name;\n\t\t\tconst isGroupTarget = typeof targetName === \"string\" && targetName.startsWith(\"(\") && targetName.endsWith(\")\");\n\t\t\tconst hasFreshRootState = freshRootState.type === \"stack\";\n\t\t\tconst isRootTarget = action.target === freshRootState.key;\n\t\t\tconst currentFocusedRoute = freshRootState.routes[freshRootState.index];\n\t\t\tconst currentFocusedName = currentFocusedRoute?.name;\n\t\t\tif (isRootTarget && isGroupTarget && hasFreshRootState) {\n\t\t\t\tconst targetRoute = state.routes[state.index ?? state.routes.length - 1];\n\t\t\t\tconst targetRootName = targetRoute.name;\n\t\t\t\tif (currentFocusedName === targetRootName) {\n\t\t\t\t\tconst 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: currentFocusedRoute?.key ?? 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\tconst existingTargetRoute = freshRootState.routes.find((route) => route.name === targetRootName);\n\t\t\t\t\tconst existingRoutes = freshRootState.routes.filter((route) => route.name !== targetRootName);\n\t\t\t\t\tconst 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: existingTargetRoute?.key ?? `${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\tlet warningTm;\n\tconst interval = setInterval(() => {\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(() => {\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(() => {\n\t\tconsole.warn(`Routing took more than 8 seconds`);\n\t}, 1e3);\n}\nconst hashes = {};\nlet 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 (let 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\tconst keysA = Object.keys(a);\n\t\tconst keysB = Object.keys(b);\n\t\tif (keysA.length !== keysB.length) return false;\n\t\tfor (const key of keysA) if (!deepEqual(a[key], b[key])) return false;\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nexport { canDismiss, canGoBack, cleanup, consumePendingNavigationAction, dismiss, dismissAll, getPreloadHistory, getSafeWindowPathname2 as getSafeWindowPathname, getSortedRoutes, getValidationState, goBack, handleNavigationContainerStateChange, hasAttemptedToHideSplash, initClientMatches, initialPathname, initialState, initialize, isRouteProtected, lastIntendedPathname, linkTo, navigate, navigationRef, preloadRoute, preloadedLoaderData, preloadingLoader, push, registerProtectedRoutes, replace, resolveProtectedHref, rootComponent, rootState, rootStateSnapshot, routeInfo, routeInfoSnapshot, routeNode, setLoadingState, setParams, setValidationState, snapshot, subscribeToLoadingState, subscribeToRootState, subscribeToStore, subscribeToValidationState, unregisterProtectedRoutes, updateState, useOneRouter, useStoreRootState, useStoreRouteInfo, useValidationState };"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAI,YAAY;AAChB,IAAI;AACJ,MAAM,yCAAyC,IAAI,IAAI;AACvD,SAAS,wBAAwB,YAAY,kBAAkB;CAC9D,IAAI,iBAAiB,SAAS,GAAG,uBAAuB,OAAO,UAAU;MACpE,uBAAuB,IAAI,YAAY,gBAAgB;AAC7D;AACA,SAAS,0BAA0B,YAAY;CAC9C,uBAAuB,OAAO,UAAU;AACzC;AACA,SAAS,qBAAqB,MAAM;CACnC,MAAM,iBAAiB,wBAAwB,IAAI,CAAC,CAAC,QAAQ,cAAc,EAAE;CAC7E,KAAK,MAAM,CAAC,YAAY,qBAAqB,wBAAwB;EACpE,MAAM,uBAAuB,WAAW,QAAQ,cAAc,EAAE;EAChE,IAAI,CAAC,wBAAwB,mBAAmB,wBAAwB,eAAe,WAAW,GAAG,qBAAqB,EAAE,GAAG;GAC9H,MAAM,YAAY,eAAe,MAA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C,KAAK,MAAM,OAAO,OAAO,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO;EAChE,OAAO;CACR;CACA,OAAO;AACR"}
@@ -3,9 +3,13 @@
3
3
  #import "One-Swift.h"
4
4
  #import <react/renderer/components/OneNativeSpec/ComponentDescriptors.h>
5
5
  #import <react/renderer/components/OneNativeSpec/EventEmitters.h>
6
+ #import <react/renderer/components/OneNativeSpec/RCTComponentViewHelpers.h>
6
7
 
7
8
  using namespace facebook::react;
8
9
 
10
+ @interface OneNativeCameraComponentView () <RCTOneNativeCameraViewProtocol>
11
+ @end
12
+
9
13
  @implementation OneNativeCameraComponentView {
10
14
  OneNativeCameraView *_nativeView;
11
15
  }
@@ -42,10 +46,31 @@ using namespace facebook::react;
42
46
  emitter->onNativeCameraCode({.type = std::string(type.UTF8String),
43
47
  .data = std::string(data.UTF8String)});
44
48
  };
49
+ _nativeView.onPicture = ^(NSInteger requestId, NSString *uri, NSInteger width,
50
+ NSInteger height, NSString *base64, NSString *error) {
51
+ OneNativeCameraComponentView *strongSelf = weakSelf;
52
+ if (!strongSelf || !strongSelf->_eventEmitter) return;
53
+ auto emitter = std::static_pointer_cast<const OneNativeCameraEventEmitter>(
54
+ strongSelf->_eventEmitter);
55
+ emitter->onNativeCameraPicture({.requestId = static_cast<int>(requestId),
56
+ .uri = std::string(uri.UTF8String),
57
+ .width = static_cast<int>(width),
58
+ .height = static_cast<int>(height),
59
+ .base64 = std::string(base64.UTF8String),
60
+ .error = std::string(error.UTF8String)});
61
+ };
45
62
  }
46
63
  return self;
47
64
  }
48
65
 
66
+ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args {
67
+ RCTOneNativeCameraHandleCommand(self, commandName, args);
68
+ }
69
+
70
+ - (void)takePicture:(NSInteger)requestId quality:(double)quality base64:(BOOL)base64 {
71
+ [_nativeView takePicture:requestId quality:quality base64:base64];
72
+ }
73
+
49
74
  - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps {
50
75
  const auto &next = *std::static_pointer_cast<const OneNativeCameraProps>(props);
51
76
  NSMutableArray<NSString *> *types = [NSMutableArray arrayWithCapacity:next.codeTypes.size()];
@@ -53,6 +78,9 @@ using namespace facebook::react;
53
78
  [_nativeView configure:next.active
54
79
  facing:RCTNSStringFromString(next.facing)
55
80
  codeTypes:types];
81
+ [_nativeView configureCapture:RCTNSStringFromString(next.flash)
82
+ torch:next.enableTorch
83
+ zoom:next.zoom];
56
84
  [super updateProps:props oldProps:oldProps];
57
85
  }
58
86
 
@@ -13,9 +13,28 @@ private final class CameraMetadataDelegate: NSObject, AVCaptureMetadataOutputObj
13
13
  }
14
14
  }
15
15
 
16
+ // one capture in flight; AVCapturePhotoOutput holds its delegate weakly.
17
+ private final class CameraPhotoDelegate: NSObject, AVCapturePhotoCaptureDelegate {
18
+ let finish: (AVCapturePhoto?, Error?) -> Void
19
+
20
+ init(finish: @escaping (AVCapturePhoto?, Error?) -> Void) {
21
+ self.finish = finish
22
+ }
23
+
24
+ func photoOutput(
25
+ _ output: AVCapturePhotoOutput,
26
+ didFinishProcessingPhoto photo: AVCapturePhoto,
27
+ error: Error?
28
+ ) {
29
+ finish(photo, error)
30
+ }
31
+ }
32
+
16
33
  @objcMembers public final class OneNativeCameraView: UIView {
17
34
  public var onStateChange: ((String) -> Void)?
18
35
  public var onCodeScanned: ((String, String) -> Void)?
36
+ // requestId, uri, width, height, base64, error ("" on success).
37
+ public var onPicture: ((Int, String, Int, Int, String, String) -> Void)?
19
38
 
20
39
  public override class var layerClass: AnyClass { AVCaptureVideoPreviewLayer.self }
21
40
 
@@ -32,6 +51,10 @@ private final class CameraMetadataDelegate: NSObject, AVCaptureMetadataOutputObj
32
51
  private let sessionQueue = DispatchQueue(label: "dev.one.camera.capture")
33
52
  private var session: AVCaptureSession?
34
53
  private var metadataOutput: AVCaptureMetadataOutput?
54
+ // owned by sessionQueue.
55
+ private var photoOutput: AVCapturePhotoOutput?
56
+ private var captureDevice: AVCaptureDevice?
57
+ private var photoDelegates: [Int: CameraPhotoDelegate] = [:]
35
58
  private let metadataDelegate = CameraMetadataDelegate()
36
59
  private var sessionObservers: [NSObjectProtocol] = []
37
60
  private var rotationCoordinator: AVCaptureDevice.RotationCoordinator?
@@ -41,6 +64,9 @@ private final class CameraMetadataDelegate: NSObject, AVCaptureMetadataOutputObj
41
64
  private var active = false
42
65
  private var facing = "back"
43
66
  private var codeTypes: [String] = []
67
+ private var flash = "off"
68
+ private var torch = false
69
+ private var zoom: Double = 0
44
70
  private var generation = 0
45
71
  private var lastState = ""
46
72
  private var activeObserver: NSObjectProtocol?
@@ -82,13 +108,132 @@ private final class CameraMetadataDelegate: NSObject, AVCaptureMetadataOutputObj
82
108
  refresh(reconfigure: true)
83
109
  }
84
110
 
111
+ // flash, torch and zoom change the running device without restarting the session.
112
+ public func configureCapture(_ flash: String, torch: Bool, zoom: Double) {
113
+ guard self.flash != flash || self.torch != torch || self.zoom != zoom else { return }
114
+ self.flash = flash
115
+ self.torch = torch
116
+ self.zoom = zoom
117
+ sessionQueue.async { self.applyDeviceSettings(torch: torch, zoom: zoom) }
118
+ }
119
+
85
120
  public func reset() {
86
121
  active = false
87
122
  facing = "back"
88
123
  codeTypes = []
124
+ flash = "off"
125
+ torch = false
126
+ zoom = 0
89
127
  refresh()
90
128
  }
91
129
 
130
+ private func applyDeviceSettings(torch: Bool, zoom: Double) {
131
+ guard let device = captureDevice, (try? device.lockForConfiguration()) != nil else { return }
132
+ defer { device.unlockForConfiguration() }
133
+ let torchMode: AVCaptureDevice.TorchMode = torch ? .on : .off
134
+ if device.hasTorch, device.isTorchModeSupported(torchMode) { device.torchMode = torchMode }
135
+ let low = device.minAvailableVideoZoomFactor
136
+ let high = device.maxAvailableVideoZoomFactor
137
+ device.videoZoomFactor = low + CGFloat(zoom) * (high - low)
138
+ }
139
+
140
+ public func takePicture(_ requestId: Int, quality: Double, base64: Bool) {
141
+ let fail = { [weak self] (code: String, message: String) in
142
+ self?.onPicture?(requestId, "", 0, 0, "", "\(code): \(message)")
143
+ }
144
+ guard sessionReady, let coordinator = rotationCoordinator else {
145
+ let state = lastState.isEmpty ? "waiting" : lastState
146
+ fail("E_CAMERA_NOT_READY", "CameraView is not ready to take a picture (state: \(state))")
147
+ return
148
+ }
149
+ let angle = coordinator.videoRotationAngleForHorizonLevelCapture
150
+ let flashName = flash
151
+ let current = generation
152
+ sessionQueue.async { [weak self] in
153
+ guard let self, let output = self.photoOutput,
154
+ output.availablePhotoCodecTypes.contains(.jpeg)
155
+ else {
156
+ DispatchQueue.main.async { fail("E_CAMERA_NOT_READY", "CameraView has no photo output") }
157
+ return
158
+ }
159
+ let settings = AVCapturePhotoSettings(format: [
160
+ AVVideoCodecKey: AVVideoCodecType.jpeg,
161
+ AVVideoCompressionPropertiesKey: [AVVideoQualityKey: quality],
162
+ ])
163
+ let flashMode: AVCaptureDevice.FlashMode =
164
+ flashName == "on" ? .on : flashName == "auto" ? .auto : .off
165
+ if output.supportedFlashModes.contains(flashMode) { settings.flashMode = flashMode }
166
+ if let connection = output.connection(with: .video),
167
+ connection.isVideoRotationAngleSupported(angle)
168
+ {
169
+ connection.videoRotationAngle = angle
170
+ }
171
+ let delegate = CameraPhotoDelegate { [weak self] photo, error in
172
+ guard let self else { return }
173
+ // photo callbacks arrive on the output's private queue.
174
+ self.sessionQueue.async { self.photoDelegates[requestId] = nil }
175
+ let result = Self.savePicture(photo: photo, error: error, base64: base64)
176
+ DispatchQueue.main.async {
177
+ guard self.generation == current else {
178
+ fail("E_CAMERA_INACTIVE", "CameraView stopped before the picture was taken")
179
+ return
180
+ }
181
+ switch result {
182
+ case .success(let picture):
183
+ self.onPicture?(requestId, picture.uri, picture.width, picture.height, picture.base64, "")
184
+ case .failure(let failure):
185
+ fail("E_CAMERA_CAPTURE", failure.message)
186
+ }
187
+ }
188
+ }
189
+ self.photoDelegates[requestId] = delegate
190
+ output.capturePhoto(with: settings, delegate: delegate)
191
+ }
192
+ }
193
+
194
+ private struct SavedPicture {
195
+ let uri: String
196
+ let width: Int
197
+ let height: Int
198
+ let base64: String
199
+ }
200
+
201
+ private struct CaptureFailure: Error {
202
+ let message: String
203
+ }
204
+
205
+ // writes the jpeg to caches/Camera and reports its displayed size: exif
206
+ // orientations 5 to 8 are rotated a quarter turn, so their sides swap.
207
+ private static func savePicture(
208
+ photo: AVCapturePhoto?, error: Error?, base64: Bool
209
+ ) -> Result<SavedPicture, CaptureFailure> {
210
+ if let error { return .failure(CaptureFailure(message: error.localizedDescription)) }
211
+ guard let data = photo?.fileDataRepresentation(),
212
+ let source = CGImageSourceCreateWithData(data as CFData, nil),
213
+ let properties = CGImageSourceCopyPropertiesAtIndex(source, 0, nil) as? [CFString: Any],
214
+ let pixelWidth = properties[kCGImagePropertyPixelWidth] as? Int,
215
+ let pixelHeight = properties[kCGImagePropertyPixelHeight] as? Int
216
+ else { return .failure(CaptureFailure(message: "The camera returned no image data")) }
217
+ let orientation = properties[kCGImagePropertyOrientation] as? Int ?? 1
218
+ let quarterTurn = (5...8).contains(orientation)
219
+ do {
220
+ let directory = try FileManager.default
221
+ .url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
222
+ .appendingPathComponent("Camera", isDirectory: true)
223
+ try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true)
224
+ let file = directory.appendingPathComponent("\(UUID().uuidString).jpg")
225
+ try data.write(to: file, options: .atomic)
226
+ return .success(SavedPicture(
227
+ uri: file.absoluteString,
228
+ width: quarterTurn ? pixelHeight : pixelWidth,
229
+ height: quarterTurn ? pixelWidth : pixelHeight,
230
+ base64: base64 ? data.base64EncodedString() : ""
231
+ ))
232
+ } catch {
233
+ return .failure(CaptureFailure(message: error.localizedDescription))
234
+ }
235
+ }
236
+
92
237
  private func emitState(_ state: String) {
93
238
  guard lastState != state else { return }
94
239
  lastState = state
@@ -115,6 +260,8 @@ private final class CameraMetadataDelegate: NSObject, AVCaptureMetadataOutputObj
115
260
  sessionQueue.async {
116
261
  self.session?.stopRunning()
117
262
  self.session = nil
263
+ self.photoOutput = nil
264
+ self.captureDevice = nil
118
265
  }
119
266
  emitState("inactive")
120
267
  return
@@ -125,6 +272,8 @@ private final class CameraMetadataDelegate: NSObject, AVCaptureMetadataOutputObj
125
272
  sessionQueue.async {
126
273
  self.session?.stopRunning()
127
274
  self.session = nil
275
+ self.photoOutput = nil
276
+ self.captureDevice = nil
128
277
  }
129
278
  emitState("permission-required")
130
279
  return
@@ -142,6 +291,8 @@ private final class CameraMetadataDelegate: NSObject, AVCaptureMetadataOutputObj
142
291
  guard let self else { return }
143
292
  self.session?.stopRunning()
144
293
  self.session = nil
294
+ self.photoOutput = nil
295
+ self.captureDevice = nil
145
296
  guard let device = AVCaptureDevice.default(
146
297
  .builtInWideAngleCamera, for: .video, position: position
147
298
  ) else {
@@ -178,7 +329,16 @@ private final class CameraMetadataDelegate: NSObject, AVCaptureMetadataOutputObj
178
329
  metadata.setMetadataObjectsDelegate(self.metadataDelegate, queue: self.sessionQueue)
179
330
  output = metadata
180
331
  }
332
+ let photo = AVCapturePhotoOutput()
333
+ guard next.canAddOutput(photo) else {
334
+ next.commitConfiguration()
335
+ self.emitState("failed", generation: current)
336
+ return
337
+ }
338
+ next.addOutput(photo)
181
339
  next.commitConfiguration()
340
+ self.photoOutput = photo
341
+ self.captureDevice = device
182
342
 
183
343
  var readyState = "ready"
184
344
  if let output {
@@ -211,8 +371,11 @@ private final class CameraMetadataDelegate: NSObject, AVCaptureMetadataOutputObj
211
371
  }
212
372
  self.observeSession(next)
213
373
  let queue = self.sessionQueue
374
+ let torch = self.torch
375
+ let zoom = self.zoom
214
376
  queue.async { [weak self] in
215
377
  next.startRunning()
378
+ self?.applyDeviceSettings(torch: torch, zoom: zoom)
216
379
  let running = next.isRunning
217
380
  DispatchQueue.main.async { [weak self] in
218
381
  guard let self, self.generation == current else { return }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "one",
3
- "version": "2.6.21",
3
+ "version": "2.6.22",
4
4
  "description": "One is a React framework for web, iOS, and Android apps.",
5
5
  "license": "BSD-3-Clause",
6
6
  "sideEffects": [
@@ -236,18 +236,18 @@
236
236
  "@react-navigation/native-stack": "8.0.0-alpha.58",
237
237
  "@react-navigation/routers": "8.0.0-alpha.20",
238
238
  "@ungap/structured-clone": "^1.2.0",
239
- "@vxrn/color-scheme": "2.6.21",
240
- "@vxrn/compiler": "2.6.21",
241
- "@vxrn/resolve": "2.6.21",
242
- "@vxrn/tslib-lite": "2.6.21",
243
- "@vxrn/use-isomorphic-layout-effect": "2.6.21",
244
- "@vxrn/utils": "2.6.21",
245
- "@vxrn/vite-plugin-metro": "2.6.21",
239
+ "@vxrn/color-scheme": "2.6.22",
240
+ "@vxrn/compiler": "2.6.22",
241
+ "@vxrn/resolve": "2.6.22",
242
+ "@vxrn/tslib-lite": "2.6.22",
243
+ "@vxrn/use-isomorphic-layout-effect": "2.6.22",
244
+ "@vxrn/utils": "2.6.22",
245
+ "@vxrn/vite-plugin-metro": "2.6.22",
246
246
  "babel-dead-code-elimination": "1.0.10",
247
247
  "babel-plugin-module-resolver": "^5.0.2",
248
248
  "citty": "^0.1.6",
249
249
  "core-js": "^3.38.1",
250
- "create-vxrn": "2.6.21",
250
+ "create-vxrn": "2.6.22",
251
251
  "escape-string-regexp": "^5.0.0",
252
252
  "fast-deep-equal": "^3.1.3",
253
253
  "fast-glob": "^3.3.3",
@@ -269,7 +269,7 @@
269
269
  "tsconfig-paths": "^4",
270
270
  "use-latest-callback": "^0.2.3",
271
271
  "vite": "^8.2.2",
272
- "vxrn": "2.6.21",
272
+ "vxrn": "2.6.22",
273
273
  "web-streams-polyfill": "^4.3.0",
274
274
  "ws": "^8.21.0",
275
275
  "xxhashjs": "^0.2.2"
@@ -337,7 +337,7 @@
337
337
  "@types/react-dom": "^19.2.2",
338
338
  "@types/react-test-renderer": "^19.1.0",
339
339
  "@types/xxhashjs": "^0.2.4",
340
- "@vxrn/emitter": "2.6.21",
340
+ "@vxrn/emitter": "2.6.22",
341
341
  "depcheck": "^1.4.7",
342
342
  "esbuild": "^0.25.12",
343
343
  "immer": "^10.1.1",
@@ -513,7 +513,7 @@
513
513
  }
514
514
  }
515
515
  },
516
- "releaseSourceCommit": "e08c1bc6bc698fb2ae68b3d47a52b39a764657ed",
516
+ "releaseSourceCommit": "04df94112b1398e221a0c7771f1d4357e6f70ef2",
517
517
  "repository": {
518
518
  "type": "git",
519
519
  "url": "git+https://github.com/onejs/one.git",
package/src/index.ts CHANGED
@@ -65,6 +65,9 @@ export type {
65
65
  ComposeSnackbarShowOptions,
66
66
  ComposeSnackbarResult,
67
67
  ComposeModalBottomSheetRef,
68
+ CameraCapturedPicture,
69
+ CameraPictureOptions,
70
+ CameraViewRef,
68
71
  } from './platform'
69
72
  export type { OneRouter } from './interfaces/router'
70
73