function Step(e, n) {
	this._context = e, this._t = n;
}
Step.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x = this._y = NaN, this._point = 0;
	},
	lineEnd: function() {
		0 < this._t && this._t < 1 && this._point === 2 && this._context.lineTo(this._x, this._y), (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line >= 0 && (this._t = 1 - this._t, this._line = 1 - this._line);
	},
	point: function(e, n) {
		switch (e = +e, n = +n, this._point) {
			case 0:
				this._point = 1, this._line ? this._context.lineTo(e, n) : this._context.moveTo(e, n);
				break;
			case 1: this._point = 2;
			default:
				if (this._t <= 0) this._context.lineTo(this._x, n), this._context.lineTo(e, n);
				else {
					var r = this._x * (1 - this._t) + e * this._t;
					this._context.lineTo(r, this._y), this._context.lineTo(r, n);
				}
				break;
		}
		this._x = e, this._y = n;
	}
};
function step_default(n) {
	return new Step(n, .5);
}
function stepBefore(n) {
	return new Step(n, 0);
}
function stepAfter(n) {
	return new Step(n, 1);
}
export { step_default as default, stepAfter, stepBefore };
