<script lang="ts" module>
	const imgs = import.meta.glob(
		"./imgs/*.{avif,AVIF,heif,HEIF,jpeg,JPEG,jpg,JPG,png,PNG,tiff,TIFF,webp,WEBP,svg,SVG,gif,GIF}",
		{
			eager: true,
			import: "default",
			query: {
				enhanced: true,
			},
		},
	);
	let trimmedImgs: Record<string, unknown> = {};
	Object.entries(imgs).forEach(([key, value]) => {
		let trimmedString = key.replace("./imgs/", "");
		let trimmedString2 = trimmedString.replace(/(.*)\.[^.]+$/, "$1");
		trimmedImgs[trimmedString2] = value;
	});

	export function snackImage(img: string) {
		return trimmedImgs[img];
	}

	export function snackImages(imgs: string[]) {
		return imgs.map(img => trimmedImgs[img]);
	}
</script>
