import ./offline_data

when hasEmbeddedTranslationData("mev"):
  import ./embedded_bible

  const mevRows = embeddedTranslationData("mev")

proc fetchPassages*(reference: string): seq[string] =
  when hasEmbeddedTranslationData("mev"):
    embedded_bible.fetchPassages(mevRows, reference, "MEV")
  else:
    raise newException(ValueError,
      "MEV data is not embedded; generate data/private/mev.tsv and rebuild")

proc fetchPlainPassages*(reference: string, keepVerseNumbers = true): seq[string] =
  when hasEmbeddedTranslationData("mev"):
    embedded_bible.fetchPlainPassages(mevRows, reference, "MEV", keepVerseNumbers)
  else:
    raise newException(ValueError,
      "MEV data is not embedded; generate data/private/mev.tsv and rebuild")

proc fetchMarkdownPassages*(reference: string): seq[string] =
  when hasEmbeddedTranslationData("mev"):
    embedded_bible.fetchMarkdownPassages(mevRows, reference, "MEV")
  else:
    raise newException(ValueError,
      "MEV data is not embedded; generate data/private/mev.tsv and rebuild")
