<script>
const elements = document.getElementsByClassName('collapsed-navbox-list-base');
const lists = document.getElementsByClassName('collapsed-navbox-list');
const extracters = document.getElementsByClassName('collapsed-navbox-list-extracter');
if (elements.length !== 0) {
function extract(element, index, array) {
let styles = getComputedStyle(element);
if (styles.display !== 'hidden' && styles.display !== 'none' ) {
const list = lists[index];
const extracter = extracters[index];
const cloned = extracter.cloneNode(true);
list.appendChild(cloned);
extracter.remove();
// Parent node of 'collapsed-navbox-list-base' should be 'unprocessed-collapsed-navbox-list'.
element.parentNode.removeAttribute('class');
} else {
element.remove();
}
}
Array.from(elements).forEach(extract);
}
</script>