import { CardinalOpen as e } from "./cardinalOpen.js";
import { point as t } from "./catmullRom.js";
//#region ../../node_modules/d3-shape/src/curve/catmullRomOpen.js
function n(e, t) {
	this._context = e, this._alpha = t;
}
n.prototype = {
	areaStart: function() {
		this._line = 0;
	},
	areaEnd: function() {
		this._line = NaN;
	},
	lineStart: function() {
		this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
	},
	lineEnd: function() {
		(this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
	},
	point: function(e, n) {
		if (e = +e, n = +n, this._point) {
			var r = this._x2 - e, i = this._y2 - n;
			this._l23_a = Math.sqrt(this._l23_2a = (r * r + i * i) ** +this._alpha);
		}
		switch (this._point) {
			case 0:
				this._point = 1;
				break;
			case 1:
				this._point = 2;
				break;
			case 2:
				this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
				break;
			case 3: this._point = 4;
			default:
				t(this, e, n);
				break;
		}
		this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = n;
	}
};
var r = (function t(r) {
	function i(t) {
		return r ? new n(t, r) : new e(t, 0);
	}
	return i.alpha = function(e) {
		return t(+e);
	}, i;
})(.5);
//#endregion
export { r as default };
