var _a;

import * as tsplus_module_1 from "@tsplus/stdlib/structure/Hash";
import * as tsplus_module_2 from "@tsplus/stdlib/structure/Equals";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/Chunk/equals";
import * as tsplus_module_4 from "@tsplus/stdlib/prelude/Equivalence/number";
import * as tsplus_module_5 from "@tsplus/stdlib/collections/Chunk/single";
import * as tsplus_module_6 from "@tsplus/stdlib/collections/Chunk/concat";
import * as tsplus_module_7 from "@tsplus/stdlib/collections/Chunk/uniq";
import * as tsplus_module_8 from "@tsplus/stdlib/collections/Chunk/range";
import * as tsplus_module_9 from "@tsplus/stdlib/collections/Chunk/map";
export const fromChunk = fromChunk_1;
export const isHistogramBoundaries = isHistogramBoundaries_1;
export const HistogramBoundariesSym = /*#__PURE__*/Symbol.for("@effect/core/io/Metrics/Histogram/Boundaries");
export class HistogramBoundariesInternal {
  constructor(values) {
    this.values = values;
    this[_a] = HistogramBoundariesSym;
  }

  [(_a = HistogramBoundariesSym, tsplus_module_1.Hash.sym)]() {
    return tsplus_module_1.combine(tsplus_module_1.hashString("ets/Metrics/Histogram/Boundaries"), tsplus_module_1.hashUnknown(this.values));
  }

  [tsplus_module_2.Equals.sym](u) {
    return isHistogramBoundaries_1(u) && tsplus_module_3.equals_(this.values, u.values);
  }

}
export const HistogramBoundaries = {};
/**
 * @tsplus static ets/Metrics/Histogram/Boundaries/Ops linear
 */

function fromChunk_1(chunk) {
  return new HistogramBoundariesInternal(tsplus_module_7.uniq_(tsplus_module_6.concat_(chunk, tsplus_module_5.single(Number.MAX_VALUE)), tsplus_module_4.number));
}
/**
 * A helper method to create histogram bucket boundaries for a histogram
 * with linear increasing values.
 *
 * @tsplus static ets/Metrics/Histogram/Boundaries/Ops linear
 */


export function linear(start, width, count) {
  return fromChunk_1(tsplus_module_9.map_(tsplus_module_8.range(0, count - 1), i => start + i * width));
}
/**
 * A helper method to create histogram bucket boundaries for a histogram
 * with exponentially increasing values.
 *
 * @tsplus static ets/Metrics/Histogram/Boundaries/Ops exponential
 */

export function exponential(start, factor, count) {
  return fromChunk_1(tsplus_module_9.map_(tsplus_module_8.range(0, count - 1), i => start * Math.pow(factor, i)));
}
/**
 * @tsplus static ets/Metrics/Histogram/Boundaries/Ops isHistogramBoundaries
 */

function isHistogramBoundaries_1(u) {
  return typeof u === "object" && u != null && HistogramBoundariesSym in u;
}
//# sourceMappingURL=Boundaries.mjs.map