{% load static %}
{% load django_glue %}

<!doctype html>
<html lang="en" data-theme="{{ theme.mode }}" data-theme-family="{{ theme.family }}">
<head>
    {% block base_head %}
        {% block base_head_title %}
            <title>{{ html_head_title }}</title>
        {% endblock %}

        {% block base_head_meta %}
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <meta http-equiv="X-UA-Compatible" content="ie=edge">
        {% endblock %}

        {% block base_head_additional_meta %}
        {% endblock %}

        {% block base_head_css %}
            <link rel="stylesheet" href="{% static theme.stylesheet %}">

            <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.x/dist/css/bootstrap.min.css">
            <link rel="stylesheet" href="{% static 'django_spire/css/app-import.css' %}?v={{ DJANGO_SPIRE_VERSION }}">
            <link rel="stylesheet" href="{% static 'django_spire/css/bootstrap-override.css' %}?v={{ DJANGO_SPIRE_VERSION }}">
            <link rel="stylesheet" href="{% static 'django_spire/css/bootstrap-extension.css' %}?v={{ DJANGO_SPIRE_VERSION }}">

            <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.x/font/bootstrap-icons.min.css">
            <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
        {% endblock %}

        {% block base_head_additional_css %}
        {% endblock %}

        {% block base_head_js %}
            <script>
                window.django_spire = window.django_spire || {};
                window.django_spire.theme = {
                    active: '{{ theme.full|escapejs }}',
                    default: '{{ DJANGO_SPIRE_DEFAULT_THEME|escapejs }}',
                    path: '{{ DJANGO_SPIRE_THEME_PATH|escapejs }}'
                };
            </script>

            <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
            <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.x/dist/echarts.min.js"></script>
            <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>

            <script id="theme-config" type="application/json">{{ theme_config|safe }}</script>
            <script type="application/javascript" src="{% static 'django_spire/js/theme.js' %}?v={{ DJANGO_SPIRE_VERSION }}"></script>
            <script type="application/javascript" src="{% static 'django_spire/js/ui.js' %}?v={{ DJANGO_SPIRE_VERSION }}"></script>
            <script type="application/javascript" src="{% static 'django_spire/js/cookie.js' %}?v={{ DJANGO_SPIRE_VERSION }}"></script>
            <script type="application/javascript" src="{% static 'django_spire/js/ajax.js' %}?v={{ DJANGO_SPIRE_VERSION }}"></script>
            <script type="application/javascript" src="{% static 'django_spire/js/dropdown.js' %}?v={{ DJANGO_SPIRE_VERSION }}"></script>
            <script type="application/javascript" src="{% static 'django_spire/js/modal.js' %}?v={{ DJANGO_SPIRE_VERSION }}"></script>

            <script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/intersect@3.14.x/dist/cdn.min.js"></script>
            <script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/mask@3.14.x/dist/cdn.min.js"></script>
            <script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/collapse@3.14.x/dist/cdn.min.js"></script>
            <script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.14.x/dist/cdn.min.js"></script>
            <script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/focus@3.14.x/dist/cdn.min.js"></script>
            <script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/sort@3.x.x/dist/cdn.min.js"></script>
            <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.x/dist/cdn.min.js"></script>
        {% endblock %}

        {% block base_head_additional_js %}
        {% endblock %}

        {% block base_head_additional_content %}
        {% endblock %}
    {% endblock %}
</head>

<body class="{% block base_body_class %}bg-app-layer-one{% endblock %}">
    {% block base_body %}
        {% block base_body_top_js %}
        {% endblock %}

        {% block base_body_additional_top_js %}
        {% endblock %}

        {% block base_body_content %}
        {% endblock %}

        {% block base_body_bottom_js %}
            <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.x/dist/js/bootstrap.bundle.min.js"></script>
        {% endblock %}

        {% block base_body_additional_bottom_js %}
        {% endblock %}

        {% glue_init %}
    {% endblock %}
</body>
</html>
