{"ast":null,"code":"export function getFilename(url) {\n  const {\n    pathname,\n    searchParams\n  } = new URL(url, 'https://e');\n  if (__DEV__) {\n    if (searchParams.has('unstable_path')) {\n      const encodedFilePath = decodeURIComponent(searchParams.get('unstable_path'));\n      return getBasename(encodedFilePath);\n    }\n  }\n  return getBasename(pathname);\n}\nfunction getBasename(pathname) {\n  return pathname.substring(pathname.lastIndexOf('/') + 1);\n}\nexport function getFileExtension(url) {\n  const filename = getFilename(url);\n  const dotIndex = filename.lastIndexOf('.');\n  return dotIndex > 0 ? filename.substring(dotIndex) : '';\n}\nexport function getManifestBaseUrl(manifestUrl) {\n  const urlObject = new URL(manifestUrl);\n  let nextProtocol = urlObject.protocol;\n  if (nextProtocol === 'exp:') {\n    nextProtocol = 'http:';\n  } else if (nextProtocol === 'exps:') {\n    nextProtocol = 'https:';\n  }\n  urlObject.protocol = nextProtocol;\n  const directory = urlObject.pathname.substring(0, urlObject.pathname.lastIndexOf('/') + 1);\n  urlObject.pathname = directory;\n  urlObject.search = '';\n  urlObject.hash = '';\n  return urlObject.protocol !== nextProtocol ? urlObject.href.replace(urlObject.protocol, nextProtocol) : urlObject.href;\n}","map":{"version":3,"names":["getFilename","url","pathname","searchParams","URL","__DEV__","has","encodedFilePath","decodeURIComponent","get","getBasename","substring","lastIndexOf","getFileExtension","filename","dotIndex","getManifestBaseUrl","manifestUrl","urlObject","nextProtocol","protocol","directory","search","hash","href","replace"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/expo-asset/src/AssetUris.ts"],"sourcesContent":["export function getFilename(url: string): string {\n  const { pathname, searchParams } = new URL(url, 'https://e');\n\n  // When attached to a dev server, we use `unstable_path` to represent the file path. This ensures\n  // the file name is not canonicalized by the browser.\n  // NOTE(EvanBacon): This is technically not tied to `__DEV__` as it's possible to use this while bundling in production\n  // mode.\n  if (__DEV__) {\n    if (searchParams.has('unstable_path')) {\n      const encodedFilePath = decodeURIComponent(searchParams.get('unstable_path')!);\n      return getBasename(encodedFilePath);\n    }\n  }\n\n  return getBasename(pathname);\n}\n\nfunction getBasename(pathname: string): string {\n  return pathname.substring(pathname.lastIndexOf('/') + 1);\n}\n\nexport function getFileExtension(url: string): string {\n  const filename = getFilename(url);\n  const dotIndex = filename.lastIndexOf('.');\n  // Ignore leading dots for hidden files\n  return dotIndex > 0 ? filename.substring(dotIndex) : '';\n}\n\n/**\n * Returns the base URL from a manifest's URL. For example, given a manifest hosted at\n * https://example.com/app/manifest.json, the base URL would be https://example.com/app/. Query\n * parameters and fragments also are removed.\n *\n * For an Expo-hosted project with a manifest hosted at https://exp.host/@user/project/index.exp, the\n * base URL would be https://exp.host/@user/project.\n *\n * We also normalize the \"exp\" protocol to \"http\" to handle internal URLs with the Expo schemes used\n * to tell the OS to open the URLs in the the Expo client.\n */\nexport function getManifestBaseUrl(manifestUrl: string): string {\n  const urlObject = new URL(manifestUrl);\n\n  let nextProtocol = urlObject.protocol;\n  // Change the scheme to http(s) if it is exp(s)\n  if (nextProtocol === 'exp:') {\n    nextProtocol = 'http:';\n  } else if (nextProtocol === 'exps:') {\n    nextProtocol = 'https:';\n  }\n  urlObject.protocol = nextProtocol;\n\n  // Trim filename, query parameters, and fragment, if any\n  const directory = urlObject.pathname.substring(0, urlObject.pathname.lastIndexOf('/') + 1);\n  urlObject.pathname = directory;\n  urlObject.search = '';\n  urlObject.hash = '';\n\n  // The URL spec doesn't allow for changing the protocol to `http` or `https`\n  // without a port set so instead, we'll just swap the protocol manually.\n  return urlObject.protocol !== nextProtocol\n    ? urlObject.href.replace(urlObject.protocol, nextProtocol)\n    : urlObject.href;\n}\n"],"mappings":"AAAA,OAAM,SAAUA,WAAWA,CAACC,GAAW;EACrC,MAAM;IAAEC,QAAQ;IAAEC;EAAY,CAAE,GAAG,IAAIC,GAAG,CAACH,GAAG,EAAE,WAAW,CAAC;EAM5D,IAAII,OAAO,EAAE;IACX,IAAIF,YAAY,CAACG,GAAG,CAAC,eAAe,CAAC,EAAE;MACrC,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