private function getSerializedConfig() {
		// Ensure that '_' comes first in the output.
		$config = [ '_' => true ];
		$config = $this->getConfig( $config );
		// Post-process config array to turn Tag references into ID references
		// and HtmlSnippet references into a { html: 'string' } JSON form.
		$replaceElements = function ( &$item ) {
			if ( $item instanceof Tag ) {
				$item->ensureInfusableId();
				$item = [ 'tag' => $item->getAttribute( 'id' ) ];
			} elseif ( $item instanceof HtmlSnippet ) {
				$item = [ 'html' => (string)$item ];
			}
		};
		array_walk_recursive( $config, $replaceElements );
		// Set '_' last to ensure that subclasses can't accidentally step on it.
		$config['_'] = $this->getJavaScriptClassName();
		return $config;
	}