createOrder = (array, preferredOrder) => {
	const originalArray = array.slice();
	/** @type {Set<string>} */
	const set = new Set(array);
	/** @type {Set<string>} */
	const usedSet = new Set();
	array.length = 0;
	for (const element of preferredOrder) {
		if (element.endsWith("!") || set.has(element)) {
			array.push(element);
			usedSet.add(element);
		}
	}
	for (const element of originalArray) {
		if (!usedSet.has(element)) {
			array.push(element);
		}
	}
	return array;
}
@param {string[]} array array
@param {string[]} preferredOrder preferred order
@returns {string[]} result