import { isValidDateRangePreset } from "@open-mercato/ui/backend/date-range";
const DEFAULT_SETTINGS = {
  dateRange: "this_month",
  variant: "donut"
};
function hydrateSettings(raw) {
  if (!raw || typeof raw !== "object") return { ...DEFAULT_SETTINGS };
  const obj = raw;
  return {
    dateRange: isValidDateRangePreset(obj.dateRange) ? obj.dateRange : DEFAULT_SETTINGS.dateRange,
    variant: obj.variant === "pie" || obj.variant === "donut" ? obj.variant : DEFAULT_SETTINGS.variant
  };
}
export {
  DEFAULT_SETTINGS,
  hydrateSettings
};
//# sourceMappingURL=config.js.map
