{
  "version": 3,
  "sources": ["../../../src/utils/transactions/getExplorerLink.ts"],
  "sourcesContent": ["let errorMessageDisplayed = false;\n\nfunction logError(error: string) {\n  if (!errorMessageDisplayed) {\n    console.error(error);\n    errorMessageDisplayed = true;\n  }\n}\n\nexport function getExplorerLink({\n  explorerAddress,\n  to\n}: {\n  explorerAddress: string;\n  to: string;\n}) {\n  try {\n    // if a valid url is sent, return the original url\n    const url = new URL(to);\n    return url.href;\n  } catch {\n    if (to && !to.startsWith('/')) {\n      logError(`Link not prepended by / : ${to}`);\n      to = `/${to}`;\n    }\n    return explorerAddress ? `${explorerAddress}${to}` : to;\n  }\n}\n"],
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAII,EAAwB,GAE5B,SAASC,EAASC,EAAe,CAC1BF,IACH,QAAQ,MAAME,CAAK,EACnBF,EAAwB,GAE5B,CAEO,SAASF,EAAgB,CAC9B,gBAAAK,EACA,GAAAC,CACF,EAGG,CACD,GAAI,CAGF,OADY,IAAI,IAAIA,CAAE,EACX,IACb,MAAQ,CACN,OAAIA,GAAM,CAACA,EAAG,WAAW,GAAG,IAC1BH,EAAS,6BAA6BG,CAAE,EAAE,EAC1CA,EAAK,IAAIA,CAAE,IAEND,EAAkB,GAAGA,CAAe,GAAGC,CAAE,GAAKA,CACvD,CACF",
  "names": ["getExplorerLink_exports", "__export", "getExplorerLink", "__toCommonJS", "errorMessageDisplayed", "logError", "error", "explorerAddress", "to"]
}
