<!-- Libs JS -->
{% assign libs = page.libs | default: layout.libs %}

{% assign google-maps-key = site.google-maps-dev-key %}
{% if jekyll.environment != 'development' %}
	{% assign google-maps-key = site.google-maps-key %}
{% endif %}

{% for lib in site.data.libs.js %}
	{% if libs contains lib[0] or site.data.libs.global-libs contains lib[0] %}
		{% for file in lib[1] %}
		<script src="{% if file contains 'http://' or file contains 'https://' %}{{ file | replace: 'GOOGLE_MAPS_KEY', google-maps-key }}{% else %}{{ site.base }}/{% if jekyll.environment != 'development' %}dist/libs{% else %}node_modules{% endif %}/{% if jekyll.environment != 'development' %}{{ file | replace: '@', '' }}{% else %}{{ file }}{% endif %}{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}{% endif %}" defer></script>
		{% endfor %}
	{% endif %}
{% endfor %}

<!-- Tabler Core -->

<script src="{{ site.base }}/dist/js/tabler{% if jekyll.environment != 'development' %}.min{% endif %}.js{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}" defer></script>
<script src="{{ site.base }}/dist/js/demo{% if jekyll.environment != 'development' %}.min{% endif %}.js{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}" defer></script>


{% removeemptylines %}
{% for script in site.captured_global.scripts %}
{{ script }}
{% endfor %}

{% for script in site.captured_once.scripts %}
{{ script }}
{% endfor %}
{% endremoveemptylines %}

{% assign libs = page.libs | default: layout.libs %}
{% for lib in site.data.libs.js-files %}
{% if libs contains lib[0] or site.data.libs.global-libs contains lib[0] %}
{% for file in lib[1] %}

{% assign filename = 'js/' | append: file | append: '.html' %}
{% include {{filename }} %}

{% endfor %}
{% endif %}
{% endfor %}
