(()=>{const discipline=document.querySelector('#courseDiscipline');const preview=document.querySelector('#courseCodePreview');const publics=[...document.querySelectorAll('[data-public-code]')];if(!discipline||!preview)return;const refresh=()=>{const option=discipline.options[discipline.selectedIndex];const base=option?.dataset.code||'POLE-DISCIPLINE';const selected=publics.filter(input=>input.checked).map(input=>input.dataset.publicCode);preview.textContent=base+'-'+(selected.length>1?'MIX':(selected[0]||'PUBLIC'));};discipline.addEventListener('change',refresh);publics.forEach(input=>input.addEventListener('change',refresh));refresh();})();
