{% load static %}

{% comment %}
    Root file to be used in any theme. Contains all necessary (and up-to-date) libraries.
{% endcomment %}
<!DOCTYPE html>
<html lang="en">
<head>
    {% if GA_TRACKING_ID %}
    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id={{GA_TRACKING_ID}}"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){window.dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', '{{GA_TRACKING_ID}}');
    </script>
    {% endif %}
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    {% block meta %}{% endblock %}
    <title>{% block title %}{% if data.page_title%}{{data.page_title}} | {% endif %}{{ WEBSITE_SHORT_TITLE }}{% endblock %}</title>

    {% block core_css %}
        {% if BOOTSTRAP_VERSION|first == '4' %}
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
              integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N"
              crossorigin="anonymous">
        {% elif BOOTSTRAP_VERSION|first == '5' %}
            {% if BOOTSTRAP_VERSION == '5.1.3' %}
            <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
                  integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
                  crossorigin="anonymous">
            {% elif BOOTSTRAP_VERSION == '5.3.1' %}
            <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet"
                  integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9"
                  crossorigin="anonymous">
            {% endif %}
        <link rel="stylesheet" href="{% static 'core_main_app/common/css/bootstrap5.css' %}" />
        {% endif %}
        <link href="{% static 'fontawesomefree/css/fontawesome.css' %}" rel="stylesheet" type="text/css">
        <link href="{% static 'fontawesomefree/css/brands.css' %}" rel="stylesheet" type="text/css">
        <link href="{% static 'fontawesomefree/css/solid.css' %}" rel="stylesheet" type="text/css">
        <link href="{% static 'fontawesomefree/css/regular.css' %}" rel="stylesheet" type="text/css">
        <link rel="stylesheet" href="{% static 'core_main_app/libs/jquery-ui/1.12.1/jquery-ui.css' %}" />
        <link rel="stylesheet" href="{% static 'core_main_app/libs/jquery-ui/1.12.1/jquery-ui.structure.css' %}" />
        <link rel="stylesheet" href="{% static 'core_main_app/libs/jquery-ui/1.12.1/jquery-ui.theme.css' %}" />
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/atom-one-light.min.css"
              integrity="sha512-o5v54Kh5PH0dgnf9ei0L+vMRsbm5fvIvnR/XkrZZjN4mqdaeH7PW66tumBoQVIaKNVrLCZiBEfHzRY4JJSMK/Q=="
              crossorigin="anonymous">
        <link rel="stylesheet" href="{% static 'core_main_app/common/css/word-wrap.css' %}" />
        <link rel="stylesheet" href="{% static 'core_main_app/common/css/table.css' %}" />
        <link rel="stylesheet" href="{% static 'core_main_app/common/css/buttons.css' %}" />
        <link rel="stylesheet" href="{% static 'core_main_app/common/css/fields.css' %}" />
        <link rel="stylesheet" href="{% static 'core_main_app/common/css/loading-spinner.css' %}" />
        <link rel="stylesheet" href="{% static 'core_main_app/common/css/messages.css' %}" />

        {% if DISPLAY_NIST_HEADERS %}
        <link rel="stylesheet" href="https://pages.nist.gov/nist-header-footer/css/nist-combined.css">
        {% endif %}
    {% endblock %}
    {% block theme_css %}{% endblock %}
    {% block app_css %}{% endblock %}
</head>
<body>
    {% block body %}{% endblock %}
    {% block app_modals %}{% endblock %}

    {% block core_js %}
       <script src="https://code.jquery.com/jquery-3.7.0.js"
                integrity="sha256-JlqSTELeR4TLqP0OG9dxM7yDPqX1ox/HfgiSLBj8+kM="
                crossorigin="anonymous"></script>
        <script src="{% static 'core_main_app/libs/jquery-ui/1.12.1/jquery-ui.js' %}"></script>
        {% if BOOTSTRAP_VERSION|first == '4' %}
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"
                integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct"
                crossorigin="anonymous"></script>
        {% elif BOOTSTRAP_VERSION == '5.1.3' %}
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
                integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
                crossorigin="anonymous"></script>
        {% elif BOOTSTRAP_VERSION == '5.3.1' %}
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js"
                integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm"
                crossorigin="anonymous"></script>
        {% endif %}
        <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"
                integrity="sha384-g4mRvs7AO0/Ol5LxcGyz4Doe21pVhGNnC3EQw5shw+z+aXDN86HqUdwXWO+Gz2zI"
                crossorigin="anonymous"></script>
        <script>hljs.highlightAll();</script>
        <script src="{% static 'core_main_app/common/js/csrf.js' %}"></script>
        <script src="{% static 'core_main_app/common/js/leave_notice.js' %}"></script>
        <script src="{% static 'core_main_app/common/js/loading_spinner.js' %}"></script>
        {% if DISPLAY_NIST_HEADERS %}
        <script src="https://pages.nist.gov/nist-header-footer/js/nist-header-footer.js" type="text/javascript" defer="defer"></script>
        {% endif %}
    {% endblock %}
    {% block theme_js %}{% endblock %}
    {% block app_js %}{% endblock %}
    {% include 'core_main_app/_render/common/messages.html' %}

    <!--
    From the documentation:
        Add the detection template tag to your site, ideally in your base layout just before the </body> tag
    -->
</body>
</html>