{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\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 { getActionFromState } from \"@react-navigation/native\";\nimport { getReactNavigationConfig } from \"./getReactNavigationConfig\";\nimport { addEventListener, getInitialURL, getPathFromState as _getPathFromState, getStateFromPath } from \"./link/linking\";\nexport function getNavigationConfig(routes) {\n  return getReactNavigationConfig(routes, true);\n}\nexport function getLinkingConfig(routes) {\n  return {\n    prefixes: [],\n    config: getNavigationConfig(routes),\n    getInitialURL: getInitialURL,\n    subscribe: addEventListener,\n    getStateFromPath: getStateFromPathMemoized,\n    getPathFromState: function getPathFromState(state, options) {\n      var _getPathFromState2;\n      return (_getPathFromState2 = _getPathFromState(state, _objectSpread(_objectSpread({\n        screens: []\n      }, this.config), options))) != null ? _getPathFromState2 : \"/\";\n    },\n    getActionFromState: getActionFromState\n  };\n}\nexport var stateCache = new Map();\nfunction getStateFromPathMemoized(path, options) {\n  var cached = stateCache.get(path);\n  if (cached) {\n    return cached;\n  }\n  var result = getStateFromPath(path, options);\n  stateCache.set(path, result);\n  return result;\n}","map":{"version":3,"names":["getActionFromState","getReactNavigationConfig","addEventListener","getInitialURL","getPathFromState","getStateFromPath","getNavigationConfig","routes","getLinkingConfig","prefixes","config","subscribe","getStateFromPathMemoized","state","options","_getPathFromState2","_objectSpread","screens","stateCache","Map","path","cached","get","result","set"],"sources":["/Users/Daniel.Antelo/Workspaces/expo-template-reactrouter-nativebase/node_modules/expo-router/src/getLinkingConfig.ts"],"sourcesContent":["import { getActionFromState, LinkingOptions } from \"@react-navigation/native\";\n\nimport { RouteNode } from \"./Route\";\nimport { State } from \"./fork/getPathFromState\";\nimport { getReactNavigationConfig, Screen } from \"./getReactNavigationConfig\";\nimport {\n  addEventListener,\n  getInitialURL,\n  getPathFromState,\n  getStateFromPath,\n} from \"./link/linking\";\n\nexport function getNavigationConfig(routes: RouteNode): {\n  initialRouteName?: string;\n  screens: Record<string, Screen>;\n} {\n  return getReactNavigationConfig(routes, true);\n}\n\nexport type ExpoLinkingOptions = LinkingOptions<object> & {\n  getPathFromState?: typeof getPathFromState;\n};\n\nexport function getLinkingConfig(routes: RouteNode): ExpoLinkingOptions {\n  return {\n    prefixes: [],\n    // @ts-expect-error\n    config: getNavigationConfig(routes),\n    // A custom getInitialURL is used on native to ensure the app always starts at\n    // the root path if it's launched from something other than a deep link.\n    // This helps keep the native functionality working like the web functionality.\n    // For example, if you had a root navigator where the first screen was `/settings` and the second was `/index`\n    // then `/index` would be used on web and `/settings` would be used on native.\n    getInitialURL,\n    subscribe: addEventListener,\n    getStateFromPath: getStateFromPathMemoized,\n    getPathFromState(\n      state: State,\n      options: Parameters<typeof getPathFromState>[1]\n    ) {\n      return (\n        getPathFromState(state, {\n          screens: [],\n          ...this.config,\n          ...options,\n        }) ?? \"/\"\n      );\n    },\n    // Add all functions to ensure the types never need to fallback.\n    // This is a convenience for usage in the package.\n    getActionFromState,\n  };\n}\n\nexport const stateCache = new Map<string, any>();\n\n/** We can reduce work by memoizing the state by the pathname. This only works because the options (linking config) theoretically never change.  */\nfunction getStateFromPathMemoized(\n  path: string,\n  options: Parameters<typeof getStateFromPath>[1]\n) {\n  const cached = stateCache.get(path);\n  if (cached) {\n    return cached;\n  }\n  const result = getStateFromPath(path, options);\n  stateCache.set(path, result);\n  return result;\n}\n"],"mappings":";;;AAAA,SAASA,kBAAkB,QAAwB,0BAA0B;AAI7E,SAASC,wBAAwB;AACjC,SACEC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,IAAhBA,iBAAgB,EAChBC,gBAAgB;AAGlB,OAAO,SAASC,mBAAmBA,CAACC,MAAiB,EAGnD;EACA,OAAON,wBAAwB,CAACM,MAAM,EAAE,IAAI,CAAC;AAC/C;AAMA,OAAO,SAASC,gBAAgBA,CAACD,MAAiB,EAAsB;EACtE,OAAO;IACLE,QAAQ,EAAE,EAAE;IAEZC,MAAM,EAAEJ,mBAAmB,CAACC,MAAM,CAAC;IAMnCJ,aAAa,EAAbA,aAAa;IACbQ,SAAS,EAAET,gBAAgB;IAC3BG,gBAAgB,EAAEO,wBAAwB;IAC1CR,gBAAgB,WAAAA,iBACdS,KAAY,EACZC,OAA+C,EAC/C;MAAA,IAAAC,kBAAA;MACA,QAAAA,kBAAA,GACEX,iBAAgB,CAACS,KAAK,EAAAG,aAAA,CAAAA,aAAA;QACpBC,OAAO,EAAE;MAAE,GACR,IAAI,CAACP,MAAM,GACXI,OAAO,CACX,CAAC,YAAAC,kBAAA,GAAI,GAAG;IAEb,CAAC;IAGDf,kBAAkB,EAAlBA;EACF,CAAC;AACH;AAEA,OAAO,IAAMkB,UAAU,GAAG,IAAIC,GAAG,CAAc,CAAC;AAGhD,SAASP,wBAAwBA,CAC/BQ,IAAY,EACZN,OAA+C,EAC/C;EACA,IAAMO,MAAM,GAAGH,UAAU,CAACI,GAAG,CAACF,IAAI,CAAC;EACnC,IAAIC,MAAM,EAAE;IACV,OAAOA,MAAM;EACf;EACA,IAAME,MAAM,GAAGlB,gBAAgB,CAACe,IAAI,EAAEN,OAAO,CAAC;EAC9CI,UAAU,CAACM,GAAG,CAACJ,IAAI,EAAEG,MAAM,CAAC;EAC5B,OAAOA,MAAM;AACf"},"metadata":{},"sourceType":"module"}