{"ast":null,"code":"import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nvar _excluded = [\"ErrorBoundary\"],\n  _excluded2 = [\"route\", \"navigation\"],\n  _excluded3 = [\"options\"];\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nimport React from \"react\";\nimport { Route, sortRoutesWithInitial, useRouteNode } from \"./Route\";\nimport EXPO_ROUTER_IMPORT_MODE from \"./import-mode\";\nimport { Screen } from \"./primitives\";\nimport { EmptyRoute } from \"./views/EmptyRoute\";\nimport { SuspenseFallback } from \"./views/SuspenseFallback\";\nimport { Try } from \"./views/Try\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createElement as _createElement } from \"react\";\nfunction getSortedChildren(children, order, initialRouteName) {\n  if (!(order != null && order.length)) {\n    return children.sort(sortRoutesWithInitial(initialRouteName)).map(function (route) {\n      return {\n        route: route,\n        props: {}\n      };\n    });\n  }\n  var entries = _toConsumableArray(children);\n  var ordered = order.map(function (_ref) {\n    var name = _ref.name,\n      redirect = _ref.redirect,\n      initialParams = _ref.initialParams,\n      listeners = _ref.listeners,\n      options = _ref.options,\n      getId = _ref.getId;\n    if (!entries.length) {\n      console.warn(`[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`);\n      return null;\n    }\n    var matchIndex = entries.findIndex(function (child) {\n      return child.route === name;\n    });\n    if (matchIndex === -1) {\n      console.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(function (_ref2) {\n        var route = _ref2.route;\n        return route;\n      }));\n      return null;\n    } else {\n      var match = entries[matchIndex];\n      entries.splice(matchIndex, 1);\n      if (redirect) {\n        if (typeof redirect === \"string\") {\n          throw new Error(`Redirecting to a specific route is not supported yet.`);\n        }\n        return null;\n      }\n      return {\n        route: match,\n        props: {\n          initialParams: initialParams,\n          listeners: listeners,\n          options: options,\n          getId: getId\n        }\n      };\n    }\n  }).filter(Boolean);\n  ordered.push.apply(ordered, _toConsumableArray(entries.sort(sortRoutesWithInitial(initialRouteName)).map(function (route) {\n    return {\n      route: route,\n      props: {}\n    };\n  })));\n  return ordered;\n}\nexport function useSortedScreens(order) {\n  var _node$children;\n  var node = useRouteNode();\n  var sorted = node != null && (_node$children = node.children) != null && _node$children.length ? getSortedChildren(node.children, order, node.initialRouteName) : [];\n  return React.useMemo(function () {\n    return sorted.map(function (value) {\n      return routeToScreen(value.route, value.props);\n    });\n  }, [sorted]);\n}\nfunction fromImport(_ref3) {\n  var ErrorBoundary = _ref3.ErrorBoundary,\n    component = _objectWithoutProperties(_ref3, _excluded);\n  if (ErrorBoundary) {\n    return {\n      default: React.forwardRef(function (props, ref) {\n        var children = React.createElement(component.default || EmptyRoute, _objectSpread(_objectSpread({}, props), {}, {\n          ref: ref\n        }));\n        return _jsx(Try, {\n          catch: ErrorBoundary,\n          children: children\n        });\n      })\n    };\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    if (typeof component.default === \"object\" && component.default && Object.keys(component.default).length === 0) {\n      return {\n        default: EmptyRoute\n      };\n    }\n  }\n  return {\n    default: component.default || EmptyRoute\n  };\n}\nfunction fromLoadedRoute(res) {\n  if (!(res instanceof Promise)) {\n    return fromImport(res);\n  }\n  return res.then(fromImport);\n}\nvar qualifiedStore = new WeakMap();\nexport function getQualifiedRouteComponent(value) {\n  if (qualifiedStore.has(value)) {\n    return qualifiedStore.get(value);\n  }\n  var getLoadable;\n  if (EXPO_ROUTER_IMPORT_MODE === \"lazy\") {\n    var AsyncComponent = React.lazy(_asyncToGenerator(function* () {\n      var res = value.loadRoute();\n      return fromLoadedRoute(res);\n    }));\n    getLoadable = function getLoadable(props, ref) {\n      return _jsx(React.Suspense, {\n        fallback: _jsx(SuspenseFallback, {\n          route: value\n        }),\n        children: _jsx(AsyncComponent, _objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {\n          ref: ref,\n          segment: value.route\n        })))\n      });\n    };\n  } else {\n    var SyncComponent = React.forwardRef(function (props, ref) {\n      var res = value.loadRoute();\n      var Component = fromImport(res).default;\n      return _jsx(Component, _objectSpread(_objectSpread({}, props), {}, {\n        ref: ref\n      }));\n    });\n    getLoadable = function getLoadable(props, ref) {\n      return _jsx(SyncComponent, _objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {\n        ref: ref,\n        segment: value.route\n      })));\n    };\n  }\n  var QualifiedRoute = React.forwardRef(function (_ref5, ref) {\n    var route = _ref5.route,\n      navigation = _ref5.navigation,\n      props = _objectWithoutProperties(_ref5, _excluded2);\n    var loadable = getLoadable(props, ref);\n    return _jsx(Route, {\n      node: value,\n      children: loadable\n    });\n  });\n  QualifiedRoute.displayName = `Route(${value.route})`;\n  qualifiedStore.set(value, QualifiedRoute);\n  return QualifiedRoute;\n}\nexport function createGetIdForRoute(route) {\n  var _route$dynamic;\n  if (!((_route$dynamic = route.dynamic) != null && _route$dynamic.length)) {\n    return undefined;\n  }\n  return function (_ref6) {\n    var _route$dynamic2;\n    var params = _ref6.params;\n    var getPreferredId = function getPreferredId(segment) {\n      var preferredId = params == null ? void 0 : params[segment.name];\n      if (preferredId) {\n        if (!Array.isArray(preferredId)) {\n          return preferredId;\n        } else if (preferredId.length) {\n          return preferredId.join(\"/\");\n        }\n      }\n      return segment.deep ? `[...${segment.name}]` : `[${segment.name}]`;\n    };\n    return (_route$dynamic2 = route.dynamic) == null ? void 0 : _route$dynamic2.map(function (segment) {\n      return getPreferredId(segment);\n    }).join(\"/\");\n  };\n}\nfunction routeToScreen(route) {\n  var _ref7 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var _options = _ref7.options,\n    props = _objectWithoutProperties(_ref7, _excluded3);\n  return _createElement(Screen, _objectSpread(_objectSpread({\n    getId: createGetIdForRoute(route)\n  }, props), {}, {\n    name: route.route,\n    key: route.route,\n    options: function options(args) {\n      var _route$loadRoute;\n      var staticOptions = route.generated ? (_route$loadRoute = route.loadRoute()) == null ? void 0 : _route$loadRoute.getNavOptions : null;\n      var staticResult = typeof staticOptions === \"function\" ? staticOptions(args) : staticOptions;\n      var dynamicResult = typeof _options === \"function\" ? _options == null ? void 0 : _options(args) : _options;\n      var output = _objectSpread(_objectSpread({}, staticResult), dynamicResult);\n      if (route.generated) {\n        output.tabBarButton = function () {\n          return null;\n        };\n        output.drawerItemStyle = {\n          height: 0,\n          display: \"none\"\n        };\n      }\n      return output;\n    },\n    getComponent: function getComponent() {\n      return getQualifiedRouteComponent(route);\n    }\n  }));\n}","map":{"version":3,"names":["React","Route","sortRoutesWithInitial","useRouteNode","EXPO_ROUTER_IMPORT_MODE","Screen","EmptyRoute","SuspenseFallback","Try","jsx","_jsx","createElement","_createElement","getSortedChildren","children","order","initialRouteName","length","sort","map","route","props","entries","_toConsumableArray","ordered","_ref","name","redirect","initialParams","listeners","options","getId","console","warn","matchIndex","findIndex","child","_ref2","match","splice","Error","filter","Boolean","push","apply","useSortedScreens","_node$children","node","sorted","useMemo","value","routeToScreen","fromImport","_ref3","ErrorBoundary","component","_objectWithoutProperties","_excluded","default","forwardRef","ref","_objectSpread","catch","process","env","NODE_ENV","Object","keys","fromLoadedRoute","res","Promise","then","qualifiedStore","WeakMap","getQualifiedRouteComponent","has","get","getLoadable","AsyncComponent","lazy","_asyncToGenerator","loadRoute","Suspense","fallback","segment","SyncComponent","Component","QualifiedRoute","_ref5","navigation","_excluded2","loadable","displayName","set","createGetIdForRoute","_route$dynamic","dynamic","undefined","_ref6","_route$dynamic2","params","getPreferredId","preferredId","Array","isArray","join","deep","_ref7","arguments","_excluded3","key","args","_route$loadRoute","staticOptions","generated","getNavOptions","staticResult","dynamicResult","output","tabBarButton","drawerItemStyle","height","display","getComponent"],"sources":["/Users/Daniel.Antelo/Workspaces/expo-template-reactrouter-nativebase/node_modules/expo-router/src/useScreens.tsx"],"sourcesContent":["import React from \"react\";\n\nimport {\n  DynamicConvention,\n  LoadedRoute,\n  Route,\n  RouteNode,\n  sortRoutesWithInitial,\n  useRouteNode,\n} from \"./Route\";\nimport EXPO_ROUTER_IMPORT_MODE from \"./import-mode\";\nimport { Screen } from \"./primitives\";\nimport { EmptyRoute } from \"./views/EmptyRoute\";\nimport { SuspenseFallback } from \"./views/SuspenseFallback\";\nimport { Try } from \"./views/Try\";\n\nexport type ScreenProps<\n  TOptions extends Record<string, any> = Record<string, any>\n> = {\n  /** Name is required when used inside a Layout component. */\n  name?: string;\n  /**\n   * Redirect to the nearest sibling route.\n   * If all children are redirect={true}, the layout will render `null` as there are no children to render.\n   */\n  redirect?: boolean;\n  initialParams?: { [key: string]: any };\n  options?: TOptions;\n\n  // TODO: types\n  listeners?: any;\n\n  getId?: ({\n    params,\n  }: {\n    params?: Record<string, any> | undefined;\n  }) => string | undefined;\n};\n\nfunction getSortedChildren(\n  children: RouteNode[],\n  order?: ScreenProps[],\n  initialRouteName?: string\n): { route: RouteNode; props: Partial<ScreenProps> }[] {\n  if (!order?.length) {\n    return children\n      .sort(sortRoutesWithInitial(initialRouteName))\n      .map((route) => ({ route, props: {} }));\n  }\n  const entries = [...children];\n\n  const ordered = order\n    .map(({ name, redirect, initialParams, listeners, options, getId }) => {\n      if (!entries.length) {\n        console.warn(\n          `[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`\n        );\n        return null;\n      }\n      const matchIndex = entries.findIndex((child) => child.route === name);\n      if (matchIndex === -1) {\n        console.warn(\n          `[Layout children]: No route named \"${name}\" exists in nested children:`,\n          children.map(({ route }) => route)\n        );\n        return null;\n      } else {\n        // Get match and remove from entries\n        const match = entries[matchIndex];\n        entries.splice(matchIndex, 1);\n\n        // Ensure to return null after removing from entries.\n        if (redirect) {\n          if (typeof redirect === \"string\") {\n            throw new Error(\n              `Redirecting to a specific route is not supported yet.`\n            );\n          }\n          return null;\n        }\n\n        return {\n          route: match,\n          props: { initialParams, listeners, options, getId },\n        };\n      }\n    })\n    .filter(Boolean) as {\n    route: RouteNode;\n    props: Partial<ScreenProps>;\n  }[];\n\n  // Add any remaining children\n  ordered.push(\n    ...entries\n      .sort(sortRoutesWithInitial(initialRouteName))\n      .map((route) => ({ route, props: {} }))\n  );\n\n  return ordered;\n}\n\n/**\n * @returns React Navigation screens sorted by the `route` property.\n */\nexport function useSortedScreens(order: ScreenProps[]): React.ReactNode[] {\n  const node = useRouteNode();\n\n  const sorted = node?.children?.length\n    ? getSortedChildren(node.children, order, node.initialRouteName)\n    : [];\n  return React.useMemo(\n    () => sorted.map((value) => routeToScreen(value.route, value.props)),\n    [sorted]\n  );\n}\n\nfunction fromImport({ ErrorBoundary, ...component }: LoadedRoute) {\n  if (ErrorBoundary) {\n    return {\n      default: React.forwardRef((props: any, ref: any) => {\n        const children = React.createElement(component.default || EmptyRoute, {\n          ...props,\n          ref,\n        });\n        return <Try catch={ErrorBoundary}>{children}</Try>;\n      }),\n    };\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    if (\n      typeof component.default === \"object\" &&\n      component.default &&\n      Object.keys(component.default).length === 0\n    ) {\n      return { default: EmptyRoute };\n    }\n  }\n  return { default: component.default || EmptyRoute };\n}\n\nfunction fromLoadedRoute(res: LoadedRoute) {\n  if (!(res instanceof Promise)) {\n    return fromImport(res);\n  }\n\n  return res.then(fromImport);\n}\n\n// TODO: Maybe there's a more React-y way to do this?\n// Without this store, the process enters a recursive loop.\nconst qualifiedStore = new WeakMap<RouteNode, React.ComponentType<any>>();\n\n/** Wrap the component with various enhancements and add access to child routes. */\nexport function getQualifiedRouteComponent(value: RouteNode) {\n  if (qualifiedStore.has(value)) {\n    return qualifiedStore.get(value)!;\n  }\n\n  let getLoadable: (props: any, ref: any) => JSX.Element;\n\n  // TODO: This ensures sync doesn't use React.lazy, but it's not ideal.\n  if (EXPO_ROUTER_IMPORT_MODE === \"lazy\") {\n    const AsyncComponent = React.lazy(async () => {\n      const res = value.loadRoute();\n      return fromLoadedRoute(res) as Promise<{\n        default: React.ComponentType<any>;\n      }>;\n    });\n    getLoadable = (props: any, ref: any) => (\n      <React.Suspense fallback={<SuspenseFallback route={value} />}>\n        <AsyncComponent\n          {...{\n            ...props,\n            ref,\n            // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`\n            // the intention is to make it possible to deduce shared routes.\n            segment: value.route,\n          }}\n        />\n      </React.Suspense>\n    );\n  } else {\n    const SyncComponent = React.forwardRef((props, ref) => {\n      const res = value.loadRoute();\n      const Component = fromImport(res).default;\n      return <Component {...props} ref={ref} />;\n    });\n\n    getLoadable = (props: any, ref: any) => (\n      <SyncComponent\n        {...{\n          ...props,\n          ref,\n          // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`\n          // the intention is to make it possible to deduce shared routes.\n          segment: value.route,\n        }}\n      />\n    );\n  }\n\n  const QualifiedRoute = React.forwardRef(\n    (\n      {\n        // Remove these React Navigation props to\n        // enforce usage of expo-router hooks (where the query params are correct).\n        route,\n        navigation,\n\n        // Pass all other props to the component\n        ...props\n      }: any,\n      ref: any\n    ) => {\n      const loadable = getLoadable(props, ref);\n\n      return <Route node={value}>{loadable}</Route>;\n    }\n  );\n\n  QualifiedRoute.displayName = `Route(${value.route})`;\n\n  qualifiedStore.set(value, QualifiedRoute);\n  return QualifiedRoute;\n}\n\n/** @returns a function which provides a screen id that matches the dynamic route name in params. */\nexport function createGetIdForRoute(\n  route: Pick<RouteNode, \"dynamic\" | \"route\">\n) {\n  if (!route.dynamic?.length) {\n    return undefined;\n  }\n  return ({ params }: { params?: Record<string, any> }) => {\n    const getPreferredId = (segment: DynamicConvention) => {\n      // Params can be undefined when there are no params in the route.\n      const preferredId = params?.[segment.name];\n      // If the route has a dynamic segment, use the matching parameter\n      // as the screen id. This enables pushing a screen like `/[user]` multiple times\n      // when the user is different.\n      if (preferredId) {\n        if (!Array.isArray(preferredId)) {\n          return preferredId;\n        } else if (preferredId.length) {\n          // Deep dynamic routes will return as an array, so we'll join them to create a\n          // fully qualified string.\n          return preferredId.join(\"/\");\n        }\n        // Empty arrays...\n      }\n      return segment.deep ? `[...${segment.name}]` : `[${segment.name}]`;\n    };\n    return route.dynamic?.map((segment) => getPreferredId(segment)).join(\"/\");\n  };\n}\n\nfunction routeToScreen(\n  route: RouteNode,\n  { options, ...props }: Partial<ScreenProps> = {}\n) {\n  return (\n    <Screen\n      // Users can override the screen getId function.\n      getId={createGetIdForRoute(route)}\n      {...props}\n      name={route.route}\n      key={route.route}\n      options={(args) => {\n        // Only eager load generated components\n        const staticOptions = route.generated\n          ? route.loadRoute()?.getNavOptions\n          : null;\n        const staticResult =\n          typeof staticOptions === \"function\"\n            ? staticOptions(args)\n            : staticOptions;\n        const dynamicResult =\n          typeof options === \"function\" ? options?.(args) : options;\n        const output = {\n          ...staticResult,\n          ...dynamicResult,\n        };\n\n        // Prevent generated screens from showing up in the tab bar.\n        if (route.generated) {\n          output.tabBarButton = () => null;\n          // TODO: React Navigation doesn't provide a way to prevent rendering the drawer item.\n          output.drawerItemStyle = { height: 0, display: \"none\" };\n        }\n\n        return output;\n      }}\n      getComponent={() => getQualifiedRouteComponent(route)}\n    />\n  );\n}\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAGEC,KAAK,EAELC,qBAAqB,EACrBC,YAAY;AAEd,OAAOC,uBAAuB;AAC9B,SAASC,MAAM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