;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a871b7d5-c60f-4249-a369-eb845f389559", e._sentryDebugIdIdentifier = "sentry-dbid-a871b7d5-c60f-4249-a369-eb845f389559");
  } catch (e) {
  }
}
;
const normalizedDatasets = {};
const datasets = {};
const createDatasetKey = (identifier, locale) => `${identifier}_${locale}`.toLowerCase();
const getNormalizeDataset = (datasetKey) => {
  if (!normalizedDatasets[datasetKey]) {
    normalizedDatasets[datasetKey] = {};
    datasets[datasetKey].forEach(({ id, name }) => {
      normalizedDatasets[datasetKey][id] = name;
    });
  }
  return normalizedDatasets[datasetKey];
};
const getDataName = (datasetKey, key) => {
  if (datasets[datasetKey]) {
    const normalizedDataset = getNormalizeDataset(datasetKey);
    return normalizedDataset[key];
  }
  return null;
};
const datasetIdentifier = {
  country: "countries",
  state: (countryCode) => `states/${countryCode}`
};
function datasetUtilities(locale) {
  return {
    getCountryName: (countryCode) => {
      if (!countryCode) return null;
      const datasetKey = createDatasetKey(datasetIdentifier.country, locale);
      return getDataName(datasetKey, countryCode);
    },
    getStateName: (stateCode, countryCode) => {
      const datasetKey = createDatasetKey(datasetIdentifier.state(countryCode), locale);
      return getDataName(datasetKey, stateCode);
    },
    setDataset: (identifier, dataset) => {
      const datasetKey = createDatasetKey(identifier, locale);
      datasets[datasetKey] = dataset;
    },
    getDataset: (identifier) => {
      const datasetKey = createDatasetKey(identifier, locale);
      return datasets[datasetKey];
    },
    getDatasetKey: (identifier) => createDatasetKey(identifier, locale)
  };
}
export {
  datasetUtilities as a,
  datasetIdentifier as d
};
