/* Copyright © 2020 Splunk Inc.
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
in part without a valid written license from Splunk Inc. is PROHIBITED. */
import {
  Heatmap
} from "./chunks/chunk-MI6TOBKM.js";
import {
  RangeSelectionProvider,
  TimeSeriesChart,
  VizContextProvider,
  useRangeSelection,
  useVizContext
} from "./chunks/chunk-ZUJYGCUD.js";
import {
  BasicMultiValueTooltip,
  BasicMultiValueTooltipFactory,
  BasicSingleValueTooltip,
  BasicSingleValueTooltipFactory
} from "./chunks/chunk-ZTIQPCUC.js";
import "./chunks/chunk-5RMFCCVG.js";
import "./chunks/chunk-XJ2QF2ND.js";
import "./chunks/chunk-DYC7NOL7.js";
import {
  BasicEventAnnotationTooltip
} from "./chunks/chunk-G727SYRY.js";
import {
  AlertIcon
} from "./chunks/chunk-BI5HQSM3.js";
import {
  Alert,
  Event,
  SeverityFieldName,
  TypeFieldName
} from "./chunks/chunk-OHHNF4E3.js";
import "./chunks/chunk-FUNDGA5O.js";
import "./chunks/chunk-SIXD2HQM.js";
import {
  BottomLegend,
  BottomLegendFactory,
  LegendMap,
  SideLegend,
  SideLegendFactory
} from "./chunks/chunk-JVJFBB3Y.js";
import {
  VizThemeContext,
  getVizThemeForKey,
  useVizTheme
} from "./chunks/chunk-P6Y5CKTH.js";
import "./chunks/chunk-VCBGETN3.js";
import "./chunks/chunk-SWCBFGHQ.js";
import "./chunks/chunk-YOT4BRQD.js";
import "./chunks/chunk-5LUILIR3.js";
import "./chunks/chunk-6N4JNZ5S.js";
import "./chunks/chunk-FWZM3EJJ.js";
import "./chunks/chunk-V3S5WUKN.js";
import "./chunks/chunk-XC4WXK3L.js";

// src/transforms/sfTimeseriesWithMetadata.ts
var transformSFTimeseriesWithMetadata = (input) => inefficientButCorrectTransform(input);
var inefficientButCorrectTransform = (input) => {
  const allTimes = input.reduce((_allTimes, { data }) => {
    data.forEach(({ ts }) => {
      _allTimes.add(ts);
    });
    return _allTimes;
  }, /* @__PURE__ */ new Set());
  const allTimesArr = Array.from(allTimes).sort((a, b) => a > b ? 1 : -1);
  const allTimesInSecondsArry = allTimesArr.map((t) => t / 1e3);
  const dataset = input.reduce(
    (_dataset, { data, metadata }) => {
      const field = metadata.properties.sf_originatingMetric;
      const seriesColumns = allTimesArr.map((ts) => {
        const p = data.find((d) => d.ts === ts);
        return p ? p.value : null;
      });
      _dataset.fields.push(field);
      _dataset.columns.push(seriesColumns);
      return _dataset;
    },
    {
      fields: ["_time"],
      columns: [allTimesInSecondsArry]
    }
  );
  return dataset;
};
export {
  Alert,
  AlertIcon,
  BasicEventAnnotationTooltip,
  BasicMultiValueTooltip,
  BasicMultiValueTooltipFactory,
  BasicSingleValueTooltip,
  BasicSingleValueTooltipFactory,
  BottomLegend,
  BottomLegendFactory,
  Event,
  Heatmap,
  LegendMap,
  RangeSelectionProvider,
  SeverityFieldName,
  SideLegend,
  SideLegendFactory,
  TimeSeriesChart,
  TypeFieldName,
  VizContextProvider,
  VizThemeContext,
  getVizThemeForKey,
  transformSFTimeseriesWithMetadata,
  useRangeSelection,
  useVizContext,
  useVizTheme
};
//# sourceMappingURL=index.js.map
