// Generated by CoffeeScript 1.12.7
var LocationUtils;

LocationUtils = (function() {
  function LocationUtils() {}

  LocationUtils.getSaveData = function(data) {
    var fullText, mapPosition, position, saveData;
    mapPosition = data != null ? data.mapPosition : void 0;
    position = mapPosition != null ? mapPosition.position : void 0;
    if (!position || !CUI.Map.isValidPosition(position)) {
      return null;
    }
    saveData = {
      mapPosition: mapPosition
    };
    if (!CUI.util.isEmpty(data.displayValue)) {
      saveData.displayValue = data.displayValue;
      fullText = Object.values(data.displayValue).filter(function(value) {
        return !!value;
      }).join(", ");
      saveData._standard = {
        l10ntext: data.displayValue
      };
      saveData._fulltext = {
        l10ntext: data.displayValue,
        text: fullText,
        string: fullText
      };
    }
    if (data.group) {
      saveData.group = data.group;
    }
    return saveData;
  };

  return LocationUtils;

})();
