<!DOCTYPE html>
<html>
    <head>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/vuetify/2.2.6/vuetify.min.js"></script>
        <link href="https://cdnjs.cloudflare.com/ajax/libs/vuetify/2.2.6/vuetify.min.css" rel="stylesheet">
        <link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons' rel="stylesheet">
        <link href="https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css" rel="stylesheet">
        <link href='{{resources.base_url}}voila/static/index.css' rel="stylesheet">
        {% if resources.theme == 'dark' %}
        <link href='{{resources.base_url}}voila/static/theme-dark.css' rel="stylesheet">
        {% else %}
        <link href='{{resources.base_url}}voila/static/theme-light.css' rel="stylesheet">
        {% endif-%}

        {% block stylesheets %}
        {% endblock %}

        <script src="{{resources.base_url}}voila/static/require.min.js" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" crossorigin="anonymous"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
        <style>
            /* override vuetify style which causes the scrollbar to always show */
            html {
                overflow-y: hidden;
            }
        </style>
    </head>
    {%- block body_header -%}
    {% if resources.theme == 'dark' %}
    <body class="theme-dark" data-base-url="{{resources.base_url}}voila/">
    {% else %}
    <body class="theme-light" data-base-url="{{resources.base_url}}voila/">
    {% endif-%}
    {%- endblock body_header -%}

        <script>
            {% include "ansi.js" %}
            {% include "util.js" %}
        </script>

        {% include "app.html" %}
    </body>
    {% block notebook_execute %}
    {% endblock notebook_execute %}
    {% set cell_count = nb.cells|length %}

    {% block cell_generator %}
    <script>
        app.loading_text = 'Done'
        app.loadingPercentage = 100
        app.loading = false
    </script>
    {% endblock cell_generator %}

    <script>
        {% if 'jupyter-vuetify/extension' in resources.nbextensions-%}
        window.enable_nbextensions = true;
        {% endif-%}
        requirejs.config({
            baseUrl: '{{resources.base_url}}voila',
            waitSeconds: 3000,
            map: {
                '*': {
                    {% if 'jupyter-vue/extension' in resources.nbextensions-%}
                    'jupyter-vue': 'nbextensions/jupyter-vue/nodeps',
                    {% endif-%}
                    {% if 'jupyter-vuetify/extension' in resources.nbextensions-%}
                    'jupyter-vuetify': 'nbextensions/jupyter-vuetify/nodeps',
                    {% endif-%}
                },
            }
        });
        requirejs([
            {% for ext in resources.nbextensions if ext != 'jupyter-vuetify/extension' and ext != 'jupyter-vue/extension'-%}
                "{{resources.base_url}}voila/nbextensions/{{ ext }}.js",
            {% endfor %}
        ]);
        requirejs(['static/voila'], (voila) => init(voila));
    </script>
</html>
