_parseConfig = function _parseConfig(cfg) {
		if (CONFIG && CONFIG === cfg) {
			return;
		}
		/* Shield configuration object from tampering */


		if (!cfg || typeof cfg !== 'object') {
			cfg = {};
		}
		/* Shield configuration object from prototype pollution */


		cfg = clone(cfg);
		PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
			SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE; // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.

		transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
		/* Set configuration parameters */

		ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
		ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
		ALLOWED_NAMESPACES = 'ALLOWED_NAMESPACES' in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
		URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent
			cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent
			transformCaseFunc // eslint-disable-line indent
		) // eslint-disable-line indent
			: DEFAULT_URI_SAFE_ATTRIBUTES;
		DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent
			cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent
			transformCaseFunc // eslint-disable-line indent
		) // eslint-disable-line indent
			: DEFAULT_DATA_URI_TAGS;
		FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
		FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
		FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
		USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
		ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true

		ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true

		ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false

		ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true

		SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false

		WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false

		RETURN_DOM = cfg.RETURN_DOM || false; // Default false

		RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false

		RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false

		FORCE_BODY = cfg.FORCE_BODY || false; // Default false

		SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true

		SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false

		KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true

		IN_PLACE = cfg.IN_PLACE || false; // Default false

		IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
		NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
		CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};

		if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
			CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
		}

		if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
			CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
		}

		if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
			CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
		}

		if (SAFE_FOR_TEMPLATES) {
			ALLOW_DATA_ATTR = false;
		}

		if (RETURN_DOM_FRAGMENT) {
			RETURN_DOM = true;
		}
		/* Parse profile info */


		if (USE_PROFILES) {
			ALLOWED_TAGS = addToSet({}, [...text]);
			ALLOWED_ATTR = [];

			if (USE_PROFILES.html === true) {
				addToSet(ALLOWED_TAGS, html$1);
				addToSet(ALLOWED_ATTR, html);
			}

			if (USE_PROFILES.svg === true) {
				addToSet(ALLOWED_TAGS, svg$1);
				addToSet(ALLOWED_ATTR, svg);
				addToSet(ALLOWED_ATTR, xml);
			}

			if (USE_PROFILES.svgFilters === true) {
				addToSet(ALLOWED_TAGS, svgFilters);
				addToSet(ALLOWED_ATTR, svg);
				addToSet(ALLOWED_ATTR, xml);
			}

			if (USE_PROFILES.mathMl === true) {
				addToSet(ALLOWED_TAGS, mathMl$1);
				addToSet(ALLOWED_ATTR, mathMl);
				addToSet(ALLOWED_ATTR, xml);
			}
		}
		/* Merge configuration parameters */


		if (cfg.ADD_TAGS) {
			if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
				ALLOWED_TAGS = clone(ALLOWED_TAGS);
			}

			addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
		}

		if (cfg.ADD_ATTR) {
			if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
				ALLOWED_ATTR = clone(ALLOWED_ATTR);
			}

			addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
		}

		if (cfg.ADD_URI_SAFE_ATTR) {
			addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
		}

		if (cfg.FORBID_CONTENTS) {
			if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
				FORBID_CONTENTS = clone(FORBID_CONTENTS);
			}

			addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
		}
		/* Add #text in case KEEP_CONTENT is set to true */


		if (KEEP_CONTENT) {
			ALLOWED_TAGS['#text'] = true;
		}
		/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */


		if (WHOLE_DOCUMENT) {
			addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
		}
		/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */


		if (ALLOWED_TAGS.table) {
			addToSet(ALLOWED_TAGS, ['tbody']);
			delete FORBID_TAGS.tbody;
		}

		if (cfg.TRUSTED_TYPES_POLICY) {
			if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
				throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
			}

			if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
				throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
			} // Overwrite existing TrustedTypes policy.


			trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; // Sign local variables required by `sanitize`.

			emptyHTML = trustedTypesPolicy.createHTML('');
		} else {
			// Uninitialized policy, attempt to initialize the internal dompurify policy.
			if (trustedTypesPolicy === undefined) {
				trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
			} // If creating the internal policy succeeded sign internal variables.


			if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
				emptyHTML = trustedTypesPolicy.createHTML('');
			}
		} // Prevent further manipulation of configuration.
		// Not available in IE8, Safari 5, etc.


		if (freeze) {
			freeze(cfg);
		}

		CONFIG = cfg;
	}
_parseConfig

@param  {Object} cfg optional config literal