!function(){"use strict";let e=0,t=!1;function o(o){const r=o.getAttribute("data-display-type"),n="true"===o.getAttribute("data-show-label"),s=(o.getAttribute("data-label-prefix"),o.getAttribute("data-label-suffix"),o.getAttribute("data-label-position")||"inside"),l=o.classList.contains("hide-on-scroll-down");let i,c,a,d;function u(){const e=function(){const e=window.pageYOffset||document.documentElement.scrollTop,t=document.documentElement.scrollHeight-document.documentElement.clientHeight;if(0===t)return 0;const o=e/t*100;return Math.min(Math.max(o,0),100)}(),o=Math.round(e);if("linear"===r&&i&&(i.style.width=e+"%",i.setAttribute("data-progress",o)),"circular"===r&&a&&d){const t=d-e/100*d;a.style.strokeDashoffset=t}n&&c&&(c.textContent=o),t=!1}function f(){t||(window.requestAnimationFrame((function(){u(),function(){if(!l)return;const t=window.pageYOffset||document.documentElement.scrollTop;t>e&&t>100?o.classList.add("is-hidden"):o.classList.remove("is-hidden"),e=t<=0?0:t}()})),t=!0)}"linear"===r?(i=o.querySelector(".scroll-progress-bar"),n&&(c="inside"===s?i.querySelector(".label-value"):o.querySelector(".scroll-progress-label-outside .label-value"))):"circular"===r&&(a=o.querySelector(".progress-circle"),d=parseFloat(a.getAttribute("data-circumference")),n&&(c=o.querySelector(".scroll-progress-label-circular .label-value"))),u(),window.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",(function(){t||(window.requestAnimationFrame(u),t=!0)}),{passive:!0}),o._scrollProgressCleanup=function(){window.removeEventListener("scroll",f)}}function r(){document.querySelectorAll(".eryndo-scroll-progress").forEach(o)}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r(),"undefined"!=typeof MutationObserver&&new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){1===e.nodeType&&(e.classList&&e.classList.contains("eryndo-scroll-progress")?o(e):e.querySelectorAll&&e.querySelectorAll(".eryndo-scroll-progress").forEach(o))}))}))})).observe(document.body,{childList:!0,subtree:!0})}();