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