{ "version": 3, "sources": ["../../views/main.ts"], "sourcesContent": ["const setMobileActiveStateListener = () => {\n // Get the hamburger button element\n const hamburger = document.getElementById('hamburger') as HTMLButtonElement\n\n const mm_toggle_elements = [\n document.body,\n document.querySelector('aside.mobile_controls') as HTMLElement,\n document.querySelector('nav.mobile') as HTMLElement,\n ]\n\n // Add click event listener to the hamburger button\n hamburger.addEventListener('click', () => {\n // Toggle the 'is-active' class for each element\n hamburger.classList.toggle('is-active')\n mm_toggle_elements.forEach(\n el =>\n (el.dataset.mmActive =\n el.dataset.mmActive === 'true' ? 'false' : 'true')\n // el.setAttribute(\n // 'data-mm-active',\n // el.getAttribute('data-mm-active') === 'true' ? 'false' : 'true'\n // )\n )\n })\n}\n\nconst setCopyrights = () => {\n // Get all elements with 'data-copyright' attribute\n const copyrights: NodeListOf =\n document.querySelectorAll('[data-copyright]')\n\n // Set the inner text of each copyright element to the COPYRIGHT value from the environment\n copyrights.forEach((el: HTMLElement) => {\n el.innerText = env.COPYRIGHT\n })\n}\n\nconst isLongTestimonial = () => {\n const max_length = 180\n\n const testimonial = document.querySelector(\n 'body > div.wrapper > footer div.testimonial'\n )\n const size = testimonial?.getAttribute('data-count')\n\n if (size && parseInt(size) > max_length) testimonial?.classList.add('long')\n}\n\nconst setImageFocalPoints = () => {\n // Function to get an attribute value as a number\n const getAttributeAsNumber = (el: HTMLElement, attr: string) => {\n const attrValue = el.getAttribute(attr)\n return attrValue ? parseInt(attrValue) : null\n }\n\n // For each image element\n ;(\n document.querySelectorAll('img, source') as NodeListOf\n ).forEach(el => {\n // Get the values of the specified attributes as numbers\n const [w, h, focal_x, focal_y] = [\n 'data-width',\n 'data-height',\n 'data-focal-point-x',\n 'data-focal-point-y',\n ].map(attr => getAttributeAsNumber(el, attr))\n\n // If any of the values are null, return\n if (!w || !h || !focal_x || !focal_y) return\n\n // Set the object position of the image based on the focal point\n el.style.objectPosition = `${(focal_x / w) * 100}% ${\n (focal_y / h) * 100\n }%`\n })\n}\n\n;(() => {\n // Set the mobile active state listener\n setMobileActiveStateListener()\n\n // Set the COPYRIGHT value from the environment to each element with 'data-copyright' attribute\n setCopyrights()\n\n // Adjust Footer Testimonial CSS\n isLongTestimonial()\n\n // Set the focal point of each image\n // setImageFocalPoints()\n})()\n"], "mappings": "mBAAA,IAAMA,EAA+B,IAAM,CAEvC,IAAMC,EAAY,SAAS,eAAe,WAAW,EAE/CC,EAAqB,CACvB,SAAS,KACT,SAAS,cAAc,uBAAuB,EAC9C,SAAS,cAAc,YAAY,CACvC,EAGAD,EAAU,iBAAiB,QAAS,IAAM,CAEtCA,EAAU,UAAU,OAAO,WAAW,EACtCC,EAAmB,QACfC,GACKA,EAAG,QAAQ,SACRA,EAAG,QAAQ,WAAa,OAAS,QAAU,MAKvD,CACJ,CAAC,CACL,EAEMC,EAAgB,IAAM,CAGpB,SAAS,iBAAiB,kBAAkB,EAGrC,QAASD,GAAoB,CACpCA,EAAG,UAAY,gCACnB,CAAC,CACL,EAEME,EAAoB,IAAM,CAG5B,IAAMC,EAAc,SAAS,cACzB,6CACJ,EACMC,EAAOD,GAAa,aAAa,YAAY,EAE/CC,GAAQ,SAASA,CAAI,EAAI,KAAYD,GAAa,UAAU,IAAI,MAAM,CAC9E,EAiCIE,EAA6B,EAG7BC,EAAc,EAGdC,EAAkB", "names": ["setMobileActiveStateListener", "hamburger", "mm_toggle_elements", "el", "setCopyrights", "isLongTestimonial", "testimonial", "size", "setMobileActiveStateListener", "setCopyrights", "isLongTestimonial"] }