text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
  	value: true
  });
  
  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  
  exports.default = function () {
  
  	var options = _defaultOptionsForComputation.SMA;
  
  	function calculator(data) {
  		var _options = options,
  		    windowSize = _options.windowSize,
  		    sourcePath = _options.sourcePath;
  
  
  		var average = (0, _utils.slidingWindow)().windowSize(windowSize).sourcePath(sourcePath).accumulator(function (values) {
  			return (0, _d3Array.mean)(values);
  		});
  
  		return average(data);
  	}
  	calculator.undefinedLength = function () {
  		var _options2 = options,
  		    windowSize = _options2.windowSize;
  
  		return windowSize - 1;
  	};
  	calculator.options = function (x) {
  		if (!arguments.length) {
  			return options;
  		}
  		options = _extends({}, _defaultOptionsForComputation.SMA, x);
  		return calculator;
  	};
  
  	return calculator;
  };
  
  var _d3Array = require("d3-array");
  
  var _utils = require("../utils");
  
  var _defaultOptionsForComputation = require("./defaultOptionsForComputation");