var List = class {
	constructor() {
		var e = {};
		e._next = e._prev = e, this._sentinel = e;
	}
	dequeue() {
		var e = this._sentinel, n = e._prev;
		if (n !== e) return unlink(n), n;
	}
	enqueue(e) {
		var n = this._sentinel;
		e._prev && e._next && unlink(e), e._next = n._next, n._next._prev = e, n._next = e, e._prev = n;
	}
	toString() {
		for (var e = [], t = this._sentinel, r = t._prev; r !== t;) e.push(JSON.stringify(r, filterOutLinks)), r = r._prev;
		return "[" + e.join(", ") + "]";
	}
};
function unlink(e) {
	e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
}
function filterOutLinks(e, t) {
	if (e !== "_next" && e !== "_prev") return t;
}
export { List };
