import EditorWorker from "monaco-editor/esm/vs/editor/editor.worker.js?worker";
import JsonWorker from "monaco-editor/esm/vs/language/json/json.worker.js?worker";
import YamlWorker from "monaco-yaml/yaml.worker.js?worker";
//#region src/v2/features/editor/helpers/ensure-monaco-environment.ts
/**
* This function ensures that the Monaco Editor's global environment is configured
* to provide the correct web worker for each language (json, yaml, or the default editor).
*/
var ensureMonacoEnvironment = () => {
	globalThis.MonacoEnvironment ??= { getWorker(_workerId, label) {
		switch (label) {
			case "json": return new JsonWorker();
			case "yaml": return new YamlWorker();
			default: return new EditorWorker();
		}
	} };
};
//#endregion
export { ensureMonacoEnvironment };

//# sourceMappingURL=ensure-monaco-environment.js.map