//#region src/components/table/Actions/component/ColumnsSetting/utils.ts
function isFixedOrderValid(columns) {
	let leftStart = -1;
	let leftEnd = -1;
	let rightStart = -1;
	for (let i = 0; i < columns.length; i++) {
		const column = columns[i];
		if (column.fixed === true || column.fixed === "left") {
			if (leftStart === -1) leftStart = i;
			if (leftEnd !== -1 || rightStart !== -1) return false;
		} else if (column.fixed === "right") {
			if (rightStart === -1) rightStart = i;
			if (leftEnd === -1 && leftStart !== -1) leftEnd = i - 1;
		} else {
			if (leftEnd === -1 && leftStart !== -1) leftEnd = i - 1;
			if (rightStart !== -1) return false;
		}
	}
	return leftStart === -1 || leftStart === 0;
}
//#endregion
exports.isFixedOrderValid = isFixedOrderValid;
