import map_default from "../../lodash-es/map.js";
const DFA_ERROR = {};
var ATNConfigSet = class {
	constructor() {
		this.map = {}, this.configs = [];
	}
	get size() {
		return this.configs.length;
	}
	finalize() {
		this.map = {};
	}
	add(e) {
		let r = getATNConfigKey(e);
		r in this.map || (this.map[r] = this.configs.length, this.configs.push(e));
	}
	get elements() {
		return this.configs;
	}
	get alts() {
		return map_default(this.configs, (e) => e.alt);
	}
	get key() {
		let e = "";
		for (let r in this.map) e += r + ":";
		return e;
	}
};
function getATNConfigKey(e, r = !0) {
	return `${r ? `a${e.alt}` : ""}s${e.state.stateNumber}:${e.stack.map((e) => e.stateNumber.toString()).join("_")}`;
}
export { ATNConfigSet, DFA_ERROR, getATNConfigKey };
