{"version":3,"sources":["webpack:///./LeLab.Gcv.Web/src/atomic/atom/a-btn-back/a-btn-back.chunk.js","webpack:///./LeLab.Gcv.Web/src/atomic/atom/a-btn-back/a-btn-back.scss"],"names":["require","btn","document","getElementById","focusableElements","querySelectorAll","rootElement","documentElement","scrollToTop","scrollTo","top","behavior","addEventListener","window","onscroll","scrollFunction","body","scrollTop","style","visibility","backToTop","focus","preventScroll"],"mappings":";;;;;;;;AAAA,mBAAAA,CAAQ,GAAR;;AAEA,IAAIC,MAAMC,SAASC,cAAT,CAAwB,iBAAxB,CAAV;AACA,IAAMC,oBAAoBF,SAASG,gBAAT,CAA0B,qEAA1B,CAA1B;AACA,IAAIC,cAAcJ,SAASK,eAA3B;;AAEA,SAASC,WAAT,GAAuB;AACnB;AACAF,gBAAYG,QAAZ,CAAqB;AACjBC,aAAK,CADY;AAEjBC,kBAAU;AAFO,KAArB;AAIH;;AAEDV,IAAIW,gBAAJ,CAAqB,OAArB,EAA8BJ,WAA9B;;AAGA;AACAK,OAAOC,QAAP,GAAkB,YAAY;AAC1BC;AACH,CAFD;;AAIA,SAASA,cAAT,GAA0B;AACtB,QAAIb,SAASc,IAAT,CAAcC,SAAd,GAA0B,EAA1B,IAAgCf,SAASK,eAAT,CAAyBU,SAAzB,GAAqC,EAAzE,EAA6E;AACzEhB,YAAIiB,KAAJ,CAAUC,UAAV,GAAuB,SAAvB;AACH,KAFD,MAEO;AACHlB,YAAIiB,KAAJ,CAAUC,UAAV,GAAuB,QAAvB;AACH;AACJ;;AAED;AACAlB,IAAIW,gBAAJ,CAAqB,OAArB,EAA8BQ,SAA9B;;AAEA,SAASA,SAAT,GAAqB;AACjBlB,aAASc,IAAT,CAAcC,SAAd,GAA0B,CAA1B;AACAf,aAASK,eAAT,CAAyBE,QAAzB,CAAkC;AAC9BC,aAAK,CADyB;AAE9BC,kBAAU;AAFoB,KAAlC;;AAKAP,sBAAkB,CAAlB,EAAqBiB,KAArB,CAA2B;AACvBC,uBAAe;AADQ,KAA3B;AAGH,C;;;;;;;AC3CD,yC","file":"a-btn-back.js","sourcesContent":["require(\"./a-btn-back.scss\");\r\n\r\nlet btn = document.getElementById(\"js-backToTopBtn\");\r\nconst focusableElements = document.querySelectorAll('button, a, input, select, textarea, [tabindex]:not([tabindex=\"-1\"])');\r\nvar rootElement = document.documentElement;\r\n\r\nfunction scrollToTop() {\r\n // Scroll to top logic\r\n rootElement.scrollTo({\r\n top: 0,\r\n behavior: \"smooth\"\r\n });\r\n}\r\n\r\nbtn.addEventListener(\"click\", scrollToTop);\r\n\r\n\r\n// When the user scrolls down 70px from the top of the document, show the button\r\nwindow.onscroll = function () {\r\n scrollFunction();\r\n};\r\n\r\nfunction scrollFunction() {\r\n if (document.body.scrollTop > 70 || document.documentElement.scrollTop > 70) {\r\n btn.style.visibility = 'visible';\r\n } else {\r\n btn.style.visibility = 'hidden';\r\n }\r\n}\r\n\r\n// When the user clicks on the button, scroll to the top of the document\r\nbtn.addEventListener('click', backToTop);\r\n\r\nfunction backToTop() {\r\n document.body.scrollTop = 0;\r\n document.documentElement.scrollTo({\r\n top: 0,\r\n behavior: \"smooth\"\r\n });\r\n\r\n focusableElements[0].focus({\r\n preventScroll: true,\r\n });\r\n}\n\n\n// WEBPACK FOOTER //\n// ./LeLab.Gcv.Web/src/atomic/atom/a-btn-back/a-btn-back.chunk.js","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./LeLab.Gcv.Web/src/atomic/atom/a-btn-back/a-btn-back.scss\n// module id = 263\n// module chunks = 195"],"sourceRoot":""}