{"version":3,"sources":["jsdelivr-header.js","/gh/squarehero-store/back-to-top@0.2.1/back-to-top.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,CCHA,WACI,QAAQ,KAAK,iDAGb,MAAM,EAAkB,SAAS,cAAc,UAC/C,EAAgB,GAAK,YACrB,EAAgB,UAAY,obAQ5B,SAAS,KAAK,YAAY,GAE1B,MAAM,EAAiB,SAAS,eAAe,kBACzC,EAAiD,EAAjC,EAAe,EAAE,QAAQ,MAAY,KAAK,GAChE,EAAe,MAAM,gBAAkB,GAAG,KAAiB,IAO3D,OAAO,iBAAiB,UAAU,KAC9B,MAAM,EAAc,SAAS,gBAAgB,aAAe,SAAS,gBAAgB,aAC/E,EAAiB,OAAO,SAPlC,SAAqB,GACjB,MAAM,EAAS,EAAgB,EAAU,IAAM,EAC/C,EAAe,MAAM,iBAAmB,CAC5C,CAMI,CADuB,EAAiB,EAAe,KAGnD,EAAiB,IACjB,EAAgB,UAAU,IAAI,WAE9B,EAAgB,UAAU,OAAO,UACrC,IAGJ,EAAgB,iBAAiB,SAAS,KACtC,OAAO,SAAS,CAAE,IAAK,EAAG,SAAU,UAAW,GAEtD,CAzCD","file":"/gh/squarehero-store/back-to-top@0.2.1/back-to-top.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /gh/squarehero-store/back-to-top@0.2.1/back-to-top.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// ================================================\n//   ⚡ Back to Top plugin by SquareHero.store\n// ================================================\n(function() {\n    console.info(\"🚀 SquareHero.store Back to Top plugin loaded\");\n\n    // Create back-to-top button\n    const backToTopButton = document.createElement('button');\n    backToTopButton.id = 'backToTop';\n    backToTopButton.innerHTML = `\n        <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 30 36\">\n            <path stroke=\"#fff\" stroke-miterlimit=\"10\" stroke-width=\"1.887\" d=\"M15.115 35.4V1.65M1.516 15.1l13.5-13.5 13.5 13.5\"/>\n        </svg>\n        <svg width=\"50\" height=\"50\">\n            <circle cx=\"25\" cy=\"25\" r=\"20\" stroke-width=\"4\" fill=\"none\" stroke-dasharray=\"126\" stroke-dashoffset=\"126\" id=\"progressCircle\" />\n        </svg>\n    `;\n    document.body.appendChild(backToTopButton);\n\n    const progressCircle = document.getElementById('progressCircle');\n    const circumference = progressCircle.r.baseVal.value * 2 * Math.PI;\n    progressCircle.style.strokeDasharray = `${circumference} ${circumference}`;\n\n    function setProgress(percent) {\n        const offset = circumference - percent / 100 * circumference;\n        progressCircle.style.strokeDashoffset = offset;\n    }\n\n    window.addEventListener('scroll', () => {\n        const scrollTotal = document.documentElement.scrollHeight - document.documentElement.clientHeight;\n        const scrollPosition = window.scrollY;\n        const scrollPercent = (scrollPosition / scrollTotal) * 100;\n        setProgress(scrollPercent);\n\n        if (scrollPosition > 100) {\n            backToTopButton.classList.add('visible');\n        } else {\n            backToTopButton.classList.remove('visible');\n        }\n    });\n\n    backToTopButton.addEventListener('click', () => {\n        window.scrollTo({ top: 0, behavior: 'smooth' });\n    });\n})();"]}