`;}for(let i=2;i<=74;i+=10){svg+=``;}svg+=``;svg+=`${content}`;svg+=` `;$('section').innerHTML=svg;}function startProgressBar(timeout){let width=0;frame=setInterval(function(){width++;$('#progress-Bar').style.width=width+"%";$('#progress-Bar').textContent=Math.abs(Math.floor(width / 10-10));if(width>=100){clearInterval(frame);$('#progress-Bar').textContent='';}},timeout / 100);}function numberMax(number){if($('#numMin').value>=number){$('#numMin').value=(number-1);}}function numberMin(number){if($('#numMax').value<=number){$('#numMax').value=(number+10);}}function restrictMinus(e){if(e.key==='-'||e.key==='+'||e.key===','||e.key==='.'){e.preventDefault();}}function startString(checkBox){if(checkBox.checked){learning();}}function startCountdown(checkBox){if(checkBox.checked===true){const label=$('label.startString');const rangeValue=$('#range').valueAsNumber;const start=10;const current=start;const totalDurationMs=(11-rangeValue)*1000+add;const stepMs=totalDurationMs / start;let value=start;if(label){label.classList.add('counting');label.setAttribute('data-start',value);const countdown=setInterval(()=>{value--;if(value>=0){label.setAttribute('data-start',value);label.classList.remove('counting');void label.offsetWidth;label.classList.add('counting');}else{label.classList.remove('counting');clearInterval(countdown);learning();}},stepMs);}else{learning();}}}function toggleOptions(checkBox){let right=$("#input-exercise"),left=$("#left-options");if(checkBox.checked===true){if(left){left.style.maxHeight=left.scrollHeight+30+"px";left.style.height=left.scrollHeight+30+"px";}if(right){right.style.maxHeight=right.scrollHeight+"px";}}else{if(left){left.style.maxHeight=null;left.style.height=null;}if(right){right.style.maxHeight=null;}}}document.addEventListener('fullscreenchange',()=>{const container=$('#options-container');const checkBox=$('#fullScreen');if(checkBox&&container){checkBox.checked=!!document.fullscreenElement;const label=$('label[for="fullScreen"]',container);if(label){const state=checkBox.checked?'_checked':'';label.style.setProperty('--icon-url',`url("/learning/img/icon_fullscreen${state}.svg")`);label.setAttribute('aria-checked',checkBox.checked);}}});keydown((e)=>{if(isElementEditable(e.target))return;if(['Space','ArrowRight','PageDown','ArrowDown','Enter','NumpadEnter'].includes(e.code)){e.preventDefault();learning();}});ready(()=>{const container=$('#options-container');if(!container)return;const updateIcon=(checkbox)=>{const label=checkbox.closest('label')||$(`label[for="${checkbox.id}"]`,container);if(!label)return;const icon=label.dataset.icon;if(!icon)return;const state=checkbox.checked?'_checked':'';label.style.setProperty('--icon-url',`url("/learning/img/icon_${icon}${state}.svg")`);label.setAttribute('aria-checked',checkbox.checked);};$('input[type="checkbox"]',container).forEach(updateIcon);container.addEventListener('change',(e)=>{if(e.target.matches('input[type="checkbox"]'))updateIcon(e.target);});$('#output').value=$('#range').valueAsNumber;toggleOptions($("#toggle-options"));});