import * as monaco from "monaco-editor/esm/vs/editor/editor.api.js";
//#region src/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.ts
var isVisibleDiagnostic = (marker) => marker.severity === monaco.MarkerSeverity.Error || marker.severity === monaco.MarkerSeverity.Warning;
var compareDiagnostics = (a, b) => {
	if (a.severity !== b.severity) return b.severity - a.severity;
	if (a.startLineNumber !== b.startLineNumber) return a.startLineNumber - b.startLineNumber;
	return a.startColumn - b.startColumn;
};
/**
* Returns up to `maxVisible` diagnostics from the provided markers array,
* filtering to only errors and warnings, sorted by severity and position in the document.
*/
var getVisibleDiagnostics = (markers, maxVisible) => [...markers].filter(isVisibleDiagnostic).sort(compareDiagnostics).slice(0, maxVisible);
//#endregion
export { getVisibleDiagnostics };

//# sourceMappingURL=get-visible-diagnostics.js.map