{"version":3,"file":"../../../src/javascript/coursedetail.js","names":["document","addEventListener","anchors","querySelectorAll","forEach","anchor","event","preventDefault","target","getAttribute","substring","smoothScroll","offset","element","getElementById","bodyRect","body","getBoundingClientRect","top","elementRect","elementPosition","offsetPosition","window","scrollTo","behavior","nodeName","setAttribute"],"sources":["coursedetail.js"],"sourcesContent":["\ndocument.addEventListener('DOMContentLoaded', () => {\n const anchors = document.querySelectorAll('a[href^=\"#\"]');\n anchors.forEach(function(anchor) {\n anchor.addEventListener('click', function(event) {\n event.preventDefault();\n const target = anchor.getAttribute('href').substring(1);\n smoothScroll(target, 150);\n });\n });\n});\n\n\nfunction smoothScroll(target, offset) {\n const element = document.getElementById(target);\n if (element) {\n const bodyRect = document.body.getBoundingClientRect().top;\n const elementRect = element.getBoundingClientRect().top;\n const elementPosition = elementRect - bodyRect;\n const offsetPosition = elementPosition - offset;\n window.scrollTo({\n top: offsetPosition,\n behavior: 'smooth'\n });\n if (element.nodeName === 'DETAILS') {\n element.setAttribute('open', '');\n }\n }\n}"],"mappings":";;AACAA,QAAQ,CAACC,gBAAgB,CAAC,kBAAkB,EAAE,YAAM;EAChD,IAAMC,OAAO,GAAGF,QAAQ,CAACG,gBAAgB,CAAC,cAAc,CAAC;EACzDD,OAAO,CAACE,OAAO,CAAC,UAASC,MAAM,EAAE;IAC7BA,MAAM,CAACJ,gBAAgB,CAAC,OAAO,EAAE,UAASK,KAAK,EAAE;MAC7CA,KAAK,CAACC,cAAc,CAAC,CAAC;MACtB,IAAMC,MAAM,GAAGH,MAAM,CAACI,YAAY,CAAC,MAAM,CAAC,CAACC,SAAS,CAAC,CAAC,CAAC;MACvDC,YAAY,CAACH,MAAM,EAAE,GAAG,CAAC;IAC7B,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC;AAGF,SAASG,YAAYA,CAACH,MAAM,EAAEI,MAAM,EAAE;EAClC,IAAMC,OAAO,GAAGb,QAAQ,CAACc,cAAc,CAACN,MAAM,CAAC;EAC/C,IAAIK,OAAO,EAAE;IACT,IAAME,QAAQ,GAAGf,QAAQ,CAACgB,IAAI,CAACC,qBAAqB,CAAC,CAAC,CAACC,GAAG;IAC1D,IAAMC,WAAW,GAAGN,OAAO,CAACI,qBAAqB,CAAC,CAAC,CAACC,GAAG;IACvD,IAAME,eAAe,GAAGD,WAAW,GAAGJ,QAAQ;IAC9C,IAAMM,cAAc,GAAGD,eAAe,GAAGR,MAAM;IAC/CU,MAAM,CAACC,QAAQ,CAAC;MACZL,GAAG,EAAEG,cAAc;MACnBG,QAAQ,EAAE;IACd,CAAC,CAAC;IACF,IAAIX,OAAO,CAACY,QAAQ,KAAK,SAAS,EAAE;MAChCZ,OAAO,CAACa,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;IACpC;EACJ;AACJ","ignoreList":[]}