/**
 * @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */

export const PROGRAMMING_LANGUAGES = [
	'angular-html',
	'angular-ts',
	'astro',
	'bash',
	'blade',
	'c',
	'coffee',
	'coffeescript',
	'cpp',
	'c++',
	'css',
	'diff',
	'glsl',
	'graphql',
	'gql',
	'haml',
	'handlebars',
	'hbs',
	'html',
	'html-derivative',
	'http',
	'imba',
	'jade',
	'java',
	'javascript',
	'jinja',
	'jison',
	'jl',
	'js',
	'json',
	'json5',
	'jsonc',
	'jsonl',
	'jsx',
	'julia',
	'less',
	'lit',
	'markdown',
	'marko',
	'md',
	'mdc',
	'mdx',
	'php',
	'plain',
	'postcss',
	'py',
	'python',
	'pug',
	'r',
	'regex',
	'regexp',
	'sass',
	'scss',
	'sh',
	'shell',
	'shellscript',
	'sql',
	'styl',
	'stylus',
	'svelte',
	'text',
	'ts',
	'ts-tags',
	'tsx',
	'typescript',
	'vue',
	'vue-html',
	'wasm',
	'wgsl',
	'wit',
	'xml',
	'yaml',
	'yml',
	'zsh'
];

export function findCodeLang( codeElement ) {
	return Array.from( codeElement.classList ).find( className => PROGRAMMING_LANGUAGES.includes( className ) );
}
