
$(function(){var navbarBg=$(".navbar-background");var navbarBgEl=navbarBg[0];var rowSecondary=$(".row-secondary");var rowSecondaryEl=rowSecondary[0];var secondaryPanel=rowSecondaryEl?rowSecondaryEl.querySelector(".navbar-panel"):null;var padEnd=40;var colorStart=40;var colorEnd=120;function updateScrollState(){var y=window.scrollY;var padProgress=Math.min(1,y/padEnd);var colorProgress=y<=colorStart?0:Math.min(1,(y-colorStart)/(colorEnd-colorStart));if(y>colorStart){navbarBg.addClass("scrolled");rowSecondary.addClass("scrolled");}else{navbarBg.removeClass("scrolled");rowSecondary.removeClass("scrolled");}
if(rowSecondaryEl){if(navbarBgEl.classList.contains("compact")){rowSecondaryEl.style.top="";}else{var baseTop=parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-height-base'));var topOffset=12*(1-padProgress);rowSecondaryEl.style.top=(baseTop+topOffset)+"px";}}
var pad=6*(1-padProgress);if(colorProgress<1){var alpha=0.92*colorProgress;var blur=16*colorProgress;navbarBgEl.style.backgroundColor="rgba(6,6,32,"+alpha+")";navbarBgEl.style.backdropFilter="blur("+blur+"px)";navbarBgEl.style.webkitBackdropFilter="blur("+blur+"px)";navbarBgEl.style.padding=pad+"px 0";}else{navbarBgEl.style.backgroundColor="";navbarBgEl.style.backdropFilter="";navbarBgEl.style.webkitBackdropFilter="";navbarBgEl.style.padding="";}
if(rowSecondaryEl){if(colorProgress<1){var wAlpha=0.92*colorProgress;var sBlur=16-8*colorProgress;var shadow=0.1*colorProgress;var borderAlpha=0.12*(1-colorProgress);rowSecondaryEl.style.backgroundColor="rgba(255,255,255,"+wAlpha+")";rowSecondaryEl.style.backdropFilter="blur("+sBlur+"px)";rowSecondaryEl.style.webkitBackdropFilter="blur("+sBlur+"px)";rowSecondaryEl.style.boxShadow="0 1px 0 0 rgba(0,0,0,"+shadow+")";if(secondaryPanel){secondaryPanel.style.borderColor="rgba(255,255,255,"+borderAlpha+")";}}else{rowSecondaryEl.style.backgroundColor="";rowSecondaryEl.style.backdropFilter="";rowSecondaryEl.style.webkitBackdropFilter="";rowSecondaryEl.style.boxShadow="";if(secondaryPanel){secondaryPanel.style.borderColor="";}}}}
$(window).on("scroll",updateScrollState);updateScrollState();var titleBig=document.querySelector(".title-big");if(titleBig){var compactObserver=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){navbarBg.removeClass("compact");}else{if(entry.boundingClientRect.top<0){navbarBg.addClass("compact");}}
updateScrollState();});},{threshold:0,rootMargin:"-"+getComputedStyle(document.documentElement).getPropertyValue('--navbar-height-base').trim()+" 0px 0px 0px"});compactObserver.observe(titleBig);}
var navbg=$(".navbar-background");var initialHeight=navbg.height();var refs=$(".level2 .menu-item a");var items=$(".level2 .menu-item");var address=document.location.pathname;console.log(items);if(address.includes("#")){address=address.split('#')[0];}
var matching=[];refs.each(function(i){var local=$(this).attr("dir")?$(this).attr("dir"):$(this).attr("href");if(local!=null){local=local.split(".")[0];if(address.includes(local)){matching.push({href:local,item:items[i]});}
$(this).click(function(){console.log(items.find('.active'));items.find('.active').removeClass('active')
items[i].classList.add("active");});}});matching=matching.sort((a,b)=>{let aMatches=address.includes(a.href);let bMatches=address.includes(b.href);if(aMatches===bMatches){return a.href.localeCompare(b.href);}
return aMatches?-1:1;}).reverse();if(matching.length>0){var value=matching[0].href;console.log(value);for(var m of matching){if(m.href==value){console.log(m.href);m.item.classList.add("active");}}}});$(function(){var tooltips=$(".btn-tooltip");tooltips.each(function(i,e){$(e).parent().mouseenter(function(){$(e).attr("active","true")}).mouseleave(function(){$(e).attr("active",null);});});});$(function(){const sections=$(".section h2[id], .sect2 h3[id]");sections.each(function(index,el){var t=$(el).append(`
      <span class="copy-link">
        <svg xmlns="http://www.w3.org/2000/svg" class="icon-link" width="18" height="18" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
          <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
          <path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" />
          <path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" />
        </svg>
      </span>
      <span class="copy-confirmation"/>
    `);$(el).find('.copy-link').on('click',e=>{var url=window.location.href;if(url.indexOf('#')>-1){url=url.split('#')[0];}
const textToCopy=url+"#"+el.id;var myTemporaryInputElement=document.createElement("input");myTemporaryInputElement.type="text";myTemporaryInputElement.value=textToCopy;document.body.appendChild(myTemporaryInputElement);myTemporaryInputElement.select();document.execCommand("Copy");document.body.removeChild(myTemporaryInputElement);console.log('Copied link:'+textToCopy)
var confirmation=$(el).find('.copy-confirmation');confirmation.attr('active','true');setTimeout(()=>confirmation.attr('active','false'),1000);});});});