'use strict';dotclear.ready(()=>{const move=(selection,tab='')=>{const prefix=tab===''?'#':`#${tab}.`;globalThis.location=`${prefix}${selection.replace(/^#/, '')}`;const block=document.getElementById(selection.substring(1));block.open=true;const isMotionReduced=globalThis.matchMedia(`(prefers-reduced-motion: reduce)`)?.matches===true;block.scrollIntoView({behavior:isMotionReduced?'instant':'smooth',block:'start',inline:'nearest'});dotclear.setFocusInside(block,true,true);};document.getElementById('gp_submit').style.display='none';document.getElementById('lp_submit').style.display='none';const select_g=document.getElementById('gp_nav');const select_l=document.getElementById('lp_nav');select_g?.addEventListener('change',(event)=>move(event.target.value,'global'));select_l?.addEventListener('change',(event)=>move(event.target.value,'local'));dotclear.responsiveCellHeaders(document.querySelector('table.prefs'),'table.prefs',0,true);for(const element of document.querySelectorAll('table.prefs')){element.classList.add('rch','rch-thead');}
const hash=document.location.hash.split('.');if(hash.length>1){const details_id=hash[1];const details=document.getElementById(details_id);if(details){details.open=true;const select=document.getElementById(`${Array.from(details_id)[0]}p_nav`);if(select)select.value=`#${details_id}`;}}
const update=(list,select)=>{for(const item of list){item.addEventListener('toggle',()=>{if(!item.open){return;}
const details_id=item.id;select.value=`#${details_id}`;});}};const blocks_l=document.querySelectorAll('[name^="l_pref_"]');const blocks_g=document.querySelectorAll('[name^="g_pref_"]');update(blocks_l,select_l);update(blocks_g,select_g);});